davidtsadler / ebay-sdk-php Goto Github PK
View Code? Open in Web Editor NEWAn eBay SDK for PHP. Use the eBay API in your PHP projects.
License: Apache License 2.0
An eBay SDK for PHP. Use the eBay API in your PHP projects.
License: Apache License 2.0
SDK is missing the AppealRef class that relates to the ~appealRef type. This type may be missing from the WSDL.
Hi,
Im looking to use this into my laravel project.. but cant get it to work..
while we run the composer install, it is suppose to add the autoload function automatically but i guess that is not happening as im not able to use it.
may be if anyone else here is using this on laravel can point out the installation process? or any other pointer?
assuming we would need to publish the files first? and then publish configuration files? not really sure.
would really appreciate any kind of help with this.
thanks.
cheers.
and yeah happy holidays everyone! ๐
Hi,
I was wondering if it's possible to get the ad fee eBay charges when an order is placed via promoted listing?
Thanks
When i try to install with composer , i obtain this message:
php composer.phar require dts/ebay-sdk-php
Using version ^0.5.0 for dts/ebay-sdk-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package dts/ebay-sdk-php No version set (parsed as 1.0.0) could not be found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
I'm trying to use the ResolutionCaseManagement but I keep having this error
Fatal error: Class 'DTS\eBaySDK\ResolutionCaseManagement\Types\Integer' not found in C:\xampp\htdocs\ebay-sdk\src\DTS\eBaySDK\Parser\XmlParser.php on line 228
Here is my code
$request = new Types\GetActivityOptionsRequest();
$request->caseId = new Types\CaseIdType();
$request->caseId->id = '1111111111';
$request->caseId->type = 'EBP_INR
$response = $service->getActivityOptions($request);
Is the file really missing?
Thanks.
Reyn
FindPopularSearchesRequestType and FindPopularSearchesResponseType should be removed from the SDK as they belong to a call that was removed in 2014. Will need to look into changing the WSDL parser so that it does not include these classes in future.
Beta branch.
Use of undefined constant homePath - assumed 'homePath' in eBaySDK\Credentials\CredentialsProvider.php on line 170
return ($homeDrive && homePath) ? $homeDrive . $homePath : null;
should be
return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;
if($bestOfferEnabled) {
/**
* Allow buyers to submit a best offer.
*/
$item->BestOfferDetails = new Types\BestOfferDetailsType();
$item->BestOfferDetails->BestOfferEnabled = true;
/**
* Automatically accept best offers of $acceptPrice and decline offers lower than $declinePrice.
*/
$item->ListingDetails = new Types\ListingDetailsType();
$item->ListingDetails->BestOfferAutoAcceptPrice = new Types\AmountType(array('value' => $acceptPrice));
$item->ListingDetails->MinimumBestOfferPrice = new Types\AmountType(array('value' => $declinePrice));
$item->ListingDetails->MinimumBestOfferMessage = $minimumBestOfferMessage;
}
I'm trying to add MinimumBestObberMessage for my item but I can not add it. I even don't find it on ebay addItem documentation.
do you know how to add MinimumBestOfferMessage? It's there on reviseItem ebay documentation..
thank you
$item->ProductListingDetails = new Types\ProductListingDetailsType();
$item->ProductListingDetails->BrandMPN = new Types\BrandMPNType();
$item->ProductListingDetails->BrandMPN->Brand = 'AMX';
$item->ProductListingDetails->BrandMPN->MPN = '989823234';
$item->ProductListingDetails->UPC = '707152817585';
i just add this in 04-add-fixed-price-item.php.it still has this error.please help.thanks
I am using the getItem eBay api for finding the product itemSpecific from the UK store . I am getting all the itemSpeicifcs except the product EAN which is default ItemSpecific .
Here is my code :
$request = new Types\GetItemRequestType() ;
$request->RequesterCredentials = new Types\CustomSecurityHeaderType() ;
$request->RequesterCredentials->eBayAuthToken = 'MYAUTHTOKEN' ;
$request->ItemID = 'PRODUCTID';
$request->IncludeItemSpecifics = true ;
$request->IncludeItemCompatibilityList = true ;
$response = $service->getItem($request) ;
is there any other option for getting the default ItemSpecifics ?
I've found a need to convert DTS\eBaySDK\Trading\Types\OrderType to XML which can be accomplished with BaseType::toRequestXml(). However, since self::$requestXmlRootElementNames isn't set for OrderType, the XML string is missing root element name. Is it okay to change toXml() from private to public, so that I can use toXml() and set the root element name myself, or is there another function that accomplishes this?
Or update toXml() so that it uses for example the class name if $elementName is empty?
When making a LMS active inventory (download) request, I get this issue:
<? xml version="1.0" encoding="utf-8"?>
<BulkDataExchangeResponses xmlns="urn:ebay:apis:eBLBaseComponents">
<ActiveInventoryReport>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Could not get item information right now,Please try again</ShortMessage>
<LongMessage>ItemIds: [XXXX, XXXX]</LongMessage>
<ErrorCode>1008</ErrorCode>
<SeverityCode>LMS.ERROR</SeverityCode>
<ErrorClassification>ParsingError</ErrorClassification>
</Errors>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>LMS Internal Error</ShortMessage>
<LongMessage>LMS Internal Error</LongMessage>
<ErrorCode>1008</ErrorCode>
<SeverityCode>LMS.ERROR</SeverityCode>
<ErrorClassification>InternalError</ErrorClassification>
</Errors>
</ActiveInventoryReport>
</BulkDataExchangeResponses>
Is this a sandbox issue? Or an error on my part? The code is from the ebay-sdk-examples repository with nothing changed.
Sometimes it returns successfully but with no items in the inventory report.
How to authorize ebay merchant account with the App and generate token for that account to access the order history of the authorized user?
I have try below code to change quantity as 0
`$service = new Services\TradingService(array(
'authToken' => $authToken,
'apiVersion' => '899',
'siteId' => $siteID
));
$request = new Types\ReviseInventoryStatusRequestType();
$inventoryStatus = new Types\InventoryStatusType();
$inventoryStatus->ItemID = $itemID;
$inventoryStatus->Quantity = $quantity;
$request->InventoryStatus[] = $inventoryStatus;
$request->ErrorLanguage = 'en_US';
$request->WarningLevel = 'High';
$response = $service->reviseInventoryStatus($request);`
but I get fail from ebay
eBay Fail: Quantity is not valid.The quantity must be a valid number greater than 0
I want to change as 0 so end item on ebay
Any help?
Create a new httpOptions
configuration option. This will be an array of options that will be passed to the HTTP client. The SDK will support the following options.
use DTS\eBaySDK\Finding\Services\FindingService;
$service = new FindingService([
'apiVersion' => '1.13.0',
'globalId' => 'EBAY-US',
'httpOptions' => [
'connect_timeout' => 1.5,
'debug' => true
]
]);
It seems that some array properties, for example DetailLevel, are not been included in the generated API documentation. E.g AbstractRequestType is missing several. Not sure if an issue with apigen or how I've documented magic array properties.
A 503 API call produce a fatal error:
[17-Nov-2015 22:10:32 Europe/Berlin] PHP Fatal error: Uncaught exception 'Guzzle\Http\Exception\ServerErrorResponseException' with message 'Server error response [status code] 503 [reason phrase] Service Unavailable [url] https://api.ebay.com/ws/api.dll' in /etc/cudgelmiddleware/code/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43 Stack trace: #0 /etc/cudgelmiddleware/code/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) #1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #2 /etc/cudgelmiddleware/code/vendor/symfony/event-dispatcher/EventDispatcher.php(158): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #3 /etc/cudgelmiddleware/code/vendor/symfony/event-dispatcher/EventDispatcher.php( in /etc/cudgelmiddleware/code/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php on line 43
Best practise to catch this? ty very much!
Look at improving the serialization of the SDK.
One possible solution is for the SDK to implement the Serializable interface
Another solution is to improve the passing of property values via the constructor. At the moment it is possible to do the following.
$item->Variations->Variation[] = new Types\VariationType(array(
'SKU' => 'TS-W-S',
'Quantity' => 5,
'StartPrice' => new Types\AmountType(array('value' => 10.99)),
'VariationSpecifics' => array(new Types\NameValueListArrayType(array(
'NameValueList' => array(
new Types\NameValueListType(array('Name' => 'Color', 'Value' => array('White'))),
new Types\NameValueListType(array('Name' => "Size (Men's)", 'Value' => array('S')))
)
)))
));
However the above method involves constructing objects before passing them via the array. An improvement would be to also allow the following.
$item->Variations->Variation[] = new Types\VariationType(array(
'SKU' => 'TS-W-S',
'Quantity' => 5,
'StartPrice' => array('value' => 10.99),
'VariationSpecifics' => array((array(
'NameValueList' => array(
array('Name' => 'Color', 'Value' => array('White')),
array('Name' => "Size (Men's)", 'Value' => array('S'))
)
)))
));
This solution could allow the usage shown below when calling the toArray method.
if (Cache::has($key)) {
// Create a new instance and populates its properties with values from the cache.
$results = new FindItemsAdvancedResponse(Cache::get($key));
return $results;
}
$results = $service->findItemsAdvanced($this->request);
// Cache the values of the response object.
// toArray returns an assoicated array of the response object properties.
Cache::put($key,$results->toArray(),24*60);
DEPRECATED: http://developer.ebay.com/DevZone/resolution-case-management/CallRef/getUserCases.html
Note: The Resolution Case Management API is no longer recommended. Instead, current users of the Resolution Case Management API should make plans to migrate to, and use the Return, Inquiry, and Case Management operations of the Post-Order API. New users interested is programmatically managing and resolving Item Not Received (INR) and Return/SNAD (Significantly Not as Described) cases, should also make plans to integrate with the Post-Order API. Since the Resolution Case Management API was first released, there have been many changes made to post-order flows, and Resolution Case Management API does not support all features and logic of the new flows. This API will be deprecated in the near future.
NEW: http://developer.ebay.com/Devzone/post-order/concepts/UsageGuide.html
I was trying to post fixed item on Ebay
My code is bellow
$request = new Types\AddFixedPriceItemRequestType();
$item = new Types\ItemType();
$item->ProductListingDetails = new Types\ProductListingDetailsType();
$item->ProductListingDetails->BrandMPN = new Types\BrandMPNType();
$item->ProductListingDetails->BrandMPN->Brand = "Dell";
$item->ProductListingDetails->BrandMPN->MPN = "MyProductMPN";
$item->ProductListingDetails->EAN = "ProductEAN";
.....
$request->Item = $item;
$this->service->addFixedPriceItem($request);
When item was posted on ebay, I can't see MPN, Brand and EAN
What is my wrong
Please help me
@davidtsadler What are you using to generate the classes from the Ebay XSDs?
Or rather, what do you recommend we use if we want to test different version of the Ebay API?
When fetching orders or a single order, while other details are coming but ShipmentTrackingDetails is empty. I made sure the orders were shipped. Is there a way i can be sure if its because of the api or this library
Thanks
I'm trying to update shipping tracking details by calling completeSale.
My complete request:
<?xml version="1.0" encoding="UTF-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<MessageID>2015-10-27 07:36:49</MessageID>
<Shipment xmlns="urn:ebay:apis:eBLBaseComponents">
<ShipmentTrackingDetails xmlns="urn:ebay:apis:eBLBaseComponents"><ShippingCarrierUsed>000-test-000</ShippingCarrierUsed>
<ShipmentTrackingNumber>AMAZON</ShipmentTrackingNumber></ShipmentTrackingDetails></Shipment>
<OrderID>251865599336-1734899421015</OrderID>
</CompleteSaleRequest>
Array
(
[MessageID] => 2015-10-27 07:36:49
[Shipment] => Array
(
[ShipmentTrackingDetails] => Array
(
[0] => Array
(
[ShippingCarrierUsed] => 000-test-000
[ShipmentTrackingNumber] => AMAZON
)
)
)
[OrderID] => 251865599336-1734899421015
)
Error: Tracking number(s) already exists.
One (or more) tracking number(s) in the request already exists either for a different buyer or for a different seller.
PHP code that generate above:
$ship = new Types\ShipmentTrackingDetailsType();
$ship->ShipmentTrackingNumber = $carrier;
$ship->ShippingCarrierUsed = $tracking_no;
$shipDetails = array($ship);
$request = new Types\CompleteSaleRequestType();
$request->OrderID = $order_id;
$request->Shipment = new Types\ShipmentType();
$request->Shipment->ShipmentTrackingDetails = $shipDetails;
$request->MessageID = date('Y-m-d H:i:s');
Ebay API Test Tool code (that works every time)
<Shipment>
<ShipmentTrackingDetails>
<ShipmentTrackingNumber>000-test-000</ShipmentTrackingNumber>
<ShippingCarrierUsed>AMAZON</ShippingCarrierUsed>
</ShipmentTrackingDetails>
</Shipment>
First, I don't understand why have xmlns in it. Could be the reason this is breaking the request. Probably I'm doing something wrong in my PHP.
Please tell me why there's a xmlns and if I'm using the class in the wrong way guide me.
Many thanks.
Hello I have a problem, need somehow to fix this.
I request ebay to give me all orders which are Completed & Paid.
I do this:
$request = new Types\GetMyeBaySellingRequestType();
$args = array(
"OrderStatus" => "Completed",
"SortingOrder" => "Ascending",
"CreateTimeFrom" => new \DateTime(date("Y-m-d", time()-60*60*24*30*3)),
"CreateTimeTo" => new \DateTime(date("Y-m-d", time()+60*60*24)),
);
$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 = 9999999;
$getOrdersPageNum = 1;
$response = $service->getOrders($getOrders);
But today I got one order, which have a status checkout Completed, but not paid, it says the "buyer will contact you to pay with credit card."
But I already sent the item to him, but he still not paid me. So How can I tell ebay to list me orders which are 100% paid ?
thanks
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 '
How can I retrieve the detail field?
The property detailLevel doesn't exists anymore. How can I do this?
Thanks and great job with the sdk!
Any example how to use InternationalRateTable ? did this sdk support it ?
Hi, I am looking for a way to get all sold items list from my seller account. Please help me out in this or give me any reference to the appropriate example. Thanks
$request = new Types\FindItemsAdvancedRequest();
$request->itemFilter->name = 'Seller';
$request->itemFilter->value = $seller_ID;
^ should be enough to return all sellers items but get this result "Error: Keyword or category ID are required."
according to this page:
http://developer.ebay.com/devzone/finding/callref/types/FindItemsAdvancedRequest.html#itemFilter
under categoryID it should work because the seller item filter is the exception for needing a keyword or category.
When using BulkDataExchange (and maybe other calls),
everything is fine using jobs types with first letter >H.
But when using EndFixedPriceItem for example, the generated XML is :
<BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">
<EndFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>871</Version>
<ItemID>181741470745</ItemID>
</EndFixedPriceItemRequest>
<Header xmlns="urn:ebay:apis:eBLBaseComponents">
<SiteID>71</SiteID>
<Version>871</Version>
</Header>
</BulkDataExchangeRequests>
The tags inside BulkDataExchangeRequests are sorted A-Z and this XML causes an error for eBay, , it needs Header first.
The error is :
Uploading end fixed price item requests...Done
Request processing of end fixed price item...Done
Error: There is failure during file upload and post-upload checking
I guess putting Header first in the method ($payload->toRequestXml()) would fix it.
When fixing via regex the generated xml, it works ๐
<BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents">
<Header xmlns="urn:ebay:apis:eBLBaseComponents">
<SiteID>71</SiteID>
<Version>871</Version>
</Header>
<EndFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>871</Version>
<ItemID>181741470745</ItemID>
</EndFixedPriceItemRequest>
</BulkDataExchangeRequests>
This class extended from \DTS\eBaySDK\Types\DecimalType
, but DecimalType
expects value as integer type
class DecimalType extends \DTS\eBaySDK\Types\BaseType
{
/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = array(
'value' => array(
'type' => 'integer',
'unbound' => false,
'attribute' => false
)
);
How can i assign double data to MeasureType? For instance, i have package with dimensions
4,55x1,25x0,5 inches
p.s.
if just change there integer
to double
it will cause issue when call DTS\eBaySDK\Trading\Services\TradingService::getOrders()
Error is:
Invalid property type: DTS\eBaySDK\Trading\Types\MeasureType::value expected double, got integer in file /var/www/html/vendor/dts/ebay-sdk-php/src/DTS/eBaySDK/Types/BaseType.php on line 463
Look at adding asynchronous support to the SDK. This can be done by implementing an Async version of each of the service operations. For example,
// Synchronous request.
$response = $service->getSingleItem($request);
$item = $result->Item;
print("$item->Title\n");
// Asynchronous request.
$response = $service->getSingleItemAsync($request);
$response->then(function ($result) {
$item = $result->Item;
print("$item->Title\n");
})->otherwise(function ($reason) {
echo 'Encountered an error: ' . $reason->getMessage();
});
Would it be possible to add a constant to each service which holds the current supported API version.
Like so.
e.g
class TradingBaseService extends \DTS\eBaySDK\Services\BaseService
{
/**
* Constants for the various HTTP headers required by the API.
*/
const API_VERSION = 947;
const HDR_API_VERSION = 'X-EBAY-API-COMPATIBILITY-LEVEL';
Then if an apiVersion is required but not supplied then the constant can be used
if ($this->getConfig('apiVersion')) {
$headers[self::HDR_API_VERSION] = $this->getConfig('apiVersion');
} else {
$headers[self::HDR_API_VERSION] = self::API_VERSION;
}
I'm using eBaySDK but I'm getting error to import to Laravel.
I'm using:
use \DTS\eBaySDK\Constants;
use \DTS\eBaySDK\Trading\Services;
use \DTS\eBaySDK\Trading\Types;
use \DTS\eBaySDK\Trading\Enums;
and:
$this->tradingService = new Services\TradingService(array(
'appId' => $this->appId,
'siteId' => $this->siteId,
'sandbox' => $this->sandbox,
'apiVersion' => $this->apiVersion,
'certId' => $this->certId,
'devId' => $this->devId
));
But I'm getting this error:
Fatal error: Class 'DTS\eBaySDK\Trading\Services\TradingService' not found in app/controllers/MarketplaceImportEBayController.php on line 46
It was working fine and stopped to works..
Any ideas?
How to set a notification?
Returns:
Class 'SetNotificationPreferencesRequest' not found
code:
<?php
require 'vendor/autoload.php';
use \DTS\eBaySDK\Trading\Services;
use \DTS\eBaySDK\Trading\Types;
$service = new Services\TradingService([
'authToken' => '',
'credentials' => [
'appId' => '',
'certId' => '',
'devId' => ''
],
'siteId' => 0
]);
/**
* Fill out $request according to your project needs.
*/
$request = new Types\SetNotificationPreferencesRequest();
$request->UserDeliveryPreferenceArray = new Types\NotificationEnableArrayType();
$notification = new Types\NotificationEnableType();
$notification->EventEnable = 'Enable';
$notification->EventType = 'FixedPriceTransaction';
$request->UserDeliveryPreferenceArray->NotificationEnable[] = $notification;
/**
* Handle response according to your project needs.
*/
$response = $service->SetNotificationPreferences($request);
if ($response->Ack !== 'Failure') {
die("faIl");
}
die("done");
I didn't like batch processing of shipping ids, so i used the CompleteSale Request.
The request performs without errors but didn't update the Shipping ID and Carrier Used, only shipping time
Code used:
$shipmentType = new TradingTypes\ShipmentType();
$shipmentTrackingDetails = new TradingTypes\ShipmentTrackingDetailsType();
$shipmentTrackingDetails->ShippingCarrierUsed = $PseudoEbayShippingCarrierCode;
$shipmentTrackingDetails->ShipmentTrackingNumber = $PseudoShippingId;
$shipmentType->ShipmentTrackingDetails = $shipmentTrackingDetails;
will throw an error ("Unbound Type expected"). I have no understanding of the underlying logic behind this, but i changed "ShipmentTrackingDetails" unbound = true in ShipmentType.php to unbound = false.
Now everything works as expected!
Thank you so much for your great work!
Even samples does not work, requires crdentials ini file. I store credentials in the database so do not use ini files.
Work is now in progress on the version 1.0.0 release of the SDK. This is been be done on the 1.0.0-beta branch. Version 1.0.0 is due for release in January 2016. Until then you should consider the 1.0.0-beta branch unsuitable for production. You can try out the latest changes by using composer.
php composer.phar require dts/ebay-sdk-php:dev-1.0.0-beta
Below are some of the things that I hope to include in the release. If you have any feedback or would like to suggest a new feature then please use the comments.
The SDK will require a minimum PHP version of 5.5.
Since Guzzle 3 will reach its end of life sometime in 2015 the SDK will use the latest Guzzle 6 version instead.
Currently you have to convert HTML characters to entities.
$item->Description = '<h1>Bits & Bobs</h1><p>Just some <stuff> I found.</p>';
In future the SDK will handle this for you.
$item->Description = '<h1>Bits & Bobs</h1><p>Just some <stuff> I found.</p>';
Currently you can debug a service via the logger method.
$logger = new LogClass();
$service = new DTS\eBaySDK\Shopping\Services\ShoppingService([
'debug' => true
]);
$service->logger($logger);
The logger method will be replaced by a configuration option.
$service = new DTS\eBaySDK\Shopping\Services\ShoppingService([
'debug' => true,
'logger' => new LogClass()
]);
The appId, authToken, certId and devId configuration options will passed via a new credentials option.
$service = new DTS\eBaySDK\Trading\Services\TradingService([
'credentials' => [
'appId' => 'APP_ID',
'authToken' 'AUTH_TOKEN',
'certId' => 'CERT_ID',
'devId' => 'DEV_ID'
]
]);
A new Sdk class will be introduced that will allow the sharing of configuration options across multiple service objects. The class will be a factory that produces service objects via its methods. The service objects returned from these methods will be configured with the options that were passed when the Sdk object was instantiated.
$sdk = new DTS\eBaySDK\Sdk([
'apiVersion' => '999',
'credentials' => [
'appId' => 'ABCDE-12345'
]
]);
// Both services will be configured with the same apiVersion and credentials.
$finding = $sdk->createFinding();
$trading = $sdk->createTrading();
You will still be able to instantiate a service object without the Sdk class.
$shopping = new DTS\eBaySDK\Shopping\Services\ShoppingService([
'apiVersion' => '111',
'credentials' => [
'appId' => 'FGHIJ-67890'
]
]);
If you do not supply any credentials to a service object the SDK will attempt to find the credentials in your environment. It will look for values stored in the EBAY_SDK_APP_ID, EBAY_SDK_AUTH_TOKEN, EBAY_SDK_CERT_ID and EBAY_SDK_DEV_ID environment variables.
// No credentials passed so the SDK will look them up via the environment variables.
$shopping = new DTS\eBaySDK\Shopping\Services\ShoppingService();
A new global SDK option will be added that will relax the type checking used when assigning values to properties. By default the sdk will continue to use strict type checking.
// Relax type checking.
DTS\eBaySDK\Sdk::STRICT_TYPE_CHECKING = false;
// Property expects an integer but is passed a string.
// No exception is thrown when type checking has been relaxed.
$item->Quantity = '99';
Even when type checking is relaxed the SDK will still type check properties that expect an object to be assigned to it.
// This will throw an exception
$item->StartPrice = '8.99';
// Will still have to assign an object to the property.
$item->StartPrice = new Types\AmountType(['value' => '8.99']);
DTS\eBaySDK\Trading\Types\NameValueListType Object
(
[values:DTS\eBaySDK\Types\BaseType:private] => Array
(
[Name] => Im the Name of VariationSpecific[0]
[Value] => DTS\eBaySDK\Types\RepeatableType Object
(
[data:DTS\eBaySDK\Types\RepeatableType:private] => Array
(
[0] => Im the value to the name of VariationSpecific[0] i might stay alone, forever
)
[position:DTS\eBaySDK\Types\RepeatableType:private] => 0
[class:DTS\eBaySDK\Types\RepeatableType:private] => DTS\eBaySDK\Trading\Types\NameValueListType
[property:DTS\eBaySDK\Types\RepeatableType:private] => Value
[expectedType:DTS\eBaySDK\Types\RepeatableType:private] => string
)
)
[attachment:DTS\eBaySDK\Types\BaseType:private] => Array
(
[data] =>
[mimeType] =>
)
)
Im wondering if this behaviour is intended (and i just dont get why) or is it a mistake? Why should Value be an array and Name a string? The seperation of multiple Variationspecifics is happening before this right?
Version: 5.0
Thank you David for the surely huge amount of time you put in this project.
EDIT: Please close this issue, im an idiot.
Related: http://devbay.net/sdk/guides/guide/request-and-response-objects.html#repeatable-fields-as-arrays
Hey
I try to get the Order Transaction but end up in this Exception:
Fatal error: Uncaught exception 'DTS\eBaySDK\Exceptions\UnknownPropertyException' with message 'Unknown property: DTS\eBaySDK\Trading\Types\OrderIDArrayType::0'
My Code Sample:
$orderIDs = array( '111111115645-22222222001');
$array = array( 'OrderIDArray' => $orderIDs );
$request = new Types\GetOrderTransactionsRequestType( $array );
$response = $service->getOrderTransactions($request);
var_dump( $response );
Same Error:
$orderIDs = array( '111111115645');
Any Solution?
THX
Hi I got this error when installed the ebay-sdk-php. Can I ignore it?
Error:
guzzle/guzzle suggests installing guzzlehttp/guzzle (Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated.)
How to reproduce:
composer require dts/ebay-sdk-php
composer version: 1.0-dev
php versionn: PHP 5.5.9
File: src/MerchantData/Types/SellerPaymentProfileType.php
When we have bigint value for payment profile ID it does not works .. either we should type cast as string or long
'PaymentProfileID' => [
'type' => 'integer',
'repeatable' => false,
'attribute' => false,
'elementName' => 'PaymentProfileID'
],
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.
Thank you for this amazing SDK. It's really great and a joy to work with!
I've created a script that submits a fixed price item to eBay. It works fine on my dev machine (which is running good-old WAMP), but errors on my production machine (Ubuntu LAMP setup). However, even though it errors on the production machine, the listing still makes it to eBay, which is at least promising.
The error occurs as a result of this line
$response = $service->addFixedPriceItem($request);
The error itself is:
Error: Call to a member function attachment() on a non-object (line 160 of /var/www/html/vendor/dts/ebay-sdk-php/src/Services/BaseService.php)
The following Issue had a similar problem, but I don't think they are entirely related? #4
Although this is not a bug or an issue with either eBay or this SDK, I think the following 'gotchas' may be worth noting in the documentation somewhere.
With eBay's sandbox, there doesn't seem to be a listing size limit, or at least it's a lot higher than 90K. Googling for eBay's listing size limit doesn't yield any results, but I think it's ~90K, which I read somewhere that escapes me. So, if you plan on using something like Bootstrap and inlining it in your listing, you'll surpass this limit. Instead, bring it in via <link>
.
If you surpass the limit, eBay's error doesn't indicate that it's a filesize limit (!), so it may leave you perplexed in determining where the issue is.
With eBay's sandbox, you can list your email address and phone number, but you cannot with production.
If all Enum properties have the "propertytNameCodeType" class e.g.
ItemType $BuyerProtection maps to BuyerProtectionCodeType
then an alternative type checking method would allow for better distinction between an actual "string" type and an "string enum" type which would make it easier to check whether the provided value was valid.
If all \DTS\eBaySDK\ {service} \Enums{ .......CodeType} class Constants are ALL strings then the method is even tidier.
Heres the change
ConfigurationResolver
/** @var array Map of type to function that confirms type. */
private static $typeMap = [
'enum' => 'is_string'
ItemType
* @property \DTS\eBaySDK\Trading\Enums\BuyerProtectionCodeType $BuyerProtection
....
// From
'BuyerProtection' => array(
'type' => 'string',
// To
'BuyerProtection' => array(
'type' => 'enum',
If the Constants type differs then a much uglier solution could be used
private static $typeMap = [
'enum_string' => 'is_string',
'enum_bool' => 'is_bool'
'BuyerProtection' => array(
'type' => 'enum_string',
WHY?
I'm using if for form validation and automation.
I've been using this snippet of code to get some details about different class properties.
$class_name = "\DTS\\eBaySDK\Trading\Types\\" . $type . "Type";
$reflectionClass = new \ReflectionClass($class_name);
$staticProperties = $reflectionClass->getStaticProperties();
$properties = (isset($staticProperties['properties'][$class_name]) ? $staticProperties['properties'][$class_name] : $staticProperties['propertyTypes'];
foreach($properties as $property){
if($property['type'] == 'string'){
$field['type'] = 'textbox';
if(!empty($property]['unbound'])){
// array allowed multiple fields
} else {
// single field
}
}
....
// but the change would allow for something like
if($property['type'] == 'enum'){
$field['type'] = 'select';
if(!empty($property]['unbound'])){
// array allowed multiple fields e.g. (payment methods)
} else {
// single field
}
$reflectionClass = new \ReflectionClass("\DTS\\eBaySDK\Trading\Enums\\" . $property[''elementName'] . "CodeType");
$field['options'] = $reflectionClass->getConstants(); //key =>value pair
}
...
$fields [] = $field;
}
It would allow you to grab the constants to use as the options of a select element dynamically and the checkType method could check that the $provided value is valid by checking against the classes constants.
Whatever the outcome of this, I really think there should be a way of finding out the actual class of a enum property.
Here is the code
$sdk = new DTS\eBaySDK\Sdk([
'apiVersion' => '1.13.0',
'Finding' => [
'apiVersion' => '1.13.0'
],
'credentials' => [
'appId' => '<my-key>',
'devId' => '<my-key>',
'certId' => '<my-key>'
]
]);
$finding = $sdk->createFinding();
$request = new FindItemsByKeywordsRequest();
$request->keywords = 'Harry Potter';
$request->paginationInput = new PaginationInput();
$request->paginationInput->entriesPerPage = 25;
$request->paginationInput->pageNumber = 1;
$request->sortOrder = 'CurrentPriceHighest';
try {
$response = $finding->findItemsByKeywords($request);
} catch (Exception $e) {
var_dump($e->getMessage());
}
I get this error message... truncated.
Server error: POST http://svcs.ebay.com/services/search/FindingService/v1 resulted in a 500 Internal Server Error response:\n
I followed the example on getting started which gets the time from the API, which worked. However, this is giving me some issues. What am I doing wrong here?
Note: I dumped the $body variable in
callOperationAsync()
and got this:1 25 CurrentPriceHighest Harry Potter
Shouldn't this be in XML format?
eBay is adding TLS1.2 support to API endpoints. See this https://ebaydts.com/eBayKBDetails?KBid=5073
This is not a bug, I did not check. But I would like to know - whether there is support TLS1.2 ?
Hello,
Thanks for the great SDK
Recently, we are getting too many curl error
Couldn't resolve host 'api.ebay.com' [url] https://api.ebay.com/ws/api.dll'
before was everything is ok, it was very rare, but now we are getting it a lot
how we could solve such issue?
thanks again
Hi,
FIRST OF ALL ---- THANK YOU DAVID!
I am using JMS seriallizer with DTS eBay SDK.
I am getting a simple error of
`[Semantical Error] The annotation "@returns" in method DTS\eBaySDK\Types\RepeatableType::offsetExists() was never imported. Did you maybe forget to add a "use" statement for this annotation?
This can be easily fixed by changing @returns to @return.. I found it problematic in dts/ebay-sdk-php/src/Types/RepeatableType.php
and in dts/ebay-sdk-php/src/Types/BaseType.php
but also found it in dts/ebay-sdk-php/src/Parser/XmlParser.php
..
Please change it in your next update, as this is creating an error generated by Doctrine..
Stack Trace:
[1] Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@returns" in method DTS\eBaySDK\Types\RepeatableType::offsetExists() was never imported. Did you maybe forget to add a "use" statement for this annotation?
at n/a
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php line 54
at Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation "@returns" in method DTS\eBaySDK\Types\RepeatableType::offsetExists() was never imported. Did you maybe forget to add a "use" statement for this annotation?')
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php line 703
at Doctrine\Common\Annotations\DocParser->Annotation()
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php line 641
at Doctrine\Common\Annotations\DocParser->Annotations()
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php line 334
at Doctrine\Common\Annotations\DocParser->parse('/**
* Determines if the offset exists in the array.
*
* @param integer $offset The array index to check.
*
* @returns boolean Returns if the offset exists in the array.
*/', 'method DTS\eBaySDK\Types\RepeatableType::offsetExists()')
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationReader.php line 257
at Doctrine\Common\Annotations\AnnotationReader->getMethodAnnotations(object(ReflectionMethod))
in C:\wamp\www\DropShipMe\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\CachedReader.php line 151
at Doctrine\Common\Annotations\CachedReader->getMethodAnnotations(object(ReflectionMethod))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\Metadata\Driver\AnnotationDriver.php line 110
at JMS\Serializer\Metadata\Driver\AnnotationDriver->loadMetadataForClass(object(ReflectionClass))
in C:\wamp\www\DropShipMe\vendor\jms\metadata\src\Metadata\Driver\DriverChain.php line 38
at Metadata\Driver\DriverChain->loadMetadataForClass(object(ReflectionClass))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\Metadata\Driver\AbstractDoctrineTypeDriver.php line 80
at JMS\Serializer\Metadata\Driver\AbstractDoctrineTypeDriver->loadMetadataForClass(object(ReflectionClass))
in C:\wamp\www\DropShipMe\vendor\jms\metadata\src\Metadata\Driver\LazyLoadingDriver.php line 23
at Metadata\Driver\LazyLoadingDriver->loadMetadataForClass(object(ReflectionClass))
in C:\wamp\www\DropShipMe\vendor\jms\metadata\src\Metadata\MetadataFactory.php line 103
at Metadata\MetadataFactory->getMetadataForClass('DTS\eBaySDK\Types\RepeatableType')
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GraphNavigator.php line 188
at JMS\Serializer\GraphNavigator->accept(object(RepeatableType), null, object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GenericSerializationVisitor.php line 140
at JMS\Serializer\GenericSerializationVisitor->visitProperty(object(PropertyMetadata), object(ProductDetails), object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GraphNavigator.php line 235
at JMS\Serializer\GraphNavigator->accept(object(ProductDetails), null, object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GenericSerializationVisitor.php line 140
at JMS\Serializer\GenericSerializationVisitor->visitProperty(object(PropertyMetadata), object(Product), object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GraphNavigator.php line 235
at JMS\Serializer\GraphNavigator->accept(object(Product), null, object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GenericSerializationVisitor.php line 102
at JMS\Serializer\GenericSerializationVisitor->visitArray(array('data' => object(Product)), array('name' => 'array', 'params' => array()), object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\JsonSerializationVisitor.php line 55
at JMS\Serializer\JsonSerializationVisitor->visitArray(array('data' => object(Product)), array('name' => 'array', 'params' => array()), object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\GraphNavigator.php line 129
at JMS\Serializer\GraphNavigator->accept(array('data' => object(Product)), null, object(SerializationContext))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\Serializer.php line 176
at JMS\Serializer\Serializer->visit(object(JsonSerializationVisitor), object(SerializationContext), array('data' => object(Product)), 'json')
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\Serializer.php line 82
at JMS\Serializer\Serializer->JMS\Serializer\{closure}(object(JsonSerializationVisitor))
in line
at call_user_func(object(Closure), object(JsonSerializationVisitor))
in C:\wamp\www\DropShipMe\vendor\phpoption\phpoption\src\PhpOption\Some.php line 89
at PhpOption\Some->map(object(Closure))
in C:\wamp\www\DropShipMe\vendor\jms\serializer\src\JMS\Serializer\Serializer.php line 85
at JMS\Serializer\Serializer->serialize(array('data' => object(Product)), 'json')
in C:\wamp\www\DropShipMe\src\ApiBundle\Controller\GrabberController.php line 87
at ApiBundle\Controller\GrabberController->getProductAction(object(Request), 'ebay', '401074807466')
in line
at call_user_func_array(array(object(GrabberController), 'getProductAction'), array(object(Request), 'ebay', '401074807466'))
in C:\wamp\www\DropShipMe\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php line 148
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
in C:\wamp\www\DropShipMe\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php line 66
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
in C:\wamp\www\DropShipMe\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php line 169
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
in C:\wamp\www\DropShipMe\web\app_dev.php line 31
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.