Closed CarmenPopoviciu closed 7 years ago
+1!
Seems like this project has been sort of abandoned... do you guys know if this project is still relevant? I don't mind forking and applying the change #2 and using that instead of official repo, if that makes it work properly.
Sorry, did not realize anyone had been using this. Will look into this, generally improving the repo, and merging outstanding PRs.
Fixed by #3
Consider the setup below:
The API response for the request generated based on those parameters is:
After looking into it and comparing the query string generated by the lib with the one returned by the amazon scratchpad, for the exact same request, I noticed that that the order of the query parameters was different. The sorted params array, returned by the library is:
As far as I can tell, the mws docs state that the parameters should be alphabetically ordered, which is obviously not the case for the above. Looking at the code, I see the lib uses this as the sorting function for the params array. AFAIK, sort's
compareFunction
should return either a positive/negative number or 0, which, unless I'm missing something, the current function in that code, doesn't.I think this can easily be fixed by just using
.sort()
with the default behaviour ofcompareFunction
and I would be more than happy to submit a PR for this asap