mc-fedex

A gem to generate a FedEx label. You must supply the WSDL file in roder for this to work. We’ve set up limited tests due to the fact that the WSDL is not included.

Some code were copied from: github.com/mcmire/fedex

Usage

Create an instance

These are the required options:

driver = McFedex::Base.new(:auth_key       => AUTH_KEY,
                           :security_code  => SECURITY_CODE,
                           :account_number => ACCOUNT_NUMBER,
                           :meter_number   => METER_NUMBER,
                           :wsdl_path      => WSDL_PATH,
                           :smart_post_hub => SMART_POST_HUB,
                           :use_smart_post => USE_SMART_POST)

Passing :debug => true will output XML passed to FedEx, and FedEx's response.

Supplied variables

When setting :use_smart_post to true, you will generate a SmartPost returns label with the supplied :smart_post_hub id.
If set to false, it will default to a normal returns label.

You can set the default for your normal label, by specifying:
McFedex::ServiceTypes::FEDEX_GROUND as the service type.

Generating the label

driver.label(
      :shipper      => {:contact => SHIPPER, :address => SHIPPER_ORIGIN},
      :recipient    => {:contact => RECIPIENT, :address => RECIPIENT_ADDRESS},
      :count        => PACKAGE_COUNT,
      :weight       => PACKAGE_WEIGHT,
      :service_type => SERVICE_TYPE
)

This method will return 3 values:
  * Price
  * Label
  * Tracking Number

Contributing to mc-fedex

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Edwin & Adam. See LICENSE.txt for further details.