t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
365 stars 104 forks source link

Version 2005-10-05 is unsupported. Please use 2011-08-01 or greater instead. #58

Closed yanalavishnu closed 7 years ago

yanalavishnu commented 7 years ago

For BrowseNodeLookup Operation I am getting the following error.

{"$":{"xmlns":"http://ecs.amazonaws.com/doc/2005-10-05/"},"Error":[{"Code":["UnsupportedVersion"],"Message":["Version 2005-10-05 is unsupported. Please use 2011-08-01 or greater instead."]}],"RequestId":["ee03c036-5049-4952-94f4-021c642f3ab0"]}

t3chnoboy commented 7 years ago

Looks like we do not specify version for BrowseNodeLookup https://github.com/t3chnoboy/amazon-product-api/blob/master/lib/utils.js#L73 https://github.com/t3chnoboy/amazon-product-api/blob/master/lib/utils.js#L75

We need to set it regardless of the method. I'll fix it later today or you can look into it if you have some time 😄

masterT commented 7 years ago

Holà,

Before I fix anything, I ran the test suite and it failed: Uncaught AssertionError: expected [response] to have property TotalResults. test/test.coffee:119 😞

It seems like it expect the response (in the callback) to be an Object with the property TotalResults, but in fact, it's an Array (which is an Object in JS).

It is the commit 033d43809159a06b7fbf4bd75579258259dc7d2b that breaks because it passes the original response and the test suite expects the first element of the response. However, I fixed the test suite expecting the original response.

I also fixed the version issue and add some tests to expect formatQueryParams to return the params including the Version.

🔧 Check my PR https://github.com/t3chnoboy/amazon-product-api/pull/59.

FdezRomero commented 7 years ago

Looks good! Thanks @masterT :+1:

masterT commented 7 years ago

PR #59 merged!