peddler 1.3.0 → 1.4.0

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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -22
  3. data/lib/mws/fulfillment_outbound_shipment/client.rb +12 -5
  4. data/lib/mws/merchant_fulfillment/client.rb +2 -2
  5. data/lib/mws/orders/client.rb +9 -1
  6. data/lib/mws/products/client.rb +14 -1
  7. data/lib/mws/reports/client.rb +1 -1
  8. data/lib/mws.rb +0 -3
  9. data/lib/peddler/client.rb +12 -19
  10. data/lib/peddler/errors/builder.rb +20 -0
  11. data/lib/peddler/errors/error.rb +13 -0
  12. data/lib/peddler/errors/handler.rb +45 -0
  13. data/lib/peddler/errors/parser.rb +28 -0
  14. data/lib/peddler/flat_file_parser.rb +1 -1
  15. data/lib/peddler/marketplace.rb +2 -2
  16. data/lib/peddler/parser.rb +0 -1
  17. data/lib/peddler/structured_list.rb +1 -0
  18. data/lib/peddler/version.rb +1 -1
  19. data/lib/peddler/xml_parser.rb +1 -1
  20. data/test/helper.rb +1 -82
  21. data/test/integration/test_errors.rb +36 -0
  22. data/test/integration/test_feeds.rb +1 -1
  23. data/test/integration/test_fulfillment_inbound_shipment.rb +1 -1
  24. data/test/integration/test_fulfillment_inventory.rb +1 -1
  25. data/test/integration/test_fulfillment_outbound_shipment.rb +1 -1
  26. data/test/integration/test_merchant_fulfillment.rb +1 -1
  27. data/test/integration/test_off_amazon_payments.rb +1 -1
  28. data/test/integration/test_orders.rb +3 -1
  29. data/test/integration/test_products.rb +1 -1
  30. data/test/integration/test_recommendations.rb +2 -4
  31. data/test/integration/test_reports.rb +1 -1
  32. data/test/integration/test_sellers.rb +1 -1
  33. data/test/integration/test_subscriptions.rb +1 -1
  34. data/test/integration_helper.rb +41 -0
  35. data/test/mws.yml +28 -8
  36. data/test/mws.yml.example +21 -1
  37. data/test/recorder.rb +34 -0
  38. data/test/unit/mws/test_fulfillment_inbound_shipment_client.rb +2 -1
  39. data/test/unit/mws/test_fulfillment_outbound_shipment_client.rb +9 -2
  40. data/test/unit/mws/test_orders_client.rb +12 -0
  41. data/test/unit/mws/test_products_client.rb +37 -0
  42. data/test/unit/peddler/errors/test_builder.rb +16 -0
  43. data/test/unit/peddler/errors/test_error.rb +16 -0
  44. data/test/unit/peddler/errors/test_handler.rb +60 -0
  45. data/test/unit/peddler/{test_error_parser.rb → errors/test_parser.rb} +3 -3
  46. data/test/unit/peddler/test_client.rb +3 -3
  47. data/test/unit/peddler/test_flat_file_parser.rb +39 -30
  48. data/test/unit/peddler/test_structured_list.rb +5 -0
  49. data/test/unit/peddler/test_vcr_matcher.rb +4 -0
  50. data/test/unit/test_mws.rb +1 -1
  51. data/test/vcr_cassettes/CartInformation.yml +263 -13
  52. data/test/vcr_cassettes/CustomerInformation.yml +255 -5
  53. data/test/vcr_cassettes/Errors.yml +885 -0
  54. data/test/vcr_cassettes/Feeds.yml +5588 -17
  55. data/test/vcr_cassettes/FulfillmentInboundShipment.yml +3474 -39
  56. data/test/vcr_cassettes/FulfillmentInventory.yml +504 -9
  57. data/test/vcr_cassettes/FulfillmentOutboundShipment.yml +255 -5
  58. data/test/vcr_cassettes/MerchantFulfillment.yml +254 -4
  59. data/test/vcr_cassettes/OffAmazonPayments.yml +255 -5
  60. data/test/vcr_cassettes/Orders.yml +2696 -36
  61. data/test/vcr_cassettes/Products.yml +5534 -180
  62. data/test/vcr_cassettes/Recommendations.yml +847 -9
  63. data/test/vcr_cassettes/Reports.yml +3994 -101
  64. data/test/vcr_cassettes/Sellers.yml +255 -5
  65. data/test/vcr_cassettes/Subscriptions.yml +875 -13
  66. metadata +37 -27
  67. data/lib/mws/cart_information/client.rb +0 -74
  68. data/lib/mws/cart_information.rb +0 -1
  69. data/lib/mws/customer_information/client.rb +0 -80
  70. data/lib/mws/customer_information.rb +0 -1
  71. data/lib/mws/webstore/client.rb +0 -89
  72. data/lib/mws/webstore.rb +0 -1
  73. data/lib/peddler/error_parser.rb +0 -26
  74. data/test/integration/test_cart_information.rb +0 -11
  75. data/test/integration/test_customer_information.rb +0 -11
  76. data/test/integration/test_webstore.rb +0 -18
  77. data/test/unit/mws/test_cart_information_client.rb +0 -61
  78. data/test/unit/mws/test_customer_information_client.rb +0 -59
  79. data/test/unit/mws/test_webstore_client.rb +0 -101
  80. data/test/vcr_cassettes/Webstore.yml +0 -383
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://mws.amazonservices.ca/OffAmazonPayments/2013-01-01/
6
6
  body:
7
7
  encoding: US-ASCII
8
- string: 'AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=GetServiceStatus&SellerId=MERCHANT_ID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A34Z&Version=2013-01-01&Signature=VOsp%2B9IZ1fds4E0fxMfTX59t8uA63RWXzaCS%2BuOGv1g%3D'
8
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A34Z&Version=2013-01-01&Signature=VOsp%2B9IZ1fds4E0fxMfTX59t8uA63RWXzaCS%2BuOGv1g%3D
9
9
  headers:
10
10
  User-Agent:
11
11
  - Jeff/1.2.0 (Language=Ruby; Hakans-MacBook-Pro.local)
@@ -50,7 +50,7 @@ http_interactions:
50
50
  uri: https://mws-eu.amazonservices.com/OffAmazonPayments/2013-01-01/
51
51
  body:
52
52
  encoding: US-ASCII
53
- string: 'AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=GetServiceStatus&SellerId=MERCHANT_ID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A35Z&Version=2013-01-01&Signature=B23ntCYK6rHZeTrAggaOesQRaDSFuGtPYP1vtIWpxj0%3D'
53
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A35Z&Version=2013-01-01&Signature=B23ntCYK6rHZeTrAggaOesQRaDSFuGtPYP1vtIWpxj0%3D
54
54
  headers:
55
55
  User-Agent:
56
56
  - Jeff/1.2.0 (Language=Ruby; Hakans-MacBook-Pro.local)
@@ -95,7 +95,7 @@ http_interactions:
95
95
  uri: https://mws.amazonservices.jp/OffAmazonPayments/2013-01-01/
96
96
  body:
97
97
  encoding: US-ASCII
98
- string: 'AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=GetServiceStatus&SellerId=MERCHANT_ID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A36Z&Version=2013-01-01&Signature=0XbVnePFYNs4o0LUvEHUwaxiFdRRi2qhAKMPCtKXOq0%3D'
98
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A36Z&Version=2013-01-01&Signature=0XbVnePFYNs4o0LUvEHUwaxiFdRRi2qhAKMPCtKXOq0%3D
99
99
  headers:
100
100
  User-Agent:
101
101
  - Jeff/1.2.0 (Language=Ruby; Hakans-MacBook-Pro.local)
@@ -140,7 +140,7 @@ http_interactions:
140
140
  uri: https://mws.amazonservices.com/OffAmazonPayments/2013-01-01/
141
141
  body:
142
142
  encoding: US-ASCII
143
- string: 'AWSAccessKeyId=AWS_ACCESS_KEY_ID&Action=GetServiceStatus&SellerId=MERCHANT_ID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A37Z&Version=2013-01-01&Signature=8Ih4lU34LqA6T%2BFIJtrCodFRWLyHTo3iNwTLMfPv1Yw%3D'
143
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A11%3A37Z&Version=2013-01-01&Signature=8Ih4lU34LqA6T%2BFIJtrCodFRWLyHTo3iNwTLMfPv1Yw%3D
144
144
  headers:
145
145
  User-Agent:
146
146
  - Jeff/1.2.0 (Language=Ruby; Hakans-MacBook-Pro.local)
@@ -180,4 +180,254 @@ http_interactions:
180
180
  </GetServiceStatusResponse>
181
181
  http_version:
182
182
  recorded_at: Sat, 28 Mar 2015 18:11:38 GMT
183
- recorded_with: VCR 2.9.3
183
+ - request:
184
+ method: post
185
+ uri: https://mws.amazonservices.com.mx/OffAmazonPayments/2013-01-01/
186
+ body:
187
+ encoding: UTF-8
188
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T12%3A54%3A05Z&Version=2013-01-01&Signature=HLQq6s8KZXFD9ePHtHPFM6UOLt5VBlfRoLtiZF79lVQ%3D
189
+ headers:
190
+ User-Agent:
191
+ - Jeff/1.5.1 (Language=Ruby; Hakans-MacBook.home)
192
+ Content-Type:
193
+ - application/x-www-form-urlencoded
194
+ response:
195
+ status:
196
+ code: 200
197
+ message:
198
+ headers:
199
+ Server:
200
+ - Server
201
+ Date:
202
+ - Mon, 23 May 2016 12:54:05 GMT
203
+ Content-Type:
204
+ - text/xml
205
+ Content-Length:
206
+ - '392'
207
+ Connection:
208
+ - keep-alive
209
+ x-mws-request-id:
210
+ - 024dc310-94f2-4b13-bd30-076267564ae2
211
+ x-mws-timestamp:
212
+ - '2016-05-23T12:54:05.882Z'
213
+ x-mws-response-context:
214
+ - iCg0zJbgW+eAEqXrxpAlvDg3K+bpPhxGeRccpIefXDZoIoIevsUxn4COPjb3kQ3YllZd0vcqxGwx
215
+ OvV688DBmQ==
216
+ Vary:
217
+ - Accept-Encoding,User-Agent
218
+ body:
219
+ encoding: UTF-8
220
+ string: |
221
+ <?xml version="1.0"?>
222
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
223
+ <GetServiceStatusResult>
224
+ <Status>GREEN</Status>
225
+ <Timestamp>2016-05-23T12:54:05.882Z</Timestamp>
226
+ </GetServiceStatusResult>
227
+ <ResponseMetadata>
228
+ <RequestId>024dc310-94f2-4b13-bd30-076267564ae2</RequestId>
229
+ </ResponseMetadata>
230
+ </GetServiceStatusResponse>
231
+ http_version:
232
+ recorded_at: Mon, 23 May 2016 12:54:06 GMT
233
+ - request:
234
+ method: post
235
+ uri: https://mws-eu.amazonservices.com/OffAmazonPayments/2013-01-01/
236
+ body:
237
+ encoding: UTF-8
238
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T12%3A54%3A06Z&Version=2013-01-01&Signature=EXpOoTjcFfg09P0IO9XlaNcfttt%2Fok9B5j5wk3a1QtM%3D
239
+ headers:
240
+ User-Agent:
241
+ - Jeff/1.5.1 (Language=Ruby; Hakans-MacBook.home)
242
+ Content-Type:
243
+ - application/x-www-form-urlencoded
244
+ response:
245
+ status:
246
+ code: 200
247
+ message:
248
+ headers:
249
+ Server:
250
+ - Server
251
+ Date:
252
+ - Mon, 23 May 2016 12:54:06 GMT
253
+ Content-Type:
254
+ - text/xml
255
+ Content-Length:
256
+ - '392'
257
+ Connection:
258
+ - keep-alive
259
+ x-mws-request-id:
260
+ - 01d1a2a7-2eea-4732-a3f8-ff0340e567c3
261
+ x-mws-timestamp:
262
+ - '2016-05-23T12:54:06.202Z'
263
+ x-mws-response-context:
264
+ - mLCb8xKG/mEL++WMwmA5nqSKVO62r7SytsUkWn4pq9rUAktM9/k33DkUA+Ia27pkyNrpETdo/nHh
265
+ ho5RdjaOGA==
266
+ Vary:
267
+ - Accept-Encoding,User-Agent
268
+ body:
269
+ encoding: UTF-8
270
+ string: |
271
+ <?xml version="1.0"?>
272
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
273
+ <GetServiceStatusResult>
274
+ <Status>GREEN</Status>
275
+ <Timestamp>2016-05-23T12:54:06.202Z</Timestamp>
276
+ </GetServiceStatusResult>
277
+ <ResponseMetadata>
278
+ <RequestId>01d1a2a7-2eea-4732-a3f8-ff0340e567c3</RequestId>
279
+ </ResponseMetadata>
280
+ </GetServiceStatusResponse>
281
+ http_version:
282
+ recorded_at: Mon, 23 May 2016 12:54:06 GMT
283
+ - request:
284
+ method: post
285
+ uri: https://mws-eu.amazonservices.com/OffAmazonPayments/2013-01-01/
286
+ body:
287
+ encoding: UTF-8
288
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T12%3A54%3A06Z&Version=2013-01-01&Signature=ZT0IwHck7siodh8lxmmMQPiHUxtT9BeFhldEqO2F%2B20%3D
289
+ headers:
290
+ User-Agent:
291
+ - Jeff/1.5.1 (Language=Ruby; Hakans-MacBook.home)
292
+ Content-Type:
293
+ - application/x-www-form-urlencoded
294
+ response:
295
+ status:
296
+ code: 200
297
+ message:
298
+ headers:
299
+ Server:
300
+ - Server
301
+ Date:
302
+ - Mon, 23 May 2016 12:54:06 GMT
303
+ Content-Type:
304
+ - text/xml
305
+ Content-Length:
306
+ - '392'
307
+ Connection:
308
+ - keep-alive
309
+ x-mws-request-id:
310
+ - 7072a9f9-c7b2-4c2e-a906-f2740b3e0b11
311
+ x-mws-timestamp:
312
+ - '2016-05-23T12:54:06.448Z'
313
+ x-mws-response-context:
314
+ - PqOz7NNr/4Cuz3JcHX4H2UqS4BHArCWPbhoBbFtCp4RRjR8NhrGPTS6KLWClAZ2eL7vRFn2MHo2L
315
+ 4EDe2oXoLw==
316
+ Vary:
317
+ - Accept-Encoding,User-Agent
318
+ body:
319
+ encoding: UTF-8
320
+ string: |
321
+ <?xml version="1.0"?>
322
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
323
+ <GetServiceStatusResult>
324
+ <Status>GREEN</Status>
325
+ <Timestamp>2016-05-23T12:54:06.448Z</Timestamp>
326
+ </GetServiceStatusResult>
327
+ <ResponseMetadata>
328
+ <RequestId>7072a9f9-c7b2-4c2e-a906-f2740b3e0b11</RequestId>
329
+ </ResponseMetadata>
330
+ </GetServiceStatusResponse>
331
+ http_version:
332
+ recorded_at: Mon, 23 May 2016 12:54:06 GMT
333
+ - request:
334
+ method: post
335
+ uri: https://mws-eu.amazonservices.com/OffAmazonPayments/2013-01-01/
336
+ body:
337
+ encoding: UTF-8
338
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T12%3A54%3A06Z&Version=2013-01-01&Signature=bnlgv2A%2F3hsFL5TUjAGOrqjghm9%2Flb7JiJYXrbBBfHI%3D
339
+ headers:
340
+ User-Agent:
341
+ - Jeff/1.5.1 (Language=Ruby; Hakans-MacBook.home)
342
+ Content-Type:
343
+ - application/x-www-form-urlencoded
344
+ response:
345
+ status:
346
+ code: 200
347
+ message:
348
+ headers:
349
+ Server:
350
+ - Server
351
+ Date:
352
+ - Mon, 23 May 2016 12:54:06 GMT
353
+ Content-Type:
354
+ - text/xml
355
+ Content-Length:
356
+ - '392'
357
+ Connection:
358
+ - keep-alive
359
+ x-mws-request-id:
360
+ - 8dffe10e-18b5-4e03-82fd-e9548a2359ff
361
+ x-mws-timestamp:
362
+ - '2016-05-23T12:54:06.724Z'
363
+ x-mws-response-context:
364
+ - hI6IU8LsDlKhT0svth9n1u2IfOLF2DL3C9BtOLHupjDl+aglqOytYRImgnrGlMxDaqLGAcwfru34
365
+ RoSwJG5g9w==
366
+ Vary:
367
+ - Accept-Encoding,User-Agent
368
+ body:
369
+ encoding: UTF-8
370
+ string: |
371
+ <?xml version="1.0"?>
372
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
373
+ <GetServiceStatusResult>
374
+ <Status>GREEN</Status>
375
+ <Timestamp>2016-05-23T12:54:06.724Z</Timestamp>
376
+ </GetServiceStatusResult>
377
+ <ResponseMetadata>
378
+ <RequestId>8dffe10e-18b5-4e03-82fd-e9548a2359ff</RequestId>
379
+ </ResponseMetadata>
380
+ </GetServiceStatusResponse>
381
+ http_version:
382
+ recorded_at: Mon, 23 May 2016 12:54:06 GMT
383
+ - request:
384
+ method: post
385
+ uri: https://mws-eu.amazonservices.com/OffAmazonPayments/2013-01-01/
386
+ body:
387
+ encoding: UTF-8
388
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T12%3A54%3A06Z&Version=2013-01-01&Signature=KmlKCPSm%2BK7GQpCXa%2BwGDR2%2BGSvjbMYYWAh2mFFilA4%3D
389
+ headers:
390
+ User-Agent:
391
+ - Jeff/1.5.1 (Language=Ruby; Hakans-MacBook.home)
392
+ Content-Type:
393
+ - application/x-www-form-urlencoded
394
+ response:
395
+ status:
396
+ code: 200
397
+ message:
398
+ headers:
399
+ Server:
400
+ - Server
401
+ Date:
402
+ - Mon, 23 May 2016 12:54:06 GMT
403
+ Content-Type:
404
+ - text/xml
405
+ Content-Length:
406
+ - '392'
407
+ Connection:
408
+ - keep-alive
409
+ x-mws-request-id:
410
+ - 8fe371dc-0702-4096-a1cf-de76f41c92c0
411
+ x-mws-timestamp:
412
+ - '2016-05-23T12:54:06.967Z'
413
+ x-mws-response-context:
414
+ - LRf//epk+SEk+e3wi+dmDXfMdeOGnFYSHDgocwUR+tPuUtRn5q7H9Fmk/HNPZt/Kf5dv5SpNSdxR
415
+ OETzVuAUpQ==
416
+ Vary:
417
+ - Accept-Encoding,User-Agent
418
+ body:
419
+ encoding: UTF-8
420
+ string: |
421
+ <?xml version="1.0"?>
422
+ <GetServiceStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01">
423
+ <GetServiceStatusResult>
424
+ <Status>GREEN</Status>
425
+ <Timestamp>2016-05-23T12:54:06.967Z</Timestamp>
426
+ </GetServiceStatusResult>
427
+ <ResponseMetadata>
428
+ <RequestId>8fe371dc-0702-4096-a1cf-de76f41c92c0</RequestId>
429
+ </ResponseMetadata>
430
+ </GetServiceStatusResponse>
431
+ http_version:
432
+ recorded_at: Mon, 23 May 2016 12:54:07 GMT
433
+ recorded_with: VCR 3.0.1