Changeset 5870 for plugins/sfEbayPlugin
- Timestamp:
- 11/05/07 21:47:22 (6 years ago)
- Files:
-
- plugins/sfEbayPlugin/trunk/lib/BasesfEbay.class.php (modified) (2 diffs)
- plugins/sfEbayPlugin/trunk/lib/sfEbay.class.php (modified) (1 diff)
- plugins/sfEbayPlugin/trunk/lib/sfEbayAuth.class.php (modified) (1 diff)
- plugins/sfEbayPlugin/trunk/lib/sfEbayCredentials.class.php (modified) (1 diff)
- plugins/sfEbayPlugin/trunk/lib/sfEbayShopping.class.php (modified) (1 diff)
- plugins/sfEbayPlugin/trunk/lib/test.php (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfEbayPlugin/trunk/lib/BasesfEbay.class.php
r5566 r5870 1 1 <?php 2 /** 3 * sfEbay 4 * 5 * @package sfEbayPlugin 6 * @author Jonathan H. Wage 7 */ 2 8 class BasesfEbay extends SoapClient 3 9 { 4 pr ivate $wsdl = null;5 private $token = null;6 private $devId = null;7 private $appId = null;8 private $certId = null;9 private $environment = 'production';10 protected $locations= array('production' => null,11 'sandbox' => null);10 protected $_wsdl = null, 11 $_token = null, 12 $_devId = null, 13 $_appId = null, 14 $_certId = null, 15 $_environment = 'production', 16 $_locations = array('production' => null, 17 'sandbox' => null); 12 18 13 public function __construct($wsdl, $token, $devId, $appId, $certId) 19 /** 20 * __construct 21 * 22 * @param string $_wsdl 23 * @param string $_token 24 * @param string $_devId 25 * @param string $_appId 26 * @param string $_certId 27 * @return void 28 */ 29 public function __construct($_wsdl, $_token, $_devId, $_appId, $_certId) 14 30 { 15 $this-> wsdl = $wsdl;16 $this-> token = $token;17 $this-> devId = $devId;18 $this-> appId = $appId;19 $this-> certId = $certId;31 $this->_wsdl = $_wsdl; 32 $this->_token = $_token; 33 $this->_devId = $_devId; 34 $this->_appId = $_appId; 35 $this->_certId = $_certId; 20 36 21 parent::__construct($this-> wsdl, array('trace' => 1));37 parent::__construct($this->_wsdl, array('trace' => 1)); 22 38 } 23 39 40 /** 41 * getEnvironment 42 * 43 * @return void 44 */ 24 45 public function getEnvironment() 25 46 { 26 return $this-> environment;47 return $this->_environment; 27 48 } 28 49 50 /** 51 * setEnvironment 52 * 53 * @param string $environment 54 * @return void 55 */ 29 56 public function setEnvironment($environment) 30 57 { 31 $this-> environment = $environment;58 $this->_environment = $environment; 32 59 } 33 60 61 /** 62 * getLocation 63 * 64 * @return void 65 */ 34 66 public function getLocation() 35 67 { 36 return $this-> locations[$this->getEnvironment()];68 return $this->_locations[$this->_environment]; 37 69 } 38 70 71 /** 72 * __call 73 * 74 * @param string $function 75 * @param string $params 76 * @return void 77 */ 39 78 public function __call($function, $params) 40 79 { 41 $eBayAuth = new sfEbayAuth($this-> token, $this->appId, $this->devId, $this->certId);80 $eBayAuth = new sfEbayAuth($this->_token, $this->_appId, $this->_devId, $this->_certId); 42 81 $headerBody = new SoapVar($eBayAuth, SOAP_ENC_OBJECT); 43 82 $headers = array(new SoapHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $headerBody)); … … 46 85 $params[0]['SiteId'] = (isset($params[0]['SiteId']) && $params[0]['SiteId']) ? $params[0]['SiteId']:0; 47 86 48 $queryString = http_build_query(array('callname' => $function, 'siteid' => $params[0]['SiteId'], 'version' => $params[0]['Version'], 'appid' => $this-> appId, 'Routing' => 'default'));87 $queryString = http_build_query(array('callname' => $function, 'siteid' => $params[0]['SiteId'], 'version' => $params[0]['Version'], 'appid' => $this->_appId, 'Routing' => 'default'), '', '&'); 49 88 $location = $this->getLocation() . "?" . $queryString; 50 89 plugins/sfEbayPlugin/trunk/lib/sfEbay.class.php
r5566 r5870 1 1 <?php 2 /** 3 * sfEbay 4 * 5 * @package sfEbayPlugin 6 * @author Jonathan H. Wage 7 */ 2 8 class sfEbay extends BasesfEbay 3 9 { 4 protected $locations = array('production' => 'https://api.ebay.com/wsapi', 5 'sandbox' => 'https://api.sandbox.ebay.com/wsapi'); 6 7 public function __construct($token, $devId, $appId, $certId) 10 /** 11 * _locations 12 * 13 * @var string 14 */ 15 protected $_locations = array('production' => 'https://api.ebay.com/wsapi', 16 'sandbox' => 'https://api.sandbox.ebay.com/wsapi'); 17 18 /** 19 * __construct 20 * 21 * @param string $_token 22 * @param string $_devId 23 * @param string $_appId 24 * @param string $_certId 25 * @return void 26 */ 27 public function __construct($_token, $_devId, $_appId, $_certId) 8 28 { 9 parent::__construct('http://developer.ebay.com/webservices/latest/eBaySvc.wsdl', $ token, $devId, $appId, $certId);29 parent::__construct('http://developer.ebay.com/webservices/latest/eBaySvc.wsdl', $_token, $_devId, $_appId, $_certId); 10 30 } 11 31 } plugins/sfEbayPlugin/trunk/lib/sfEbayAuth.class.php
r5566 r5870 1 1 <?php 2 /** 3 * sfEbayAuth 4 * 5 * @package sfEbayPlugin 6 * @author Jonathan H. Wage 7 */ 2 8 class sfEbayAuth 3 9 { 4 pr ivate $eBayAuthToken;5 private $Credentials;10 protected $_eBayAuthToken, 11 $_Credentials; 6 12 7 public function __construct($token, $appId, $devId, $certId) 13 /** 14 * __construct 15 * 16 * @param string $_token 17 * @param string $_appId 18 * @param string $_devId 19 * @param string $_certId 20 * @return void 21 */ 22 public function __construct($_token, $_appId, $_devId, $_certId) 8 23 { 9 $credentials = new sfEbayCredentials($ appId, $devId, $certId);10 $this-> eBayAuthToken = new SoapVar($token, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents');11 $this-> Credentials = new SoapVar($credentials, SOAP_ENC_OBJECT, null, null, null, 'urn:ebay:apis:eBLBaseComponents');24 $credentials = new sfEbayCredentials($_appId, $_devId, $_certId); 25 $this->_eBayAuthToken = new SoapVar($_token, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents'); 26 $this->_Credentials = new SoapVar($credentials, SOAP_ENC_OBJECT, null, null, null, 'urn:ebay:apis:eBLBaseComponents'); 12 27 } 13 28 } plugins/sfEbayPlugin/trunk/lib/sfEbayCredentials.class.php
r5566 r5870 1 1 <?php 2 /** 3 * sfEbay 4 * 5 * @package sfEbayPlugin 6 * @author Jonathan H. Wage 7 */ 2 8 class sfEbayCredentials 3 9 { 4 pr ivate $AppId;5 private $DevId;6 private $AuthCert;10 protected $_AppId, 11 $_DevId, 12 $_AuthCert; 7 13 8 public function __construct($appId, $devId, $certId) 14 /** 15 * __construct 16 * 17 * @param string $_appId 18 * @param string $_devId 19 * @param string $_certId 20 * @return void 21 */ 22 public function __construct($_appId, $_devId, $_certId) 9 23 { 10 $this-> AppId = new SoapVar($appId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents');11 $this-> DevId = new SoapVar($devId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents');12 $this-> AuthCert = new SOAPVar($certId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents');24 $this->_AppId = new SoapVar($_appId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents'); 25 $this->_DevId = new SoapVar($_devId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents'); 26 $this->_AuthCert = new SOAPVar($_certId, XSD_STRING, null, null, null, 'urn:ebay:apis:eBLBaseComponents'); 13 27 } 14 28 } plugins/sfEbayPlugin/trunk/lib/sfEbayShopping.class.php
r5566 r5870 1 1 <?php 2 /** 3 * sfEbayShopping 4 * 5 * @package sfEbayPlugin 6 * @author Jonathan H. Wage 7 */ 2 8 class sfEbayShopping extends BasesfEbay 3 9 { 4 protected $ locations = array('production' => 'https://api.ebay.com/shopping',5 'sandbox' => 'https://api.sandbox.ebay.com/shopping');10 protected $_locations = array('production' => 'https://api.ebay.com/shopping', 11 'sandbox' => 'https://api.sandbox.ebay.com/shopping'); 6 12 7 public function __construct($token, $devId, $appId, $certId) 13 /** 14 * __construct 15 * 16 * @param string $_token 17 * @param string $_devId 18 * @param string $_appId 19 * @param string $_certId 20 * @return void 21 */ 22 public function __construct($_token, $_devId, $_appId, $_certId) 8 23 { 9 parent::__construct('http://developer.ebay.com/webservices/latest/ShoppingService.wsdl', $ token, $devId, $appId, $certId);24 parent::__construct('http://developer.ebay.com/webservices/latest/ShoppingService.wsdl', $_token, $_devId, $_appId, $_certId); 10 25 } 11 26 }