-
Notifications
You must be signed in to change notification settings - Fork 4
Home
- http://github.com/febuiles/shipping_calc/
- mailto:federico.builes@gmail.com
Shipping Calculator written in Ruby to get quick quotes from the major
carriers (UPS, DHL, FedEX, FreightQuote).
- Current version only supports DHL and FreightQuote
You can find an example of each carrier’s API under the /examples directory.
A simple DHL example:
require ‘rubygems’
require ‘shipping_calc’
include ShippingCalc
opts = {
:api_user => “your_user”,
:api_password => “your_pwd”,
:shipping_key => “your_key”,
:account_num => “your_accnt”,
:date => Time.now, # or something…
:service_code => “E”, # check the docs to find out what this means
:shipment_code => “P”, # check the docs to find out what this means
:weight => 34, # weight in lbs
:to_zip => 10001,
:to_state => “NY”
}
d = DHL.new
a = d.quote(opts)
p a
- You must obtain all the DHL ShipIt data (user, password, key and account) from http://www.dhl-usa.com/TechTools/detail/TTDetail.asp?nav=TechnologyTools/Shipping/OwnSoln
- REXML
- sudo gem install shipping-calc
To run the DHL tests you’ll need to have a .dhl_info.yml file in your home directory with your auth info like this:
~/.dhl_info.yml
This is necessary only for the tests and it’ll be ignored for the actual
usage of the the library.