fillup / walmart-partner-api-sdk-php

PHP client for Walmart Partner APIs
MIT License
37 stars 51 forks source link

Timestamp issue on AuthSubscriber.php (401 - Unauthorized) #16

Closed jpnathannew closed 7 years ago

jpnathannew commented 7 years ago

I am trying to get the Walmart live store Items. When I connect the api. I faced the following error.

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] https://marketplace.walmartapis.com/v2/items?limit=10 [status code] 401 [reason phrase] Unauthorized' in C:\xampp\htdocs\myapp\walmart\vendors\guzzlehttp\command\src\AbstractClient.php on line 171

After thet I checked AuthSubscriber.php

Line number 44. You create the timestamp

$timestamp = intval(Utils::getMilliseconds());

But Its always returns -(minus) values.

So I have removed the intval() function. after that its working fine

$timestamp = Utils::getMilliseconds();

Will this be changed or updated on SDK side?

Thanks

rmarriott-db commented 7 years ago

I'm also getting this error. I'll try the edit you suggested. Thanks!

rmarriott-db commented 7 years ago

jpnathannew's solution worked for me

fillup commented 7 years ago

Removed call to intval() in 7fdf25b