Class: ActiveMerchant::Fulfillment::WebgistixService
- Defined in:
- lib/active_fulfillment/fulfillment/services/webgistix.rb
Constant Summary collapse
- TEST_URL =
'https://www.webgistix.com/XML/shippingTest.asp'
- LIVE_URL =
'https://www.webgistix.com/XML/API.asp'
- SUCCESS_MESSAGE =
'Successfully submitted the order'
- FAILURE_MESSAGE =
'Failed to submit the order'
- INVALID_LOGIN =
'Access Denied'
Class Method Summary collapse
-
.shipping_methods ⇒ Object
The first is the label, and the last is the code.
Instance Method Summary collapse
- #fulfill(order_id, shipping_address, line_items, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ WebgistixService
constructor
Pass in the login and password for the shipwire account.
- #test_mode? ⇒ Boolean
- #valid_credentials? ⇒ Boolean
Methods inherited from Service
Methods included from PostsData
Methods included from RequiresParameters
Constructor Details
#initialize(options = {}) ⇒ WebgistixService
Pass in the login and password for the shipwire account. Optionally pass in the :test => true to force test mode
50 51 52 53 54 |
# File 'lib/active_fulfillment/fulfillment/services/webgistix.rb', line 50 def initialize( = {}) requires!(, :login, :password) super @url = test? ? TEST_URL : LIVE_URL end |
Class Method Details
.shipping_methods ⇒ Object
The first is the label, and the last is the code
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/active_fulfillment/fulfillment/services/webgistix.rb', line 13 def self.shipping_methods [ ["UPS Ground Shipping", "Ground"], ["UPS Standard Shipping (Canada Only)", "Standard"], ["UPS 3-Business Day", "3-Day Select"], ["UPS 2-Business Day", "2nd Day Air"], ["UPS 2-Business Day AM", "2nd Day Air AM"], ["UPS Next Day", "Next Day Air"], ["UPS Next Day Saver", "Next Day Air Saver"], ["UPS Next Day Early AM", "Next Day Air Early AM"], ["UPS Worldwide Express (Next Day)", "Worldwide Express"], ["UPS Worldwide Expedited (2nd Day)", "Worldwide Expedited"], ["UPS Worldwide Express Saver", "Worldwide Express Saver"], ["FedEx Priority Overnight", "FedEx Priority Overnight"], ["FedEx Standard Overnight", "FedEx Standard Overnight"], ["FedEx First Overnight", "FedEx First Overnight"], ["FedEx 2nd Day", "FedEx 2nd Day"], ["FedEx Express Saver", "FedEx Express Saver"], ["FedEx International Priority", "FedEx International Priority"], ["FedEx International Economy", "FedEx International Economy"], ["FedEx International First", "FedEx International First"], ["FedEx Ground", "FedEx Ground"], ["USPS Priority Mail & Global Priority Mail", "Priority"], ["USPS Priority Mail & Global Priority Mail (flat rate)", "Flat Rate Priority"], ["USPS First Class Mail", "First Class"], ["USPS Express Mail & Global Express Mail", "Express"], ["USPS Flat Rate Global Express Mail", "Global Express Mail Flat Rate"], ["USPS Parcel Post", "Parcel"], ["USPS First Class International", "First Class International"], ["USPS Media Mail", "Media Mail"], ["USPS Economy Parcel Post", "Economy Parcel"], ["USPS Economy Air Letter Post", "Economy Letter"], ].inject(ActiveSupport::OrderedHash.new){|h, (k,v)| h[k] = v; h} end |
Instance Method Details
#fulfill(order_id, shipping_address, line_items, options = {}) ⇒ Object
56 57 58 59 |
# File 'lib/active_fulfillment/fulfillment/services/webgistix.rb', line 56 def fulfill(order_id, shipping_address, line_items, = {}) requires!(, :shipping_method) commit build_fulfillment_request(order_id, shipping_address, line_items, ) end |
#test_mode? ⇒ Boolean
66 67 68 |
# File 'lib/active_fulfillment/fulfillment/services/webgistix.rb', line 66 def test_mode? true end |
#valid_credentials? ⇒ Boolean
61 62 63 64 |
# File 'lib/active_fulfillment/fulfillment/services/webgistix.rb', line 61 def valid_credentials? response = fulfill('', {}, [], :shipping_method => '') response. != INVALID_LOGIN end |