davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

GetOrdersRequestType with SortingOrder and Pagination #47

Closed lupi85 closed 7 years ago

lupi85 commented 8 years ago

I thing there is an error when combine OrderStatus Descending in GetOrdersRequestType and then add Pagination. The ordering of the results is correct, but in page 1 returns the older orders instead of new ones. Here is my code: $args = array( "OrderStatus" => "Completed", "OrderStatus" => "All", "SortingOrder" => "Descending", "CreateTimeFrom" => new \DateTime('2016-01-01'), "CreateTimeTo" => new \DateTime(), );

$getOrders = new Types\GetOrdersRequestType($args); $getOrders->RequesterCredentials = new Types\CustomSecurityHeaderType(); $getOrders->RequesterCredentials->eBayAuthToken = $config['production']['authToken']; $getOrders->IncludeFinalValueFee = true; $getOrders->Pagination = new Types\PaginationType(); $getOrders->Pagination->EntriesPerPage = 20; $pageNum = 1;

$getOrders->Pagination->PageNumber = $pageNum; $response = $service->getOrders($getOrders);

echo '

';
print_r($response);
echo '
';