Class: SimpleShipping::Ups::ShipClient

Inherits:
Client show all
Defined in:
lib/simple_shipping/ups/ship_client.rb

Overview

Required credentials:

  • username

  • password

  • access_license_number

Usage

client = SimpleShipping::Ups::ShipClient.new(:username              => "USER NAME",
                                           :password              => "PASSWORD",
                                           :access_license_number => "LICENSE NUMBER")
client.request(shipper, recipient, package) # => #<SimpleShipping::Ups::Response ...>

Instance Method Summary collapse

Methods inherited from Abstract::Client

#initialize, set_production_address, set_required_credentials, set_testing_address, set_wsdl_document

Constructor Details

This class inherits a constructor from SimpleShipping::Abstract::Client

Instance Method Details

#ship_accept_request(shipment_digest, options = {}) ⇒ Object

Perform shipping accept request.



42
43
44
45
# File 'lib/simple_shipping/ups/ship_client.rb', line 42

def ship_accept_request(shipment_digest, options = {})
  request  = ShipAcceptRequest.new(@credentials, shipment_digest, options)
  execute(request)
end

#ship_confirm_request(shipper, recipient, package, options = {}) ⇒ Object

Send shipment confirmation request.



34
35
36
37
38
# File 'lib/simple_shipping/ups/ship_client.rb', line 34

def ship_confirm_request(shipper, recipient, package, options = {})
  shipment = create_shipment(shipper, recipient, package, options)
  request  = ShipConfirmRequest.new(@credentials, shipment, options)
  execute(request)
end

#shipment_request(shipper, recipient, package, options = {}) ⇒ ::SimpleShipping::ShipmentResponse

Parameters:

Returns:

  • (::SimpleShipping::ShipmentResponse)

Raises:



27
28
29
30
31
# File 'lib/simple_shipping/ups/ship_client.rb', line 27

def shipment_request(shipper, recipient, package, options = {})
  shipment = create_shipment(shipper, recipient, package, options)
  request  = ShipmentRequest.new(@credentials, shipment, options)
  execute(request)
end