davidtsadler / ebay-sdk-php

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

Help!! Get single order by Order ID ? #184

Closed doralb closed 6 years ago

doralb commented 6 years ago
$service = new \DTS\eBaySDK\Trading\Services\TradingService([
            'credentials' => [
                'appId' => $this->appData['EBAY_APPNAME'],
                'certId' => $this->appData['EBAY_CERTNAME'],
                'devId' => $this->appData['EBAY_DEVNAME']
            ],
            'sandbox' => $this->appData['EBAY_SANDBOX'],
            'siteId' => $siteId
        ]);

 $pst = new DateTimeZone('America/Los_Angeles');
        $createTimeFrom = new DateTime("-5 days");
        $createTimeTo = new DateTime("-2 hours");

        $request = new \DTS\eBaySDK\Trading\Types\GetOrdersRequestType();
        $request->RequesterCredentials = new \DTS\eBaySDK\Trading\Types\CustomSecurityHeaderType();
        $request->RequesterCredentials->eBayAuthToken = $token;
        $request->CreateTimeFrom = $createTimeFrom;
        $request->CreateTimeTo = $createTimeTo;
        $request->DetailLevel[] = "ReturnAll";
        $request->OrderStatus = "Cancelled";
        $request->IncludeFinalValueFee = true;
        $request->Pagination = new \DTS\eBaySDK\Trading\Types\PaginationType();
        $request->Pagination->EntriesPerPage = 15;
        $pageNum = 1;
        $ebay_order_ids = array();

This is my current code to get all cancelled order . But one order is missing on the response. Is there any way to get a single order by Order ID ?

michabbb commented 6 years ago

hi, of course ;) but i suggest to ignore all other filters when doing this (CreateTimeFrom, CreateTimeTo, OrderStatus and so on....)

the docu says

If one or more OrderID values are used, all other input filters are ignored.

but i wouldn´t use the others filters anyway in my code to avoid confusen here.

doralb commented 6 years ago

@michabbb thank you a lot! :)