class SimpleShipping::Fedex::Client
Required credentials:
-
key
-
password
-
account_number
-
meter_number
Usage¶ ↑
client = SimpleShipping::Fedex::Client.new(:key => "KEY", :password => "PASSWORD", :account_number => "ACCOUNT NUMBER", :METER_NUMBER => "METER NUMBER") client.request(shipper, recipient, package) # => #<SimpleShipping::Fedex::Response ...>
Public Instance Methods
ship_confirm_request(shipper, recipient, package, opts = {})
click to toggle source
Send the shipment confirmation request.
# File lib/simple_shipping/fedex/client.rb, line 29 def ship_confirm_request(shipper, recipient, package, opts = {}) fail "Not Implemented" end
shipment_request(shipper, recipient, package, opts = {})
click to toggle source
Send the shipment request to FedEx.
# File lib/simple_shipping/fedex/client.rb, line 22 def shipment_request(shipper, recipient, package, opts = {}) shipment = create_shipment(shipper, recipient, package, opts) request = ShipmentRequest.new(@credentials, shipment) execute(request) end
Private Instance Methods
execute(request)
click to toggle source
Send the ProcessShipmentRequest request to the FedEx service and return the response wrapped in a {Fedex::Response} object.
# File lib/simple_shipping/fedex/client.rb, line 35 def execute(request) savon_response = @client.call(request.type, :message => request.body) request.response(savon_response) end