fillup / walmart-partner-api-sdk-php

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

Order Listing throws error when the limit is greater than 10, which is default value #41

Open hamiltonnieri8755 opened 7 years ago

hamiltonnieri8755 commented 7 years ago

@fillup
$orders = $client->listReleased([ 'createdStartDate' => '2016-06-01', // optional 'limit' => 50, // optional, default 10 //'nextCursor' => '', // optional, val32jprewoihue comes from previous call, used for pagination ]);

Throws Fatal error: Call to a member function getStatusCode() on a non-object in .../src/Order.php on line 88

$orders = $client->listReleased([ 'createdStartDate' => '2016-06-01', // optional 'limit' => 10, // optional, default 10 //'nextCursor' => '', // optional, val32jprewoihue comes from previous call, used for pagination ]);

Works fine.

Let me get your opinion on this.

lovey11aug commented 7 years ago

I was trying to get all orders with limit of 100 and facing the same issue of getStatusCode().

Here is my code : $_lastOrderTime = [ 'createdStartDate' => date('Y-m-d', time() - 5184000), // approx 60 days ago 'limit' => 100, ]; $orders = $client->listAll($_lastOrderTime);

hamiltonnieri8755 commented 7 years ago

@lovey11aug Hi, I think Phillip fixed it. Can you try new version? Thanks.

fillup commented 7 years ago

@hamiltonnieri8755 @lovey11aug I haven't fixed or changed anything for a little while so if its working now perhaps it was an issue on the Walmart API side. Can you try again and let me know for sure? According to docs that value should support up to 200 results.

ajbonner commented 7 years ago

I tested this yesterday you can happily pass a limit of 200 in without a problem.

dev-4458 commented 7 years ago

i also checked and tested that we can pass a limit of 200 for orders API.

acking commented 7 years ago

@fillup @sandyattune I have touched the problem, if the limit is greater than 10 to throw “Fatal error: Call to a member function getStatusCode() on null in ...” i use the “$orders = $client->list([]);" and "$orders = $client->listAll([]);",Are throwing an exception.

creativegeniusod commented 7 years ago

when I pass limit 120 it showing error atal error: Call to a member function getStatusCode() on a non-object in /home/ubuntu/workspace/vendor/fillup/walmart-partner-api-sdk-php/src/Order.php on line 124