Esempio n. 1
0
 /**
  * Trading constructor.
  *
  * @param string $call The Trading Call that you will be performing
  * @param  string $user_token A user token needed for some calls
  *
  * @throws Exception
  * @throws InvalidArgumentException
  */
 public function __construct($call, $user_token = null)
 {
     // Config
     $config = Config::getConfig();
     // EndPoint
     $this->endpoint = $config['trading']['endpoint'];
     // Call Name
     $this->setCallName($call, "urn:ebay:apis:eBLBaseComponents");
     // Setup Headers
     $this->headers = array('X-EBAY-API-COMPATIBILITY-LEVEL' => $config['SchemeVersion'], 'X-EBAY-API-DEV-NAME' => $config['keys']['DevID'], 'X-EBAY-API-APP-NAME' => $config['keys']['AppID'], 'X-EBAY-API-CERT-NAME' => $config['keys']['CertID'], 'X-EBAY-API-CALL-NAME' => $this->call_name, 'X-EBAY-API-SITEID' => $config['SiteID'], 'Content-Type' => 'text/xml');
     // User Token
     if (!is_null($user_token)) {
         $this->addUserToken($user_token);
     }
 }
Esempio n. 2
0
 /**
  * Finding constructor.
  *
  * @param string $call Finding Call
  * @param string|null $user_token
  * 
  * @throws Exception
  */
 public function __construct($call, $user_token = null)
 {
     // Config
     $config = Config::getConfig();
     // End Point
     $this->endpoint = $config['finding']['endpoint'];
     // Call
     $this->setCallName($call, 'http://www.ebay.com/marketplace/search/v1/services');
     // Headers
     $this->headers = array('X-EBAY-SOA-SERVICE-NAME' => 'FindingService', 'X-EBAY-SOA-REQUEST-DATA-FORMAT' => 'XML', 'X-EBAY-SOA-RESPONSE-DATA-FORMAT' => 'XML', 'X-EBAY-SOA-SECURITY-APPNAME' => $config['keys']['AppID'], 'X-EBAY-SOA-OPERATION-NAME' => $this->call_name, 'X-EBAY-SOA-SERVICE-VERSION' => $config['finding']['service_version'], 'X-EBAY-SOA-GLOBAL-ID' => $config['finding']['global_id']);
     // User Token
     if (!is_null($user_token)) {
         $this->addUserToken($user_token);
     }
 }
Esempio n. 3
0
 /**
  * Shopping constructor.
  *
  * @param string $call The Shopping Call that you will be performing
  * @param  string $user_token A user token needed for some calls
  * 
  * @throws Exception
  */
 public function __construct($call, $user_token = null)
 {
     // Config
     $config = Config::getConfig();
     // End Point
     $this->endpoint = $config['shopping']['endpoint'];
     // Call
     $this->setCallName($call, "urn:ebay:apis:eBLBaseComponents");
     // Headers
     $this->headers = array('X-EBAY-API-APP-ID' => $config['keys']['AppID'], 'X-EBAY-API-CALL-NAME' => $this->call_name, 'X-EBAY-API-REQUEST-ENCODING' => 'XML', 'X-EBAY-API-RESPONSE-ENCODING' => 'XML', 'X-EBAY-API-SITE-ID' => $config['SiteID'], 'X-EBAY-API-VERSION' => $config['SchemeVersion']);
     // Affiliate Tracking Headers
     if ($config['shopping']['affiliate_tracking'] == 'true') {
         $this->headers['X-EBAY-API-TRACKING-ID'] = $config['shopping']['affiliate']['tracking_id'];
         $this->headers['X-EBAY-API-TRACKING-PARTNER-CODE'] = $config['shopping']['affiliate']['partner_code'];
         $this->headers['X-EBAY-API-AFFILIATE-USER-ID'] = $config['shopping']['affiliate']['user_id'];
     }
     // User Token
     if (!is_null($user_token)) {
         $this->addUserToken($user_token);
     }
 }