davidtsadler / ebay-sdk-examples

Several examples of using the eBay SDK for PHP
http://devbay.net
Apache License 2.0
184 stars 100 forks source link

500 Internal Server Error issue #33

Closed patrioticcow closed 7 years ago

patrioticcow commented 7 years ago

Here is my code

require BASE_PATH . 'common/scripts/php/ebay-sdk/ebay-sdk-php-autoloader.php';

$service = new DTS\eBaySDK\Finding\Services\FindingService([
    'credentials' => [
        'appId'  => '............................',
        'devId'  => '............................',
        'certId' => '........................',
    ],
    'globalId'    => DTS\eBaySDK\Constants\GlobalIds::US
]);

try {
    $request           = new \DTS\eBaySDK\Finding\Types\FindItemsByKeywordsRequest();
    $request->keywords = 'Harry Potter';

    $response          = $service->findItemsByKeywords($request);
    var_dump($response);
} catch (Exception $e) {
    echo($e);
}

Here is the error I'm getting

exception 'GuzzleHttp\Exception\ServerException' with message 'Server error:POST https://svcs.ebay.com/services/search/FindingService/v1resulted in a500 Internal Server Errorresponse: run() #5 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick() #6 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Promise/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute(true) #7 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Promise/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn() #8 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Promise/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending() #9 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Promise/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList() #10 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/GuzzleHttp/Promise/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending() #11 /home/webdev/cristi.vehiclehistory.com/common/scripts/php/ebay-sdk/DTS/eBaySDK/Finding/Services/FindingService.php(53): GuzzleHttp\Promise\Promise->wait() #12 /home/webdev/cristi.vehiclehistory.com/backend/test.php(25): DTS\eBaySDK\Finding\Services\FindingService->findItemsByKeywords(Object(DTS\eBaySDK\Finding\Types\FindItemsByKeywordsRequest)) #13 {main}

I'm using the latest code, as of now. Any ideas?

davidtsadler commented 7 years ago

Make sure that you are using your production credentials. Sandbox and production credentials are not interchangeable and eBay sends a HTTP status of 500 if you are using the wrong ones.

patrioticcow commented 7 years ago

Thanks. Looks like If i use the Production credentials, I get pass that error.