active_fulfillment 3.2.4 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c116080121697527325b266bda808c6acea1be1e
4
- data.tar.gz: d49f7f6df9eeaaa9fad7d40a2cd2080f981be35f
3
+ metadata.gz: a0f9b8104563234cb4c072ac8af4359437c39228
4
+ data.tar.gz: a2066097da1cac659bf2b8d1be352448ac08ebbb
5
5
  SHA512:
6
- metadata.gz: 3fbcca254fb6aca6b40371c6ab89a3bc9f07873bcfa61df02c64cc433c3243489f365e6d8a33842576557de1bf8dddfbb573f06268f662751065ff011294801a
7
- data.tar.gz: 3f71ad76b4776338811db3787c7e14f8864534662eb9bb2452f8d380fa427a8ad44eb2248328653f75a9acbd010c087b49fe97d19d4ac068c19103fb121d64f4
6
+ metadata.gz: 3fe27cd0a146e3eb3595851d9d7b7dc22c473a8ae4609a6b2292f1d17e66fdc459f07f298a16d474ed1266ba825d1d51cf4f2d914368bedfad83d57219c64cd1
7
+ data.tar.gz: e4c6103a6053887a91294de1c8e3269b09a5a2983bc544d0985fb8969c04d02c70648f6f87e8b05bb8431e430467c0860780ab67c0891a77331d64f7daf408a5
@@ -18,15 +18,37 @@ module ActiveFulfillment
18
18
  XML_FAILURE_RESPONSE = { :success => FAILURE }.freeze
19
19
 
20
20
  ENDPOINTS = {
21
- :ca => 'mws.amazonservices.ca',
21
+ :au => 'mws.amazonservices.com.au',
22
+ :br => 'mws.amazonservices.com',
23
+ :ca => 'mws.amazonservices.com',
22
24
  :cn => 'mws.amazonservices.com.cn',
23
- :de => 'mws-eu.amazonservices.ca',
24
- :es => 'mws-eu.amazonservices.ca',
25
- :fr => 'mws-eu.amazonservices.ca',
26
- :it => 'mws-eu.amazonservices.ca',
25
+ :de => 'mws-eu.amazonservices.com',
26
+ :es => 'mws-eu.amazonservices.com',
27
+ :fr => 'mws-eu.amazonservices.com',
28
+ :gb => 'mws-eu.amazonservices.com',
29
+ :in => 'mws.amazonservices.in',
30
+ :it => 'mws-eu.amazonservices.com',
27
31
  :jp => 'mws.amazonservices.jp',
28
- :uk => 'mws-eu.amazonservices.ca',
29
- :us => 'mws.amazonservices.com'
32
+ :mx => 'mws.amazonservices.com',
33
+ :uk => 'mws-eu.amazonservices.com',
34
+ :us => 'mws.amazonservices.com',
35
+ }.freeze
36
+
37
+ MARKETPLACE_IDS = {
38
+ :au => 'A39IBJ37TRP1C6',
39
+ :br => 'A2Q3Y263D00KWC',
40
+ :ca => 'A2EUQ1WTGCTBG2',
41
+ :cn => 'AAHKV2X7AFYLW',
42
+ :de => 'A1PA6795UKMFR9',
43
+ :es => 'A1RKKUPIHCS9HS',
44
+ :fr => 'A13V1IB3VIYZZH',
45
+ :gb => 'A1F83G8C2ARO7P',
46
+ :in => 'A21TJRUUN4KGV',
47
+ :it => 'APJ6JRA9NG5V4',
48
+ :jp => 'A1VC38T7YXB528',
49
+ :mx => 'A1AM78C64UM0Y8',
50
+ :uk => 'A1F83G8C2ARO7P',
51
+ :us => 'ATVPDKIKX0DER',
30
52
  }.freeze
31
53
 
32
54
  LOOKUPS = {
@@ -86,6 +108,10 @@ module ActiveFulfillment
86
108
  ENDPOINTS[@options[:endpoint] || :us]
87
109
  end
88
110
 
111
+ def marketplace_id
112
+ MARKETPLACE_IDS[@options[:endpoint] || :us]
113
+ end
114
+
89
115
  def fulfill(order_id, shipping_address, line_items, options = {})
90
116
  requires!(options, :order_date, :shipping_method)
91
117
  with_error_handling do
@@ -339,7 +365,8 @@ module ActiveFulfillment
339
365
  :SellerFulfillmentOrderId => order_id.to_s,
340
366
  :DisplayableOrderId => order_id.to_s,
341
367
  :DisplayableOrderDateTime => options[:order_date].utc.iso8601,
342
- :ShippingSpeedCategory => options[:shipping_method]
368
+ :ShippingSpeedCategory => options[:shipping_method],
369
+ :MarketplaceId => marketplace_id,
343
370
  }
344
371
  params[:DisplayableOrderComment] = options[:comment] if options[:comment]
345
372
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module ActiveFulfillment
3
- VERSION = "3.2.4"
3
+ VERSION = "3.2.5"
4
4
  end
@@ -78,6 +78,11 @@ class AmazonMarketplaceWebServiceTest < Minitest::Test
78
78
  assert_equal ActiveFulfillment::AmazonMarketplaceWebService::ENDPOINTS[:jp], service.endpoint
79
79
  end
80
80
 
81
+ def test_endpoint_and_marketplace_ids_have_the_same_keys
82
+ assert_equal ActiveFulfillment::AmazonMarketplaceWebService::ENDPOINTS.keys,
83
+ ActiveFulfillment::AmazonMarketplaceWebService::MARKETPLACE_IDS.keys
84
+ end
85
+
81
86
  def test_build_basic_api_query
82
87
  options = {
83
88
  "Action" => "SubmitFeed",
@@ -247,6 +252,7 @@ class AmazonMarketplaceWebServiceTest < Minitest::Test
247
252
  def test_successful_fulfillment
248
253
  @service.expects(:ssl_post).with do |uri, query, headers|
249
254
  assert_equal 'https://mws.amazonservices.com/FulfillmentOutboundShipment/2010-10-01', uri
255
+ assert_equal 'ATVPDKIKX0DER', CGI.parse(query)['MarketplaceId'].first
250
256
  end.returns(successful_fulfillment_response)
251
257
  response = @service.fulfill('12345678', @address, @line_items, @options)
252
258
  assert response.success?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fulfillment
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.4
4
+ version: 3.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Fauser
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-23 00:00:00.000000000 Z
12
+ date: 2018-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -199,14 +199,14 @@ specification_version: 4
199
199
  summary: Framework and tools for dealing with shipping, tracking and order fulfillment
200
200
  services.
201
201
  test_files:
202
- - test/test_helper.rb
203
- - test/remote/amazon_mws_test.rb
204
- - test/remote/james_and_james_test.rb
205
- - test/remote/shipwire_test.rb
206
- - test/remote/webgistix_test.rb
202
+ - test/unit/base_test.rb
207
203
  - test/unit/services/amazon_mws_test.rb
208
- - test/unit/services/james_and_james_test.rb
204
+ - test/unit/services/webgistix_test.rb
209
205
  - test/unit/services/shopify_api_test.rb
210
206
  - test/unit/services/shipwire_test.rb
211
- - test/unit/services/webgistix_test.rb
212
- - test/unit/base_test.rb
207
+ - test/unit/services/james_and_james_test.rb
208
+ - test/test_helper.rb
209
+ - test/remote/amazon_mws_test.rb
210
+ - test/remote/webgistix_test.rb
211
+ - test/remote/shipwire_test.rb
212
+ - test/remote/james_and_james_test.rb