Plugin details

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.

Websitehttp://liangzan.net/?p=31 Repositoryhttp://rails-postman.googlecode.com/svn/trunk Author Liang Zan Tags rate LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://rails-postman.googlecode.com/svn/trunk

Before using it
==============
Generate and apply the migration:

ruby script/generate postman_migration 
rake db:migrate 



Add values into the tables
-countries
-destinations
-postage_mails
-step_rates
-step_weights
-transit_time
-weight_limit

Definition of the tables
=================
destinations
-the term for the group of countries. Usually postal services group countries up by distance, and set different rates for each zone.

postage_mails
-corresponding rates for the weight

weight_limit
-the maximum weight limit for the rates from postage_mails

step_rates
-the unit rates for additional weight beyond the weight limit

step_weight
-the divisor used to divide up the additional weight

transit_time
-the time needed to ship to the destinations

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

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 6 months ago