Method: Fedex::Request::Base#initialize

Defined in:
lib/fedex/request/base.rb

#initialize(credentials, options = {}) ⇒ Base

In order to use Fedex rates API you must first apply for a developer(and later production keys), Visit / Fedex Developer Center for more information about how to obtain your keys. return a Fedex::Request::Base object

Parameters:

  • key (String)
    • Fedex web service key

  • password (String)
    • Fedex password

  • account_number (String)
    • Fedex account_number

  • meter (String)
    • Fedex meter number

  • mode (String)
    • development/production


44
45
46
47
48
49
50
# File 'lib/fedex/request/base.rb', line 44

def initialize(credentials, options={})
  requires!(options, :shipper, :recipient, :packages, :service_type)
  @credentials = credentials
  @shipper, @recipient, @packages, @service_type, @customs_clearance, @debug = options[:shipper], options[:recipient], options[:packages], options[:service_type], options[:customs_clearance], options[:debug]
  @debug = ENV['DEBUG'] == 'true'
  @shipping_options =  options[:shipping_options] ||={}
end