Closed qadeersahmed closed 1 year ago
Was really hoping the V2 API for orders would be replaced by now!
$client = new \BigCommerce\ApiV2\V2ApiClient( '...', '...', '...');
$orders = $client->orders()->getAll();
When there are no orders returned the following error occurs
Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /app/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php:89
Stack trace:
#0 /app/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php(89): array_map(Object(Closure), NULL)
#1 /app/test.php(10): BigCommerce\ApiV2\Api\Orders\OrdersApi->getAll()
#2 {main}
thrown in /app/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php on line 89
Will be fixed with the next release (1.10.0)
When the combination of Page and Limit is such that the response contains no "Orders" then it crashes giving NULL error. Please fix.