Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Getting 500 Response #4

Closed
raheelkhan opened this issue Oct 5, 2015 · 2 comments
Closed

Getting 500 Response #4

raheelkhan opened this issue Oct 5, 2015 · 2 comments

Comments

@raheelkhan
Copy link

I am just trying to use this sdk and following the Getting Started Guide that show code for FindItemsByKeywordsRequest

Here is the code i used:

<?php
use \DTS\eBaySDK\Finding\Services;
use \DTS\eBaySDK\Finding\Types;
use \DTS\eBaySDK\Constants;

    public function __construct($app_id)
    {
        $this->api['app_id'] = $app_id;
        $service = new Services\FindingService(array(
            'appId' => $this->api['app_id'],
            'globalId' => Constants\GlobalIds::US,
            'sandbox' => true
        ));
        // Create the API request object.
        $request = new Types\FindItemsByKeywordsRequest();
        $request->keywords = 'Harry Potter';
        $request->sortOrder = 'CurrentPriceHighest';
        $response = $service->findItemsByKeywords($request);
        dd($response);
    }

I am getting following error
Call to a member function attachment() on a non-object' in /var/www/html/myproject/vendor/dts/ebay-sdk-php/src/DTS/eBaySDK/Services/BaseService.php:186

I dig more into it and tried to see the response of the Guzzle Request on BaseService.php:177 by doing a die construct and when running the script, It opens a ebay page that says:

This page may have moved or is no longer available.

@davidtsadler
Copy link
Owner

The sandbox for the Finding API is currently not working.

http://svcs.sandbox.ebay.com/services/search/FindingService/v1

I've opened a support ticket with eBay so that they can resolve it. No word at the moment as to when this will be done.

I'll keep this issue open for the time been in case anyone else hits the same problem.

@davidtsadler
Copy link
Owner

Looks like the sandbox for the Finding API is now working.

stiivo added a commit to stiivo/ebay-sdk-php that referenced this issue Apr 28, 2017
```php
<?php
use DTS\eBaySDK\Fulfillment\Types;
use DTS\eBaySDK\Fulfillment\Services;
use DTS\eBaySDK\Fulfillment\Types\GetOrdersRestRequest;

require_once __DIR__.'/vendor/autoload.php';

$token = "token";



$service = new Services\FulfillmentService([
  'authorization' => $token
]);

$request = new GetOrdersRestRequest();

$request->filter = "creationdate:[2017-04-27T08:25:43.511Z..]";

$response = $service->getOrders($request);

file_put_contents("test.json", json_encode($response->toArray(), JSON_PRETTY_PRINT));
```

brought me this:

    PHP Fatal error:  Uncaught DTS\eBaySDK\Exceptions\UnknownPropertyException: Unknown property discountAmount in /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php:464
    Stack trace:
    #0 /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php(309): DTS\eBaySDK\Types\BaseType::ensurePropertyExists('DTS\\eBaySDK\\Typ...', 'discountAmount')
    davidtsadler#1 /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php(276): DTS\eBaySDK\Types\BaseType->set('DTS\\eBaySDK\\Typ...', 'discountAmount', Array)
    davidtsadler#2 /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php(62): DTS\eBaySDK\Types\BaseType->setValues('DTS\\eBaySDK\\Typ...', Array)
    davidtsadler#3 /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Fulfillment/Types/DeliveryCost.php(58): DTS\eBaySDK\Types\BaseType->__construct(Array)
    davidtsadler#4 /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php(676): DTS\eBaySDK\Ful in /home/steven/Schreibtisch/eBayTrackingNumber/vendor/dts/ebay-sdk-php/src/Types/BaseType.php on line 464

adding the discountAmount property manually made it work for me.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants