Exemplo n.º 1
0
 /**
  * @param array $config Optional configuration option values.
  * @param \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient The object that will handle sending requests to the API.
  */
 public function __construct($config = array(), \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient = null)
 {
     if (!array_key_exists(get_called_class(), self::$configOptions)) {
         self::$configOptions[get_called_class()] = array('affiliateUserId' => array('required' => false), 'apiVersion' => array('required' => true), 'appId' => array('required' => true), 'siteId' => array('required' => false), 'trackingId' => array('required' => false), 'trackingPartnerCode' => array('required' => false));
     }
     parent::__construct('http://open.api.ebay.com/shopping', 'http://open.api.sandbox.ebay.com/shopping', $config, $httpClient);
 }
 /**
  * @param array $config Optional configuration option values.
  * @param \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient The object that will handle sending requests to the API.
  */
 public function __construct($config = array(), \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient = null)
 {
     if (!array_key_exists(get_called_class(), self::$configOptions)) {
         self::$configOptions[get_called_class()] = array('apiVersion' => array('required' => false), 'authToken' => array('required' => true));
     }
     parent::__construct('https://webservices.ebay.com/BulkDataExchangeService', 'https://webservices.sandbox.ebay.com/BulkDataExchangeService', $config, $httpClient);
 }
 /**
  * @param array $config Optional configuration option values.
  * @param \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient The object that will handle sending requests to the API.
  */
 public function __construct($config = array(), \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient = null)
 {
     if (!array_key_exists(get_called_class(), self::$configOptions)) {
         self::$configOptions[get_called_class()] = array('apiVersion' => array('required' => false), 'authToken' => array('required' => true), 'globalId' => array('required' => true));
     }
     parent::__construct('https://svcs.ebay.com/services/selling/v1/SellerProfilesManagementService', 'http://svcs.sandbox.ebay.com/services/selling/v1/SellerProfilesManagementService', $config, $httpClient);
 }
Exemplo n.º 4
0
 public function __construct($config = array(), \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient = null)
 {
     if (!array_key_exists(get_called_class(), self::$configOptions)) {
         self::$configOptions[get_called_class()] = array('foo' => array('required' => false), 'bish' => array('required' => false), 'bash' => array('required' => false), 'bosh' => array('required' => false));
     }
     parent::__construct('http://production.com', 'http://sandbox.com', $config, $httpClient);
 }
 /**
  * @param array $config Optional configuration option values.
  * @param \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient The object that will handle sending requests to the API.
  */
 public function __construct($config = array(), \DTS\eBaySDK\Interfaces\HttpClientInterface $httpClient = null)
 {
     if (!array_key_exists(get_called_class(), self::$configOptions)) {
         self::$configOptions[get_called_class()] = array('apiVersion' => array('required' => false), 'appId' => array('required' => true), 'globalId' => array('required' => false));
     }
     parent::__construct('https://svcs.ebay.com/services/half/HalfFindingService/v1', 'http://svcs.ebay.com/services/half/HalfFindingService/v1', $config, $httpClient);
 }
 /**
  * Sends an API request.
  *
  * This method overrides the parent so that it can modify
  * the request object before is handled by the parent class.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     /**
        Modify the request object to include the auth token that was set up in the configuration.
     */
     if ($this->config('authToken') !== null) {
         /**
            Don't modify a request if the token already exists.
         */
         if (!isset($request->RequesterCredentials)) {
             $request->RequesterCredentials = new \DTS\eBaySDK\Trading\Types\CustomSecurityHeaderType();
         }
         if (!isset($request->RequesterCredentials->eBayAuthToken)) {
             $request->RequesterCredentials->eBayAuthToken = $this->config('authToken');
         }
     }
     return parent::callOperation($name, $request, $responseClass);
 }
 /**
  * Sends an API request.
  *
  * This method overrides the parent so that it can modify
  * the request object before is handled by the parent class.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     /**
        Modify the request object to add xop:Include element.
     */
     if ($name === 'uploadFile' && $request->hasAttachment()) {
         /**
            Don't modify a request if the file attachment already exists.
         */
         if (!isset($request->fileAttachment)) {
             $request->fileAttachment = new \DTS\eBaySDK\FileTransfer\Types\FileAttachment();
         }
         if (!isset($request->fileAttachment->Data)) {
             $request->fileAttachment->Data = new \DTS\eBaySDK\FileTransfer\Types\Data(['xopInclude' => new \DTS\eBaySDK\FileTransfer\Types\XopInclude(['href' => 'cid:attachment.bin@devbay.net'])]);
         }
         if (!isset($request->fileAttachment->Size)) {
             $attachment = $request->attachment();
             $request->fileAttachment->Size = strlen($attachment['data']);
         }
     }
     return parent::callOperation($name, $request, $responseClass);
 }
 /**
  * Sends an API request.
  *
  * This method overrides the parent so that it can modify
  * the request object before is handled by the parent class.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     /**
        Modify the request object to add xop:Include element.
     */
     if ($name === 'uploadFile' && $request->hasAttachment()) {
         /**
            Don't modify a request if the file attachment already exists.
         */
         if (!isset($request->fileAttachment)) {
             $request->fileAttachment = new \DTS\eBaySDK\FileTransfer\Types\FileAttachment();
         }
         if (!isset($request->fileAttachment->Data)) {
             $request->fileAttachment->Data = '<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:attachment.bin@devbay.net"/>';
         }
         if (!isset($request->fileAttachment->Size)) {
             $attachment = $request->attachment();
             $request->fileAttachment->Size = strlen($attachment['data']);
         }
     }
     return parent::callOperation($name, $request, $responseClass);
 }
 public static function getConfigDefinitions()
 {
     $definitions = parent::getConfigDefinitions();
     return $definitions + ['affiliateUserId' => ['valid' => ['string']], 'apiVersion' => ['valid' => ['string'], 'default' => \DTS\eBaySDK\Shopping\Services\ShoppingService::API_VERSION, 'required' => true], 'siteId' => ['valid' => ['int', 'string']], 'trackingId' => ['valid' => ['string']], 'trackingPartnerCode' => ['valid' => ['string']]];
 }
 public static function getConfigDefinitions()
 {
     $definitions = parent::getConfigDefinitions();
     return $definitions + ['apiVersion' => ['valid' => ['string'], 'default' => \DTS\eBaySDK\BusinessPoliciesManagement\Services\BusinessPoliciesManagementService::API_VERSION], 'authToken' => ['valid' => ['string'], 'required' => true], 'globalId' => ['valid' => ['string'], 'required' => true]];
 }
 public static function getConfigDefinitions()
 {
     $definitions = parent::getConfigDefinitions();
     return $definitions + ['apiVersion' => ['valid' => ['string'], 'default' => \DTS\eBaySDK\Finding\Services\FindingService::API_VERSION], 'globalId' => ['valid' => ['string']]];
 }
 public static function getConfigDefinitions()
 {
     $definitions = parent::getConfigDefinitions();
     return $definitions + ['apiVersion' => ['valid' => ['string'], 'default' => \DTS\eBaySDK\BulkDataExchange\Services\BulkDataExchangeService::API_VERSION], 'authToken' => ['valid' => ['string'], 'required' => true]];
 }