peddler 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
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/Sellers/2011-07-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%3A13%3A57Z&Version=2011-07-01&Signature=Gdxv8jDoYOJ1GDoNkxiVe5EIgECrTrTkUaEBg%2FqE%2BXI%3D'
8
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A13%3A57Z&Version=2011-07-01&Signature=Gdxv8jDoYOJ1GDoNkxiVe5EIgECrTrTkUaEBg%2FqE%2BXI%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/Sellers/2011-07-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%3A13%3A58Z&Version=2011-07-01&Signature=OALSBasa%2F6bABOyBCAUvnWH%2Be14TZRIJTSdedYZbpR8%3D'
53
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A13%3A58Z&Version=2011-07-01&Signature=OALSBasa%2F6bABOyBCAUvnWH%2Be14TZRIJTSdedYZbpR8%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/Sellers/2011-07-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%3A13%3A58Z&Version=2011-07-01&Signature=L45DmGqP13WqNiI711L9V8ko3bLbO6XCE3ChNrI1%2FeY%3D'
98
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A13%3A58Z&Version=2011-07-01&Signature=L45DmGqP13WqNiI711L9V8ko3bLbO6XCE3ChNrI1%2FeY%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/Sellers/2011-07-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%3A13%3A59Z&Version=2011-07-01&Signature=UJDjuYTUEoyUO1R0%2FNJRUCBGbi6dPt2DzLSqG%2BqrIDg%3D'
143
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2015-03-28T18%3A13%3A59Z&Version=2011-07-01&Signature=UJDjuYTUEoyUO1R0%2FNJRUCBGbi6dPt2DzLSqG%2BqrIDg%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:14:00 GMT
183
- recorded_with: VCR 2.9.3
183
+ - request:
184
+ method: post
185
+ uri: https://mws.amazonservices.com.mx/Sellers/2011-07-01
186
+ body:
187
+ encoding: UTF-8
188
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T13%3A12%3A43Z&Version=2011-07-01&Signature=mVuk25QB72luLdacYy6vRfw7xR7WIYrDOziweaU62QA%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 13:12:44 GMT
203
+ Content-Type:
204
+ - text/xml
205
+ Content-Length:
206
+ - '376'
207
+ Connection:
208
+ - keep-alive
209
+ x-mws-request-id:
210
+ - aea4ad79-b8dd-4f07-9a73-844aaf429adb
211
+ x-mws-timestamp:
212
+ - '2016-05-23T13:12:44.092Z'
213
+ x-mws-response-context:
214
+ - GKJrQ0mtf0gQ5iIR90m5Jge7CSnUoM2P2vbzjDyA4NnG1rFeDvdddLHk+m7BPxaiMt/s5R8GcsIl
215
+ anpAhY1v5g==
216
+ Vary:
217
+ - Accept-Encoding,User-Agent
218
+ body:
219
+ encoding: UTF-8
220
+ string: |
221
+ <?xml version="1.0"?>
222
+ <GetServiceStatusResponse xmlns="https://mws.amazonservices.com/Sellers/2011-07-01">
223
+ <GetServiceStatusResult>
224
+ <Status>GREEN</Status>
225
+ <Timestamp>2016-05-23T13:12:44.092Z</Timestamp>
226
+ </GetServiceStatusResult>
227
+ <ResponseMetadata>
228
+ <RequestId>aea4ad79-b8dd-4f07-9a73-844aaf429adb</RequestId>
229
+ </ResponseMetadata>
230
+ </GetServiceStatusResponse>
231
+ http_version:
232
+ recorded_at: Mon, 23 May 2016 13:12:44 GMT
233
+ - request:
234
+ method: post
235
+ uri: https://mws-eu.amazonservices.com/Sellers/2011-07-01
236
+ body:
237
+ encoding: UTF-8
238
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T13%3A12%3A44Z&Version=2011-07-01&Signature=bwwhehxz%2BZ%2Bzyxbn%2FnFpyDnc81OEA6nJ8BmSghXEADI%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 13:12:44 GMT
253
+ Content-Type:
254
+ - text/xml
255
+ Content-Length:
256
+ - '376'
257
+ Connection:
258
+ - keep-alive
259
+ x-mws-request-id:
260
+ - c9981132-2d74-44c6-b36c-0744d50d2c68
261
+ x-mws-timestamp:
262
+ - '2016-05-23T13:12:44.474Z'
263
+ x-mws-response-context:
264
+ - fNGAxjz9VMG+Q+A35OIVxjDV71nCcsdqIf8BXQTnfziDyt46xxJBvSHGK72lCJ7rgyZtE30x28vj
265
+ 4nXb5U7M4Q==
266
+ Vary:
267
+ - Accept-Encoding,User-Agent
268
+ body:
269
+ encoding: UTF-8
270
+ string: |
271
+ <?xml version="1.0"?>
272
+ <GetServiceStatusResponse xmlns="https://mws.amazonservices.com/Sellers/2011-07-01">
273
+ <GetServiceStatusResult>
274
+ <Status>GREEN</Status>
275
+ <Timestamp>2016-05-23T13:12:44.474Z</Timestamp>
276
+ </GetServiceStatusResult>
277
+ <ResponseMetadata>
278
+ <RequestId>c9981132-2d74-44c6-b36c-0744d50d2c68</RequestId>
279
+ </ResponseMetadata>
280
+ </GetServiceStatusResponse>
281
+ http_version:
282
+ recorded_at: Mon, 23 May 2016 13:12:44 GMT
283
+ - request:
284
+ method: post
285
+ uri: https://mws-eu.amazonservices.com/Sellers/2011-07-01
286
+ body:
287
+ encoding: UTF-8
288
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T13%3A12%3A44Z&Version=2011-07-01&Signature=WWkUCBA3y14zctlDO2kL1F33KXEhd9TLkxcH9fCcYrQ%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 13:12:44 GMT
303
+ Content-Type:
304
+ - text/xml
305
+ Content-Length:
306
+ - '376'
307
+ Connection:
308
+ - keep-alive
309
+ x-mws-request-id:
310
+ - 3989d301-ce9a-49a7-aaad-f926f83375fd
311
+ x-mws-timestamp:
312
+ - '2016-05-23T13:12:44.741Z'
313
+ x-mws-response-context:
314
+ - SQ+2b8Hdym1eRj+Gvxdoi+0/T+UR830m1OLnC4uLu77CMzOgYCIW3tZ437BznBYfrwfF3H14PeZ0
315
+ 6BsBBoFYfg==
316
+ Vary:
317
+ - Accept-Encoding,User-Agent
318
+ body:
319
+ encoding: UTF-8
320
+ string: |
321
+ <?xml version="1.0"?>
322
+ <GetServiceStatusResponse xmlns="https://mws.amazonservices.com/Sellers/2011-07-01">
323
+ <GetServiceStatusResult>
324
+ <Status>GREEN</Status>
325
+ <Timestamp>2016-05-23T13:12:44.741Z</Timestamp>
326
+ </GetServiceStatusResult>
327
+ <ResponseMetadata>
328
+ <RequestId>3989d301-ce9a-49a7-aaad-f926f83375fd</RequestId>
329
+ </ResponseMetadata>
330
+ </GetServiceStatusResponse>
331
+ http_version:
332
+ recorded_at: Mon, 23 May 2016 13:12:44 GMT
333
+ - request:
334
+ method: post
335
+ uri: https://mws-eu.amazonservices.com/Sellers/2011-07-01
336
+ body:
337
+ encoding: UTF-8
338
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T13%3A12%3A44Z&Version=2011-07-01&Signature=6Uc%2FIwJ16FM%2F9sRr786xkh%2B5Yoe8dETppIFva8%2BUUFA%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 13:12:45 GMT
353
+ Content-Type:
354
+ - text/xml
355
+ Content-Length:
356
+ - '376'
357
+ Connection:
358
+ - keep-alive
359
+ x-mws-request-id:
360
+ - cb651f0b-1105-4a5b-a129-49f6465e12ed
361
+ x-mws-timestamp:
362
+ - '2016-05-23T13:12:45.018Z'
363
+ x-mws-response-context:
364
+ - k9uOiYKjStmeZ/uli4CqKAaYkealWBinKlFsOhwyiTgmpMcJU03vsRh0yqZWPyhib6qSkKSF/xSt
365
+ cWJXzzLQ3w==
366
+ Vary:
367
+ - Accept-Encoding,User-Agent
368
+ body:
369
+ encoding: UTF-8
370
+ string: |
371
+ <?xml version="1.0"?>
372
+ <GetServiceStatusResponse xmlns="https://mws.amazonservices.com/Sellers/2011-07-01">
373
+ <GetServiceStatusResult>
374
+ <Status>GREEN</Status>
375
+ <Timestamp>2016-05-23T13:12:45.018Z</Timestamp>
376
+ </GetServiceStatusResult>
377
+ <ResponseMetadata>
378
+ <RequestId>cb651f0b-1105-4a5b-a129-49f6465e12ed</RequestId>
379
+ </ResponseMetadata>
380
+ </GetServiceStatusResponse>
381
+ http_version:
382
+ recorded_at: Mon, 23 May 2016 13:12:45 GMT
383
+ - request:
384
+ method: post
385
+ uri: https://mws-eu.amazonservices.com/Sellers/2011-07-01
386
+ body:
387
+ encoding: UTF-8
388
+ string: AWSAccessKeyId=FILTERED&Action=GetServiceStatus&SellerId=FILTERED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2016-05-23T13%3A12%3A45Z&Version=2011-07-01&Signature=rmqM%2FmhQKhRnsLkFKqqLhauwfbxLVdwzP6ZH%2Fx2RFxU%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 13:12:45 GMT
403
+ Content-Type:
404
+ - text/xml
405
+ Content-Length:
406
+ - '376'
407
+ Connection:
408
+ - keep-alive
409
+ x-mws-request-id:
410
+ - ad86e223-80c1-4f56-bec6-14a26c164a58
411
+ x-mws-timestamp:
412
+ - '2016-05-23T13:12:45.268Z'
413
+ x-mws-response-context:
414
+ - "/Dmb0rR7lKYk+I/r/l3H9BQeVzoxfN/yKUdEH1Iqt62zlXEXhYlT2my3p4JqwMyZ6gjp30mjCzKv
415
+ kbfCWY6Rpg=="
416
+ Vary:
417
+ - Accept-Encoding,User-Agent
418
+ body:
419
+ encoding: UTF-8
420
+ string: |
421
+ <?xml version="1.0"?>
422
+ <GetServiceStatusResponse xmlns="https://mws.amazonservices.com/Sellers/2011-07-01">
423
+ <GetServiceStatusResult>
424
+ <Status>GREEN</Status>
425
+ <Timestamp>2016-05-23T13:12:45.268Z</Timestamp>
426
+ </GetServiceStatusResult>
427
+ <ResponseMetadata>
428
+ <RequestId>ad86e223-80c1-4f56-bec6-14a26c164a58</RequestId>
429
+ </ResponseMetadata>
430
+ </GetServiceStatusResponse>
431
+ http_version:
432
+ recorded_at: Mon, 23 May 2016 13:12:45 GMT
433
+ recorded_with: VCR 3.0.1