|
Project Information
Links
|
Postman is a simple rails plugin that calculates shipping rates based on data from the database. It is meant for cases where the postal service does not have an API for getting the shipping rates. What Postman does is to get the values from the tables and calculate it out. The values are found in your database tables. You'd have to add the mailing rates into the tables for it to work. The plugin is very simple. I've included some sql files to help put in the countries and mailing rates(in Singapore). You can use them as a reference. And here's the original rates: http://www.singpost.com.sg/quick_services/quicks_03postal_02overseas01.htm The blog post is here Installation ruby script/plugin install http://rails-postman.googlecode.com/svn/trunk/postman Before using it Generate and apply the migration: ruby script/generate postman_migration rake db:migrate Add values into the tables
Definition of the tables destinations
postage_mails
weight_limit
step_rates
step_weight
transit_time
How to use it Just call Postman.postageCalculator("Singapore", 100) the first argument is the coutry in text, the second argument is the weight in your base unit(which happens to be grams for me) Testing Create a database called 'plugin_test' Update the user/password in database.yml And run 'rake test' from the plugin directory |