ScaleLeap / amazon-mws-api-sdk

A fully typed TypeScript and Node.js Amazon MWS API Unofficial SDK
https://npm.im/@scaleleap/amazon-mws-api-sdk
MIT License
20 stars 12 forks source link

PaymentMethodDetails isn't mandatory #293

Closed m-dierker closed 3 years ago

m-dierker commented 3 years ago

Error from prod usage:

ParsingError
Problem with the value of property "ListOrdersResponse"
Problem with the value of property "ListOrdersResult"
Problem with the value of property "Orders"
Problem with value at index 3
Problem with property "PaymentMethodDetails"
it does not exist in received object {"LatestShipDate":"2021-01-01T00:00:00Z","OrderType":"StandardOrder","PurchaseDate":"2021-01-01T00:00:00Z","AmazonOrderId":"123-1234567-1234567","LastUpdateDate":"2021-01-01T00:00:00Z","IsReplacementOrder":true,"NumberOfItemsShipped":0,"ShipServiceLevel":"Expedited","OrderStatus":"Pending","SalesChannel":"Amazon.com","IsBusinessOrder":false,"NumberOfItemsUnshipped":1,"IsGlobalExpressEnabled":false,"IsSoldByAB":false,"IsPremiumOrder":false,"EarliestShipDate":"2021-01-01T00:00:00Z","MarketplaceId":"ASIN","FulfillmentChannel":"AFN","PaymentMethod":"Other","ReplacedOrderId":"123-1234567-1234567","IsISPU":false,"IsPrime":false,"SellerOrderId":"123-1234567-1234567","ShipmentServiceLevelCategory":"Expedited"}
    at Object.Left (/workspace/node_modules/@scaleleap/amazon-mws-api-sdk/lib/sections/orders.js:263:23)
    at Left.caseOf (/workspace/node_modules/purify-ts/Either.js:269:58)
    at Orders.listOrders (/workspace/node_modules/@scaleleap/amazon-mws-api-sdk/lib/sections/orders.js:260:52)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /workspace/lib/index.js:29:25

Looks like a replacement order doesn't have PaymentMethodDetails which causes an error.

moltar commented 3 years ago

@mvd7793 can you submit a PR please? I'll approve it promptly. Otherwise will get it done next week.

moltar commented 3 years ago

If you provide a PR, please use fix: prefix in your commit, which will trigger a release.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.9.32 :tada:

The release is available on:

Your semantic-release bot :package::rocket: