Class: Fedex::Request::Base
- Inherits:
-
Object
- Object
- Fedex::Request::Base
- Includes:
- Helpers, HTTParty
- Defined in:
- lib/fedex/request/base.rb
Direct Known Subclasses
Constant Summary collapse
- TEST_URL =
Fedex Text URL
"https://gatewaybeta.fedex.com:443/xml/"
- PRODUCTION_URL =
Fedex Production URL
"https://gateway.fedex.com:443/xml/"
- SERVICE_TYPES =
List of available Service Types
%w(EUROPE_FIRST_INTERNATIONAL_PRIORITY FEDEX_1_DAY_FREIGHT FEDEX_2_DAY FEDEX_2_DAY_AM FEDEX_2_DAY_FREIGHT FEDEX_3_DAY_FREIGHT FEDEX_EXPRESS_SAVER FEDEX_FIRST_FREIGHT FEDEX_FREIGHT_ECONOMY FEDEX_FREIGHT_PRIORITY FEDEX_GROUND FIRST_OVERNIGHT GROUND_HOME_DELIVERY INTERNATIONAL_ECONOMY INTERNATIONAL_ECONOMY_FREIGHT INTERNATIONAL_FIRST INTERNATIONAL_PRIORITY INTERNATIONAL_PRIORITY_FREIGHT PRIORITY_OVERNIGHT SMART_POST STANDARD_OVERNIGHT)
- PACKAGING_TYPES =
List of available Packaging Type
%w(FEDEX_10KG_BOX FEDEX_25KG_BOX FEDEX_BOX FEDEX_ENVELOPE FEDEX_PAK FEDEX_TUBE YOUR_PACKAGING)
- DROP_OFF_TYPES =
List of available DropOffTypes
%w(BUSINESS_SERVICE_CENTER DROP_BOX REGULAR_PICKUP REQUEST_COURIER STATION)
- CLEARANCE_BROKERAGE_TYPE =
Clearance Brokerage Type
%w(BROKER_INCLUSIVE BROKER_INCLUSIVE_NON_RESIDENT_IMPORTER BROKER_SELECT BROKER_SELECT_NON_RESIDENT_IMPORTER BROKER_UNASSIGNED)
- RECIPIENT_CUSTOM_ID_TYPE =
Recipient Custom ID Type
%w(COMPANY INDIVIDUAL PASSPORT)
Instance Attribute Summary collapse
-
#debug ⇒ Object
If true the rate method will return the complete response from the Fedex Web Service.
Instance Method Summary collapse
-
#initialize(credentials, options = {}) ⇒ Base
constructor
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.
-
#process_request ⇒ Object
Sends post request to Fedex web service and parse the response.
Constructor Details
#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
44 45 46 47 48 49 50 |
# File 'lib/fedex/request/base.rb', line 44 def initialize(credentials, ={}) requires!(, :shipper, :recipient, :packages, :service_type) @credentials = credentials @shipper, @recipient, @packages, @service_type, @customs_clearance, @debug = [:shipper], [:recipient], [:packages], [:service_type], [:customs_clearance], [:debug] @debug = ENV['DEBUG'] == 'true' @shipping_options = [:shipping_options] ||={} end |
Instance Attribute Details
#debug ⇒ Object
If true the rate method will return the complete response from the Fedex Web Service
13 14 15 |
# File 'lib/fedex/request/base.rb', line 13 def debug @debug end |
Instance Method Details
#process_request ⇒ Object
Sends post request to Fedex web service and parse the response. Implemented by each subclass
54 55 56 |
# File 'lib/fedex/request/base.rb', line 54 def process_request raise NotImplementedError, "Override process_request in subclass" end |