peddler 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06cb553e078d4d6f9aafd060c115c8046121b3fd
4
- data.tar.gz: c50d0504401be833d849b920dc6719fae8450d90
3
+ metadata.gz: 508010a025e8f0b31b8523fc198fe05700abd63d
4
+ data.tar.gz: 50227687d80748d2422dee41098cd9df3782453d
5
5
  SHA512:
6
- metadata.gz: eb936ff1e15a326d977b698ad5c9f702971fb7ccc65b273773f0fa4f55d8fee5fb92a8cc304e79fc99f6b36a2b07c01376500e32c9aebbc0d51c13a25cf0a25e
7
- data.tar.gz: 16949287e0ba9cd9ecdadcb8564d2ea508e9c85fc002b1967993912d0fe450f7616a98cfb90def32e98544eb4946d43a1ad0c30957025b8dd2fe3f898b85920e
6
+ metadata.gz: 496e5f45b131896ebcaad5103a1e9b8aeb646d3ab15b40a51934c646e0de4a1e2501dd6470e4a77f77da2b769a624013e93317b8fe0978a2e8e7d3a0f12d9f5f
7
+ data.tar.gz: 0481a58827cda1756c543a5ed870eb7ec72c0ae5f361cf4a9c2aa901bbd71ac15c646da0f0b2dc8f0d6b06d3f0bac7db513389f07d449aa3bcbd13074899f9e0
data/README.md CHANGED
@@ -1,30 +1,35 @@
1
1
 
2
2
  # Peddler
3
3
 
4
- [![Build Status][1]][2]
4
+ [![Travis](https://travis-ci.org/hakanensari/peddler.svg)](https://travis-ci.org/hakanensari/peddler)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/hakanensari/peddler.svg)](https://codeclimate.com/github/hakanensari/peddler)
5
6
 
6
- **Peddler** is a Ruby interface to the [Amazon MWS API][3], a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.
7
+ **Peddler** is a Ruby interface to the [Amazon MWS API](https://developer.amazonservices.com/), a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.
7
8
 
8
9
  To use Amazon MWS, you must have an eligible seller account.
9
10
 
10
- ![Peddler][4]
11
+ ![Peddler](http://f.cl.ly/items/231z2m0r1Q2o2q1n0w1N/peddler.jpg)
11
12
 
12
13
  ## Configuration
13
14
 
14
- Require the entire library or a particular API section.
15
+ Require the library and instantiate a client.
15
16
 
16
17
  ```ruby
17
18
  require 'peddler'
18
- # require 'mws/orders'
19
+ client = MWS.orders
19
20
  ```
20
21
 
21
- Instantiate a client.
22
+ You can set up credentials when instantiating:
22
23
 
23
24
  ```ruby
24
- client = MWS::Orders.new
25
- ```
25
+ client = MWS.orders(
26
+ marketplace_id: 'A1F83G8C2ARO7P',
27
+ merchant_id: 'A2A9WNXCU02UZW',
28
+ aws_access_key_id: 'AKIVICHZMZ2JRSSLC27W',
29
+ aws_secret_access_key: 'rOMa3ydPBTJ3AD0bxERTOX0Fv0fAC6Q0s6/czMZO'
30
+ )
26
31
 
27
- Set the credentials.
32
+ Or you can set them via `Client#configure`.
28
33
 
29
34
  ```ruby
30
35
  client.configure do |c|
@@ -35,7 +40,7 @@ client.configure do |c|
35
40
  end
36
41
  ```
37
42
 
38
- If you have only a single set of credentials, you may prefer to use environment variables.
43
+ Or you may use environment variables if you have only a single set of credentials:
39
44
 
40
45
  ```sh
41
46
  export MWS_MARKETPLACE_ID="A1F83G8C2ARO7P"
@@ -80,10 +85,12 @@ The MWS Fulfillment Inventory API can help you stay up-to-date on the availabili
80
85
 
81
86
  ### Fulfillment Outbound Shipment
82
87
 
83
- **Not implemented**
88
+ **Partially implemented**
84
89
 
85
90
  The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed through channels other than Amazon's retail web site, using your inventory in the Amazon Fulfillment Network. You can request previews of potential fulfillment orders that return estimated shipping fees and shipping dates based on shipping speed. You can get detailed item-level, shipment-level, and order-level information for any existing fulfillment order that you specify. You can also request lists of existing fulfillment orders based on when they were fulfilled and by the fulfillment method associated with them.
86
91
 
92
+ Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
93
+
87
94
  [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentOutboundShipment)
88
95
 
89
96
  ### Off Amazon Payments
@@ -127,8 +134,3 @@ The Sellers API lets sellers retrieve information about their seller account, su
127
134
  The Amazon MWS Subscriptions API section enables you to subscribe to receive notifications that are relevant to your business with Amazon. With the operations in the Subscriptions API section, you can register to receive important information from Amazon without having to poll the Amazon MWS service. Instead, the information is sent directly to you when an event occurs to which you are subscribed.
128
135
 
129
136
  [Read more](http://rubydoc.info/github/hakanensari/peddler/MWS/Subscriptions)
130
-
131
- [1]: https://travis-ci.org/hakanensari/peddler.png
132
- [2]:https://travis-ci.org/hakanensari/peddler
133
- [3]: https://developer.amazonservices.com/
134
- [4]: http://f.cl.ly/items/231z2m0r1Q2o2q1n0w1N/peddler.jpg
@@ -1,4 +1,5 @@
1
1
  require 'peddler/client'
2
+ require 'excon'
2
3
 
3
4
  module MWS
4
5
  # The Fulfillment Outbound Shipment API enables you to fulfill orders placed
@@ -21,8 +22,45 @@ module MWS
21
22
 
22
23
  # Requests that Amazon ship items from the seller's Amazon Fulfillment
23
24
  # Network inventory to a destination address
24
- def create_fulfillment_order
25
- raise NotImplementedError
25
+ #
26
+ # @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_CreateFulfillmentOrder.html
27
+ # @param seller_fulfillment_order_id [String]
28
+ # @param displayable_order_id [String]
29
+ # @param displayable_order_date_time [String, #iso8601]
30
+ # @param displayable_order_comment [String]
31
+ # @param shipping_speed_category [String]
32
+ # @param destination_address [Struct, Hash]
33
+ # @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_Datatypes.html#Address
34
+ # @params items [Array<Struct, Hash>]
35
+ # @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_Datatypes.html#CreateFulfillmentOrderItem
36
+ # @param opts [Hash]
37
+ # @option opts [String] :fulfillment_action
38
+ # @option opts [String] :fulfillment_policy
39
+ # @option opts [Array<String>] :notification_email_list
40
+ # @option opts [Struct, Hash] :cod_settings
41
+ # @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_Datatypes.html#CODSettings
42
+ # @return [Peddler::XMLParser]
43
+ def create_fulfillment_order(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time, displayable_order_comment, shipping_speed_category, destination_address, items, opts = {})
44
+ if opts.has_key?(:cod_settings)
45
+ opts['CODSettings'] = opts.delete(:cod_settings)
46
+ end
47
+
48
+ operation('CreateFulfillmentOrder')
49
+ .add(opts
50
+ .merge(
51
+ 'SellerFulfillmentOrderId' => seller_fulfillment_order_id,
52
+ 'DisplayableOrderId' => displayable_order_id,
53
+ 'DisplayableOrderDateTime' => displayable_order_date_time,
54
+ 'DisplayableOrderComment' => displayable_order_comment,
55
+ 'ShippingSpeedCategory' => shipping_speed_category,
56
+ 'DestinationAddress' => destination_address,
57
+ 'Items' => items
58
+ )
59
+ )
60
+ .structure!('Items', 'member')
61
+ .structure!('NotificationEmailList', 'member')
62
+
63
+ run
26
64
  end
27
65
 
28
66
  # Updates and/or requests shipment for a fulfillment order with an order
@@ -54,8 +92,15 @@ module MWS
54
92
 
55
93
  # Requests that Amazon stop attempting to fulfill an existing fulfillment
56
94
  # order
57
- def cancel_fulfillment_order
58
- raise NotImplementedError
95
+ #
96
+ # @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_CancelFulfillmentOrder.html
97
+ # @param seller_fulfillment_order_id [String]
98
+ # @return [Peddler::XMLParser]
99
+ def cancel_fulfillment_order(seller_fulfillment_order_id)
100
+ operation('CancelFulfillmentOrder')
101
+ .add('SellerFulfillmentOrderId' => seller_fulfillment_order_id)
102
+
103
+ run
59
104
  end
60
105
 
61
106
  # Gets the operational status of the API
data/lib/mws/products.rb CHANGED
@@ -18,8 +18,6 @@ module MWS
18
18
  # @option opts [String] :query_context_id
19
19
  # @return [Peddler::XMLParser]
20
20
  def list_matching_products(query, opts = {})
21
- opts[:marketplace_id] ||= marketplace_id
22
-
23
21
  operation('ListMatchingProducts')
24
22
  .add(opts.merge('Query' => query))
25
23
 
@@ -38,7 +36,6 @@ module MWS
38
36
  # @return [Peddler::XMLParser]
39
37
  def get_matching_product_for_id(id_type, *id_list)
40
38
  opts = extract_options(id_list)
41
- opts[:marketplace_id] ||= marketplace_id
42
39
 
43
40
  operation('GetMatchingProductForId')
44
41
  .add(opts.merge('IdType' => id_type, 'IdList' => id_list))
@@ -57,7 +54,6 @@ module MWS
57
54
  # @return [Peddler::XMLParser]
58
55
  def get_matching_product(*asins)
59
56
  opts = extract_options(asins)
60
- opts[:marketplace_id] ||= marketplace_id
61
57
 
62
58
  operation('GetMatchingProduct')
63
59
  .add(opts.merge('ASINList' => asins))
@@ -76,7 +72,6 @@ module MWS
76
72
  # @return [Peddler::XMLParser]
77
73
  def get_competitive_pricing_for_sku(*skus)
78
74
  opts = extract_options(skus)
79
- opts[:marketplace_id] ||= marketplace_id
80
75
 
81
76
  operation('GetCompetitivePricingForSKU')
82
77
  .add(opts.merge('SellerSKUList' => skus))
@@ -95,7 +90,6 @@ module MWS
95
90
  # @return [Peddler::XMLParser]
96
91
  def get_competitive_pricing_for_asin(*asins)
97
92
  opts = extract_options(asins)
98
- opts[:marketplace_id] ||= marketplace_id
99
93
 
100
94
  operation('GetCompetitivePricingForASIN')
101
95
  .add(opts.merge('ASINList' => asins))
@@ -117,7 +111,6 @@ module MWS
117
111
  # @return [Peddler::XMLParser]
118
112
  def get_lowest_offer_listings_for_sku(*skus)
119
113
  opts = extract_options(skus)
120
- opts[:marketplace_id] ||= marketplace_id
121
114
 
122
115
  operation('GetLowestOfferListingsForSKU')
123
116
  .add(opts.merge('SellerSKUList' => skus))
@@ -139,7 +132,6 @@ module MWS
139
132
  # @return [Peddler::XMLParser]
140
133
  def get_lowest_offer_listings_for_asin(*asins)
141
134
  opts = extract_options(asins)
142
- opts[:marketplace_id] ||= marketplace_id
143
135
 
144
136
  operation('GetLowestOfferListingsForASIN')
145
137
  .add(opts.merge('ASINList' => asins))
@@ -160,7 +152,6 @@ module MWS
160
152
  # @return [Peddler::XMLParser]
161
153
  def get_my_price_for_sku(*skus)
162
154
  opts = extract_options(skus)
163
- opts[:marketplace_id] ||= marketplace_id
164
155
 
165
156
  operation('GetMyPriceForSKU')
166
157
  .add(opts.merge('SellerSKUList' => skus))
@@ -181,7 +172,6 @@ module MWS
181
172
  # @return [Peddler::XMLParser]
182
173
  def get_my_price_for_asin(*asins)
183
174
  opts = extract_options(asins)
184
- opts[:marketplace_id] ||= marketplace_id
185
175
 
186
176
  operation('GetMyPriceForASIN')
187
177
  .add(opts.merge('ASINList' => asins))
@@ -200,8 +190,6 @@ module MWS
200
190
  # @option opts [String] :marketplace_id
201
191
  # @return [Peddler::XMLParser]
202
192
  def get_product_categories_for_sku(sku, opts = {})
203
- opts[:marketplace_id] ||= marketplace_id
204
-
205
193
  operation('GetProductCategoriesForSKU')
206
194
  .add(opts.merge('SellerSKU' => sku))
207
195
 
@@ -217,8 +205,6 @@ module MWS
217
205
  # @option opts [String] :marketplace_id
218
206
  # @return [Peddler::XMLParser]
219
207
  def get_product_categories_for_asin(asin, opts = {})
220
- opts[:marketplace_id] ||= marketplace_id
221
-
222
208
  operation('GetProductCategoriesForASIN')
223
209
  .add(opts.merge('ASIN' => asin))
224
210
 
@@ -233,5 +219,14 @@ module MWS
233
219
  operation('GetServiceStatus')
234
220
  run
235
221
  end
222
+
223
+ # @api private
224
+ def operation(*)
225
+ super.tap do |opts|
226
+ unless opts.has_key?('MarketplaceId')
227
+ opts.store('MarketplaceId', marketplace_id)
228
+ end
229
+ end
230
+ end
236
231
  end
237
232
  end
data/lib/mws.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'forwardable'
2
+ require 'mws/cart_information'
3
+ require 'mws/customer_information'
4
+ require 'mws/feeds'
5
+ require 'mws/fulfillment_inbound_shipment'
6
+ require 'mws/fulfillment_inventory'
7
+ require 'mws/fulfillment_outbound_shipment'
8
+ require 'mws/off_amazon_payments'
9
+ require 'mws/orders'
10
+ require 'mws/products'
11
+ require 'mws/recommendations'
12
+ require 'mws/reports'
13
+ require 'mws/sellers'
14
+ require 'mws/subscriptions'
15
+
16
+ module MWS
17
+ class << self
18
+ extend Forwardable
19
+
20
+ MWS.constants.each do |klass|
21
+ method_name = klass.to_s.gsub(/(.)([A-Z])/,'\1_\2').downcase
22
+ def_delegator klass, :new, method_name
23
+ end
24
+ end
25
+ end
@@ -37,6 +37,10 @@ module Peddler
37
37
  base.params(params)
38
38
  end
39
39
 
40
+ def initialize(opts = {})
41
+ opts.each { |k, v| self.send("#{k}=", v) }
42
+ end
43
+
40
44
  def aws_endpoint
41
45
  "https://#{host}#{self.class.path}"
42
46
  end
@@ -14,10 +14,11 @@ module Peddler
14
14
  content_type = res.headers['Content-Type']
15
15
  if content_type.start_with?('text/xml')
16
16
  XMLParser.new(res)
17
- elsif content_type == 'application/octet-stream'
18
- FlatFileParser.new(res, encoding)
19
17
  else
20
- raise NotImplementedError
18
+ # Amazon returns a variety of content types for flat files, so we
19
+ # simply assume that anything not XML is a flat file rather than code
20
+ # defensively and check content type again.
21
+ FlatFileParser.new(res, encoding)
21
22
  end
22
23
  end
23
24
  end
@@ -1,3 +1,3 @@
1
1
  module Peddler
2
- VERSION = '0.7.7'
2
+ VERSION = '0.7.8'
3
3
  end
@@ -23,7 +23,8 @@ module Peddler
23
23
  private
24
24
 
25
25
  def find_result
26
- xml.values[0].find { |k, v| k.include?('Result') }.last
26
+ results = xml.values[0].find { |k, v| k.include?('Result') }
27
+ results ? results.last : nil
27
28
  end
28
29
  end
29
30
  end
data/lib/peddler.rb CHANGED
@@ -1,13 +1 @@
1
- require 'mws/cart_information'
2
- require 'mws/customer_information'
3
- require 'mws/feeds'
4
- require 'mws/fulfillment_inbound_shipment'
5
- require 'mws/fulfillment_inventory'
6
- require 'mws/fulfillment_outbound_shipment'
7
- require 'mws/off_amazon_payments'
8
- require 'mws/orders'
9
- require 'mws/products'
10
- require 'mws/recommendations'
11
- require 'mws/reports'
12
- require 'mws/sellers'
13
- require 'mws/subscriptions'
1
+ require 'mws'
@@ -1,11 +1,58 @@
1
1
  require 'integration_helper'
2
2
  require 'mws/fulfillment_outbound_shipment'
3
+ require 'excon/errors'
3
4
 
4
5
  class FulfillmentOutboundShipmentTest < IntegrationTest
6
+ TEST_VER = 4
7
+
5
8
  def test_gets_service_status
6
9
  clients.each do |client|
7
10
  res = client.get_service_status
8
11
  refute_empty res.parse
9
12
  end
10
13
  end
14
+
15
+ def test_create_fulfillment_order
16
+ begin
17
+ clients.each do |client|
18
+ seller_fulfillment_order_id = "frobnitz-#{TEST_VER}"
19
+ displayable_order_id = "Schnizzlebits-#{TEST_VER}"
20
+ displayable_order_date_time = "2014-04-15T08:18:44+00:00"
21
+ displayable_order_comment = "Thanks for your fantastic order"
22
+ shipping_speed_category = "Standard"
23
+
24
+ address = {
25
+ :name => "Snoop Dog",
26
+ :line1 => "4339 H Dr.",
27
+ :city => "Oakland",
28
+ :state_or_province_code => "CA",
29
+ :country_code => "US",
30
+ :postal_code => "94618"
31
+ }
32
+
33
+ item = {
34
+ 'SellerSKU' => 'PI-ANX1-KMPO',
35
+ :seller_fulfillment_order_item_id => "orderfrobnitz-#{TEST_VER}",
36
+ :quantity => 1
37
+ }
38
+
39
+ res = client.create_fulfillment_order(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time,
40
+ displayable_order_comment, shipping_speed_category, address, [item])
41
+
42
+ # Note: sometimes this test fails because you can't cancel an order immediately after
43
+ # creating it. MWS will return an internal server error like "SIRM call failed"
44
+ # If this happens, comment out the create_fulfillment_order call and try running the test again
45
+ # after a minute or two, and it should pass. Once you have all the VCR cassettes you should be fine
46
+ client.cancel_fulfillment_order(seller_fulfillment_order_id)
47
+ end
48
+
49
+ rescue Excon::Errors::HTTPStatusError => e
50
+ if e.response.body.include?('Seller is not registered')
51
+ skip('Seller not registered')
52
+ else
53
+ warn "Failure (status: #{e.response.status}): #{e.response.body}"
54
+ raise e
55
+ end
56
+ end
57
+ end
11
58
  end
@@ -0,0 +1,9 @@
1
+ require 'helper'
2
+ require 'mws/products'
3
+
4
+ class MWSProductsTest < MiniTest::Test
5
+ def test_operation_includes_marketplace_id
6
+ client = MWS::Products.new
7
+ assert client.operation('Foo').has_key?('MarketplaceId')
8
+ end
9
+ end
@@ -2,7 +2,7 @@ require 'helper'
2
2
  require 'excon'
3
3
  require 'peddler/client'
4
4
 
5
- class ClientTest < MiniTest::Test
5
+ class PeddlerClientTest < MiniTest::Test
6
6
  module Parser
7
7
  def self.parse(res, *); res; end
8
8
  end
@@ -14,7 +14,12 @@ class ClientTest < MiniTest::Test
14
14
 
15
15
  @klass = Class.new(Peddler::Client)
16
16
  @client = @klass.new
17
- @client.marketplace_id = 'A1F83G8C2ARO7P'
17
+
18
+ @client.aws_access_key_id = 'key'
19
+ @client.aws_secret_access_key = 'secret'
20
+ @client.merchant_id = 'seller'
21
+ @client.marketplace_id = 'ATVPDKIKX0DER' # US
22
+
18
23
  @client.operation('Foo')
19
24
  end
20
25
 
@@ -48,6 +53,11 @@ class ClientTest < MiniTest::Test
48
53
  assert_equal '123', @client.aws_access_key_id
49
54
  end
50
55
 
56
+ def test_configures_when_initialising
57
+ client = @klass.new(aws_access_key_id: '123')
58
+ assert_equal '123', client.aws_access_key_id
59
+ end
60
+
51
61
  def test_guards_against_bad_marketplace_id
52
62
  assert_raises(Peddler::Client::BadMarketplaceId) do
53
63
  client = Peddler::Client.new
@@ -1,7 +1,7 @@
1
1
  require 'helper'
2
2
  require 'peddler/flat_file_parser'
3
3
 
4
- class FlatFileParserTest < MiniTest::Test
4
+ class PeddlerFlatFileParserTest < MiniTest::Test
5
5
  def setup
6
6
  body = "Feed Processing Summary:\n\tNumber of records processed\t\t11006\n\tNumber of records successful\t\t11006\n\noriginal-record-number\tsku\terror-code\terror-type\terror-message\n1822\t85da472e-ba6c-11e3-95af-002590a74356\t5000\tWarning\tThe update for Sku '85da472e-ba6c-11e3-95af-002590a74356' was skipped because it is identical to the update in feed '9518995390'.\n"
7
7
  body.encode!('ASCII-8BIT')
@@ -1,7 +1,7 @@
1
1
  require 'helper'
2
2
  require 'peddler/operation'
3
3
 
4
- class OperationTest < MiniTest::Test
4
+ class PeddlerOperationTest < MiniTest::Test
5
5
  def setup
6
6
  @operation = Peddler::Operation.new('Foo')
7
7
  end
@@ -0,0 +1,21 @@
1
+ require 'helper'
2
+ require 'peddler/parser'
3
+
4
+ class PeddlerParserTest < MiniTest::Test
5
+ def assert_parser(klass, *content_types)
6
+ content_types.each do |content_type|
7
+ res = OpenStruct.new(headers: { 'Content-Type' => content_type }, body: '')
8
+ parser = Peddler::Parser.parse(res)
9
+
10
+ assert_kind_of klass, parser
11
+ end
12
+ end
13
+
14
+ def test_parses_xml
15
+ assert_parser Peddler::XMLParser, 'text/xml', 'text/xml; charset=UTF-8'
16
+ end
17
+
18
+ def test_parses_flat_files
19
+ assert_parser Peddler::FlatFileParser, 'text/plain', 'application/octet-stream'
20
+ end
21
+ end
@@ -1,7 +1,7 @@
1
1
  require 'helper'
2
2
  require 'peddler/structured_list'
3
3
 
4
- class StructuredListTest < MiniTest::Test
4
+ class PeddlerStructuredListTest < MiniTest::Test
5
5
  def setup
6
6
  @list = Peddler::StructuredList.new('OrderStatus', 'Status')
7
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'helper'
2
2
  require 'peddler/xml_parser'
3
3
 
4
- class XMLParserTest < MiniTest::Test
4
+ class PeddlerXMLParserTest < MiniTest::Test
5
5
  def setup
6
6
  body = '<Response><Result><NextToken>123</NextToken><Foo>Bar</Foo></Result></Response>'
7
7
  res = OpenStruct.new(body: body, headers: { 'Content-Type' => 'text/xml', 'Content-Length' => '78'})
@@ -0,0 +1,8 @@
1
+ require 'helper'
2
+ require 'mws'
3
+
4
+ class MWSTest < MiniTest::Test
5
+ def test_delegates_to_apis
6
+ assert_equal MWS.methods(false).size, MWS.constants.size
7
+ end
8
+ end
@@ -8961,4 +8961,372 @@ http_interactions:
8961
8961
  </GetServiceStatusResponse>
8962
8962
  http_version:
8963
8963
  recorded_at: Sun, 27 Apr 2014 15:56:31 GMT
8964
+ - request:
8965
+ method: post
8966
+ uri: https://mws-eu.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAI6X4QZRXSHGHABJA&Action=GetServiceStatus&MarketplaceId=A1RKKUPIHCS9HS&SellerId=A2NEU7G6RGUKF&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A30Z&Signature=DJLFgCPvic8v1mYa7nrWgbXFBHNRjpy1Ggr%2FYvo6SPw%3D
8967
+ body:
8968
+ encoding: US-ASCII
8969
+ string: ''
8970
+ headers:
8971
+ User-Agent:
8972
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
8973
+ response:
8974
+ status:
8975
+ code: 200
8976
+ message:
8977
+ headers:
8978
+ Date:
8979
+ - Sun, 27 Apr 2014 20:59:29 GMT
8980
+ Server:
8981
+ - AmazonMWS
8982
+ x-mws-request-id:
8983
+ - d143973b-175f-44f8-98bd-f783bea4c9d8
8984
+ x-mws-timestamp:
8985
+ - '2014-04-27T20:59:30.240Z'
8986
+ x-mws-response-context:
8987
+ - prmVFouL2yp/kkp/+eFBPKfglrSltRZIaE3QUlJ3vCZ0YI4SnnXOTGEQ/qIC//6uvFhBBXa1UkkW
8988
+ SJrv4me4Bg==
8989
+ Content-Type:
8990
+ - text/xml
8991
+ Content-Length:
8992
+ - '383'
8993
+ Vary:
8994
+ - User-Agent
8995
+ body:
8996
+ encoding: UTF-8
8997
+ string: |
8998
+ <?xml version="1.0"?>
8999
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9000
+ <GetServiceStatusResult>
9001
+ <Status>GREEN</Status>
9002
+ <Timestamp>2014-04-27T20:59:30.240Z</Timestamp>
9003
+ </GetServiceStatusResult>
9004
+ <ResponseMetadata>
9005
+ <RequestId>d143973b-175f-44f8-98bd-f783bea4c9d8</RequestId>
9006
+ </ResponseMetadata>
9007
+ </GetServiceStatusResponse>
9008
+ http_version:
9009
+ recorded_at: Sun, 27 Apr 2014 20:59:30 GMT
9010
+ - request:
9011
+ method: post
9012
+ uri: https://mws.amazonservices.jp/Products/2011-10-01?AWSAccessKeyId=AKIAJ5RDDSRROM6GXQ5Q&Action=GetServiceStatus&MarketplaceId=A1VC38T7YXB528&SellerId=A7BU5WGNVGQ1I&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A30Z&Signature=2s7JxsGSWRW%2F9Fnu11Rl8qgFEbyTvWL%2F7809YHE367I%3D
9013
+ body:
9014
+ encoding: US-ASCII
9015
+ string: ''
9016
+ headers:
9017
+ User-Agent:
9018
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9019
+ response:
9020
+ status:
9021
+ code: 200
9022
+ message:
9023
+ headers:
9024
+ Date:
9025
+ - Sun, 27 Apr 2014 20:59:31 GMT
9026
+ Server:
9027
+ - AmazonMWS
9028
+ x-mws-request-id:
9029
+ - 9fa3e219-6498-48de-a272-15d733024a7d
9030
+ x-mws-timestamp:
9031
+ - '2014-04-27T20:59:31.508Z'
9032
+ x-mws-response-context:
9033
+ - h60ygA8eMIrah/bNVImAtDjSkTx2RznpqMKWSPRcpk3VPGUnViX+8UVBsS4JZvHxct1edAv4Ag7z
9034
+ CkXwwkKcUQ==
9035
+ Content-Type:
9036
+ - text/xml
9037
+ Content-Length:
9038
+ - '383'
9039
+ Vary:
9040
+ - User-Agent
9041
+ body:
9042
+ encoding: UTF-8
9043
+ string: |
9044
+ <?xml version="1.0"?>
9045
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9046
+ <GetServiceStatusResult>
9047
+ <Status>GREEN</Status>
9048
+ <Timestamp>2014-04-27T20:59:31.508Z</Timestamp>
9049
+ </GetServiceStatusResult>
9050
+ <ResponseMetadata>
9051
+ <RequestId>9fa3e219-6498-48de-a272-15d733024a7d</RequestId>
9052
+ </ResponseMetadata>
9053
+ </GetServiceStatusResponse>
9054
+ http_version:
9055
+ recorded_at: Sun, 27 Apr 2014 20:59:31 GMT
9056
+ - request:
9057
+ method: post
9058
+ uri: https://mws-eu.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAI4ZNSD76DH7UBRDA&Action=GetServiceStatus&MarketplaceId=A13V1IB3VIYZZH&SellerId=A2DP6GIDYN6OTH&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A31Z&Signature=vbV9sr6xmGdjAZzhoZdQerST73EqegtCj3i%2Fd104TEM%3D
9059
+ body:
9060
+ encoding: US-ASCII
9061
+ string: ''
9062
+ headers:
9063
+ User-Agent:
9064
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9065
+ response:
9066
+ status:
9067
+ code: 200
9068
+ message:
9069
+ headers:
9070
+ Date:
9071
+ - Sun, 27 Apr 2014 20:59:31 GMT
9072
+ Server:
9073
+ - AmazonMWS
9074
+ x-mws-request-id:
9075
+ - a246e994-aa4f-4597-bb54-11bb33e57e0e
9076
+ x-mws-timestamp:
9077
+ - '2014-04-27T20:59:31.884Z'
9078
+ x-mws-response-context:
9079
+ - zRNbmztvjwrWov+vgvUAy86DanCnUyKinMPsAyfxwocMohYDw9J94+7TqrYYf8vHbdIheHByd+Tq
9080
+ rTU3cxawLQ==
9081
+ Content-Type:
9082
+ - text/xml
9083
+ Content-Length:
9084
+ - '383'
9085
+ Vary:
9086
+ - User-Agent
9087
+ body:
9088
+ encoding: UTF-8
9089
+ string: |
9090
+ <?xml version="1.0"?>
9091
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9092
+ <GetServiceStatusResult>
9093
+ <Status>GREEN</Status>
9094
+ <Timestamp>2014-04-27T20:59:31.884Z</Timestamp>
9095
+ </GetServiceStatusResult>
9096
+ <ResponseMetadata>
9097
+ <RequestId>a246e994-aa4f-4597-bb54-11bb33e57e0e</RequestId>
9098
+ </ResponseMetadata>
9099
+ </GetServiceStatusResponse>
9100
+ http_version:
9101
+ recorded_at: Sun, 27 Apr 2014 20:59:31 GMT
9102
+ - request:
9103
+ method: post
9104
+ uri: https://mws-eu.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAIORT7554FEBW7UBQ&Action=GetServiceStatus&MarketplaceId=A1PA6795UKMFR9&SellerId=A7ZXDJZD3UIRG&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A31Z&Signature=AOX36er%2B7afbBTSStXs6gZ1EP6%2F8Im%2B74V0gKtBH6Wg%3D
9105
+ body:
9106
+ encoding: US-ASCII
9107
+ string: ''
9108
+ headers:
9109
+ User-Agent:
9110
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9111
+ response:
9112
+ status:
9113
+ code: 200
9114
+ message:
9115
+ headers:
9116
+ Date:
9117
+ - Sun, 27 Apr 2014 20:59:31 GMT
9118
+ Server:
9119
+ - AmazonMWS
9120
+ x-mws-request-id:
9121
+ - a11ddff3-4eac-4bca-88a7-a49af53836c6
9122
+ x-mws-timestamp:
9123
+ - '2014-04-27T20:59:32.051Z'
9124
+ x-mws-response-context:
9125
+ - f+ddCjYsKdXRtTVYeqqLwZi+oFEAyAtLXPvW5+sXhbnlgfcZ+P/wTjlNOeQ0d7hODT7AuM0LJwj2
9126
+ GkElP2zJsA==
9127
+ Content-Type:
9128
+ - text/xml
9129
+ Content-Length:
9130
+ - '383'
9131
+ Vary:
9132
+ - User-Agent
9133
+ body:
9134
+ encoding: UTF-8
9135
+ string: |
9136
+ <?xml version="1.0"?>
9137
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9138
+ <GetServiceStatusResult>
9139
+ <Status>GREEN</Status>
9140
+ <Timestamp>2014-04-27T20:59:32.051Z</Timestamp>
9141
+ </GetServiceStatusResult>
9142
+ <ResponseMetadata>
9143
+ <RequestId>a11ddff3-4eac-4bca-88a7-a49af53836c6</RequestId>
9144
+ </ResponseMetadata>
9145
+ </GetServiceStatusResponse>
9146
+ http_version:
9147
+ recorded_at: Sun, 27 Apr 2014 20:59:32 GMT
9148
+ - request:
9149
+ method: post
9150
+ uri: https://mws.amazonservices.ca/Products/2011-10-01?AWSAccessKeyId=AKIAITHQMZUJROSOP27Q&Action=GetServiceStatus&MarketplaceId=A2EUQ1WTGCTBG2&SellerId=A2A7WNXBU01UJW&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A32Z&Signature=Lrn%2B1oUf6MRhhru91Ken6rNVMl8%2F5bXVJJXzlce%2BQ3A%3D
9151
+ body:
9152
+ encoding: US-ASCII
9153
+ string: ''
9154
+ headers:
9155
+ User-Agent:
9156
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9157
+ response:
9158
+ status:
9159
+ code: 200
9160
+ message:
9161
+ headers:
9162
+ Date:
9163
+ - Sun, 27 Apr 2014 20:59:32 GMT
9164
+ Server:
9165
+ - AmazonMWS
9166
+ x-mws-request-id:
9167
+ - b7fe316c-25de-4c14-b463-b4301f04e0b3
9168
+ x-mws-timestamp:
9169
+ - '2014-04-27T20:59:32.878Z'
9170
+ x-mws-response-context:
9171
+ - Ko9wHOUEEyoel+8U+xYdGpIkzTsXL7WOigvlgbeJ2YMLpcpb+/SyrEXBEmrOIKDUa9NrvJbCXuGQ
9172
+ BoduMrgtAA==
9173
+ Content-Type:
9174
+ - text/xml
9175
+ Content-Length:
9176
+ - '383'
9177
+ Vary:
9178
+ - User-Agent
9179
+ body:
9180
+ encoding: UTF-8
9181
+ string: |
9182
+ <?xml version="1.0"?>
9183
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9184
+ <GetServiceStatusResult>
9185
+ <Status>GREEN</Status>
9186
+ <Timestamp>2014-04-27T20:59:32.878Z</Timestamp>
9187
+ </GetServiceStatusResult>
9188
+ <ResponseMetadata>
9189
+ <RequestId>b7fe316c-25de-4c14-b463-b4301f04e0b3</RequestId>
9190
+ </ResponseMetadata>
9191
+ </GetServiceStatusResponse>
9192
+ http_version:
9193
+ recorded_at: Sun, 27 Apr 2014 20:59:33 GMT
9194
+ - request:
9195
+ method: post
9196
+ uri: https://mws.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAJ767ZET2BZR4UDDQ&Action=GetServiceStatus&MarketplaceId=ATVPDKIKX0DER&SellerId=A2H6NH4SQYFZ4M&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A33Z&Signature=8bux7hc%2FBenzrDSrZNjJK623mVPkom9PsgjqClznRe8%3D
9197
+ body:
9198
+ encoding: US-ASCII
9199
+ string: ''
9200
+ headers:
9201
+ User-Agent:
9202
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9203
+ response:
9204
+ status:
9205
+ code: 200
9206
+ message:
9207
+ headers:
9208
+ Date:
9209
+ - Sun, 27 Apr 2014 20:59:32 GMT
9210
+ Server:
9211
+ - AmazonMWS
9212
+ x-mws-request-id:
9213
+ - 40555555-40a3-4365-8af8-beb512ce2cda
9214
+ x-mws-timestamp:
9215
+ - '2014-04-27T20:59:33.312Z'
9216
+ x-mws-response-context:
9217
+ - 3lzCQliDpUH8/KAeSk24El4y9SEglweMAK2a+9VhW5znLv8pGbgWN0LNjdu6dKkbvbVgpvdHO/22
9218
+ R0ZXhyjMMA==
9219
+ Content-Type:
9220
+ - text/xml
9221
+ Content-Length:
9222
+ - '383'
9223
+ Vary:
9224
+ - User-Agent
9225
+ body:
9226
+ encoding: UTF-8
9227
+ string: |
9228
+ <?xml version="1.0"?>
9229
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9230
+ <GetServiceStatusResult>
9231
+ <Status>GREEN</Status>
9232
+ <Timestamp>2014-04-27T20:59:33.312Z</Timestamp>
9233
+ </GetServiceStatusResult>
9234
+ <ResponseMetadata>
9235
+ <RequestId>40555555-40a3-4365-8af8-beb512ce2cda</RequestId>
9236
+ </ResponseMetadata>
9237
+ </GetServiceStatusResponse>
9238
+ http_version:
9239
+ recorded_at: Sun, 27 Apr 2014 20:59:33 GMT
9240
+ - request:
9241
+ method: post
9242
+ uri: https://mws-eu.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAJJDQ2MJTMPXKJE4A&Action=GetServiceStatus&MarketplaceId=A1F83G8C2ARO7P&SellerId=A2D9DZ30GEWP6N&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A33Z&Signature=GygSb3m0GVivShaZogXgxHzkWdGJvlgZVzmOwWtFs0s%3D
9243
+ body:
9244
+ encoding: US-ASCII
9245
+ string: ''
9246
+ headers:
9247
+ User-Agent:
9248
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9249
+ response:
9250
+ status:
9251
+ code: 200
9252
+ message:
9253
+ headers:
9254
+ Date:
9255
+ - Sun, 27 Apr 2014 20:59:33 GMT
9256
+ Server:
9257
+ - AmazonMWS
9258
+ x-mws-request-id:
9259
+ - 92dbf239-30d6-48b1-a40b-177976577bd2
9260
+ x-mws-timestamp:
9261
+ - '2014-04-27T20:59:33.561Z'
9262
+ x-mws-response-context:
9263
+ - zRNbmztvjwrWov+vgvUAy86DanCnUyKinMPsAyfxwocMohYDw9J94+7TqrYYf8vHbdIheHByd+Tq
9264
+ rTU3cxawLQ==
9265
+ Content-Type:
9266
+ - text/xml
9267
+ Content-Length:
9268
+ - '383'
9269
+ Vary:
9270
+ - User-Agent
9271
+ body:
9272
+ encoding: UTF-8
9273
+ string: |
9274
+ <?xml version="1.0"?>
9275
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9276
+ <GetServiceStatusResult>
9277
+ <Status>GREEN</Status>
9278
+ <Timestamp>2014-04-27T20:59:33.561Z</Timestamp>
9279
+ </GetServiceStatusResult>
9280
+ <ResponseMetadata>
9281
+ <RequestId>92dbf239-30d6-48b1-a40b-177976577bd2</RequestId>
9282
+ </ResponseMetadata>
9283
+ </GetServiceStatusResponse>
9284
+ http_version:
9285
+ recorded_at: Sun, 27 Apr 2014 20:59:33 GMT
9286
+ - request:
9287
+ method: post
9288
+ uri: https://mws-eu.amazonservices.com/Products/2011-10-01?AWSAccessKeyId=AKIAJLUHOXLR5S2L6A6A&Action=GetServiceStatus&MarketplaceId=APJ6JRA9NG5V4&SellerId=A2APQUVDBVWV7E&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-04-27T20%3A59%3A33Z&Signature=aonTHQI%2FBF%2BLyPv0NzOsc8KeRzXogPfeCFtEiLyEBl8%3D
9289
+ body:
9290
+ encoding: US-ASCII
9291
+ string: ''
9292
+ headers:
9293
+ User-Agent:
9294
+ - Jeff/1.0.1 (Language=Ruby; Hakans-MacBook-Pro.local)
9295
+ response:
9296
+ status:
9297
+ code: 200
9298
+ message:
9299
+ headers:
9300
+ Date:
9301
+ - Sun, 27 Apr 2014 20:59:33 GMT
9302
+ Server:
9303
+ - AmazonMWS
9304
+ x-mws-request-id:
9305
+ - f13afd57-c156-4655-992f-80431602c7f1
9306
+ x-mws-timestamp:
9307
+ - '2014-04-27T20:59:33.756Z'
9308
+ x-mws-response-context:
9309
+ - uNj7aKZcPvRHG4h5n0PRpjfh+i2B3YeYb3D9sMM9ojaTNP1a32oRdmEkjTZ3dARG76J/7Fajjfxe
9310
+ rnLFwB72IQ==
9311
+ Content-Type:
9312
+ - text/xml
9313
+ Content-Length:
9314
+ - '383'
9315
+ Vary:
9316
+ - User-Agent
9317
+ body:
9318
+ encoding: UTF-8
9319
+ string: |
9320
+ <?xml version="1.0"?>
9321
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
9322
+ <GetServiceStatusResult>
9323
+ <Status>GREEN</Status>
9324
+ <Timestamp>2014-04-27T20:59:33.756Z</Timestamp>
9325
+ </GetServiceStatusResult>
9326
+ <ResponseMetadata>
9327
+ <RequestId>f13afd57-c156-4655-992f-80431602c7f1</RequestId>
9328
+ </ResponseMetadata>
9329
+ </GetServiceStatusResponse>
9330
+ http_version:
9331
+ recorded_at: Sun, 27 Apr 2014 20:59:33 GMT
8964
9332
  recorded_with: VCR 2.9.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peddler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hakan Ensari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-27 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeff
@@ -131,6 +131,7 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - LICENSE
133
133
  - README.md
134
+ - lib/mws.rb
134
135
  - lib/mws/cart_information.rb
135
136
  - lib/mws/customer_information.rb
136
137
  - lib/mws/feeds.rb
@@ -169,12 +170,14 @@ files:
169
170
  - test/integration_helper.rb
170
171
  - test/mws.yml
171
172
  - test/mws.yml.example
173
+ - test/unit/mws/test_products.rb
172
174
  - test/unit/peddler/test_client.rb
173
175
  - test/unit/peddler/test_flat_file_parser.rb
174
176
  - test/unit/peddler/test_operation.rb
177
+ - test/unit/peddler/test_parser.rb
175
178
  - test/unit/peddler/test_structured_list.rb
176
179
  - test/unit/peddler/test_xml_parser.rb
177
- - test/unit/test_peddler.rb
180
+ - test/unit/test_mws.rb
178
181
  - test/vcr_cassettes/CartInformation.yml
179
182
  - test/vcr_cassettes/CustomerInformation.yml
180
183
  - test/vcr_cassettes/Feeds.yml
@@ -229,12 +232,14 @@ test_files:
229
232
  - test/integration_helper.rb
230
233
  - test/mws.yml
231
234
  - test/mws.yml.example
235
+ - test/unit/mws/test_products.rb
232
236
  - test/unit/peddler/test_client.rb
233
237
  - test/unit/peddler/test_flat_file_parser.rb
234
238
  - test/unit/peddler/test_operation.rb
239
+ - test/unit/peddler/test_parser.rb
235
240
  - test/unit/peddler/test_structured_list.rb
236
241
  - test/unit/peddler/test_xml_parser.rb
237
- - test/unit/test_peddler.rb
242
+ - test/unit/test_mws.rb
238
243
  - test/vcr_cassettes/CartInformation.yml
239
244
  - test/vcr_cassettes/CustomerInformation.yml
240
245
  - test/vcr_cassettes/Feeds.yml
@@ -1,8 +0,0 @@
1
- require 'helper'
2
- require 'peddler'
3
-
4
- class PeddlerTest < MiniTest::Test
5
- def test_loads_all_apis
6
- assert_equal 13, MWS.constants.size
7
- end
8
- end