Development

Changeset 5870 for plugins/sfEbayPlugin

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
11/05/07 21:47:22 (6 years ago)
Author:
Jonathan.Wage
Message:

Removed test.php and added comments to all classes. Renamed some variables.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfEbayPlugin/trunk/lib/BasesfEbay.class.php

    r5566 r5870  
    11<?php 
     2/** 
     3 * sfEbay 
     4 * 
     5 * @package sfEbayPlugin 
     6 * @author Jonathan H. Wage 
     7 */ 
    28class BasesfEbay extends SoapClient 
    39{ 
    4   private $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); 
    1218   
    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) 
    1430  {  
    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; 
    2036     
    21     parent::__construct($this->wsdl, array('trace' => 1)); 
     37    parent::__construct($this->_wsdl, array('trace' => 1)); 
    2238  } 
    23    
     39 
     40  /** 
     41   * getEnvironment 
     42   * 
     43   * @return void 
     44   */ 
    2445  public function getEnvironment() 
    2546  { 
    26     return $this->environment; 
     47    return $this->_environment; 
    2748  } 
    28    
     49 
     50  /** 
     51   * setEnvironment 
     52   * 
     53   * @param string $environment  
     54   * @return void 
     55   */ 
    2956  public function setEnvironment($environment) 
    3057  { 
    31     $this->environment = $environment; 
     58    $this->_environment = $environment; 
    3259  } 
    33    
     60 
     61  /** 
     62   * getLocation 
     63   * 
     64   * @return void 
     65   */ 
    3466  public function getLocation() 
    3567  { 
    36     return $this->locations[$this->getEnvironment()]; 
     68    return $this->_locations[$this->_environment]; 
    3769  } 
    3870 
     71  /** 
     72   * __call 
     73   * 
     74   * @param string $function  
     75   * @param string $params  
     76   * @return void 
     77   */ 
    3978  public function __call($function, $params) 
    4079  { 
    41     $eBayAuth = new sfEbayAuth($this->token, $this->appId, $this->devId, $this->certId); 
     80    $eBayAuth = new sfEbayAuth($this->_token, $this->_appId, $this->_devId, $this->_certId); 
    4281    $headerBody = new SoapVar($eBayAuth, SOAP_ENC_OBJECT); 
    4382    $headers = array(new SoapHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $headerBody)); 
     
    4685    $params[0]['SiteId'] = (isset($params[0]['SiteId']) && $params[0]['SiteId']) ? $params[0]['SiteId']:0; 
    4786     
    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'), '', '&'); 
    4988    $location = $this->getLocation() . "?" . $queryString; 
    5089     
  • plugins/sfEbayPlugin/trunk/lib/sfEbay.class.php

    r5566 r5870  
    11<?php 
     2/** 
     3 * sfEbay 
     4 * 
     5 * @package sfEbayPlugin 
     6 * @author Jonathan H. Wage 
     7 */ 
    28class sfEbay extends BasesfEbay 
    39{ 
    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) 
    828  { 
    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); 
    1030  } 
    1131} 
  • plugins/sfEbayPlugin/trunk/lib/sfEbayAuth.class.php

    r5566 r5870  
    11<?php 
     2/** 
     3 * sfEbayAuth 
     4 * 
     5 * @package sfEbayPlugin 
     6 * @author Jonathan H. Wage 
     7 */ 
    28class sfEbayAuth 
    39{ 
    4   private $eBayAuthToken; 
    5   private $Credentials; 
     10  protected $_eBayAuthToken, 
     11            $_Credentials; 
    612 
    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) 
    823  { 
    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'); 
    1227  } 
    1328} 
  • plugins/sfEbayPlugin/trunk/lib/sfEbayCredentials.class.php

    r5566 r5870  
    11<?php 
     2/** 
     3 * sfEbay 
     4 * 
     5 * @package sfEbayPlugin 
     6 * @author Jonathan H. Wage 
     7 */ 
    28class sfEbayCredentials 
    39{ 
    4   private $AppId; 
    5   private $DevId; 
    6   private $AuthCert; 
     10  protected $_AppId, 
     11            $_DevId, 
     12            $_AuthCert; 
    713 
    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) 
    923  { 
    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'); 
    1327  } 
    1428} 
  • plugins/sfEbayPlugin/trunk/lib/sfEbayShopping.class.php

    r5566 r5870  
    11<?php 
     2/** 
     3 * sfEbayShopping 
     4 * 
     5 * @package sfEbayPlugin 
     6 * @author Jonathan H. Wage 
     7 */ 
    28class sfEbayShopping extends BasesfEbay 
    39{ 
    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'); 
    612 
    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) 
    823  { 
    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); 
    1025  } 
    1126}