Пример #1
0
 public function testDefaultData()
 {
     $store = new Store('*****@*****.**', ['location' => 'Varna', 'country' => 'Bulgaria', 'postCode' => '9000']);
     $this->assertEquals(0, $store->getEbaySiteID(), 'Incorrectly set the default site to something other than US.');
     $this->assertEquals('*****@*****.**', $store->getPaypalEmail(), 'The PayPal email does not match the provided in the constructor.');
     $this->assertContains('PayPal', $store->getPaymentOptions(), 'The default payment method was not set to PayPal as expected.');
 }
Пример #2
0
 /**
  * @param $userToken
  * @param Store $store
  * @param TradingService|null $service
  */
 public function __construct($userToken, Store $store, TradingService $service = null)
 {
     if (is_null($service)) {
         $this->service = new TradingService(['apiVersion' => getenv('EBAY-TRADING-API-VERSION'), 'sandbox' => true, 'siteId' => $store->getEbaySiteID(), 'devId' => getenv('EBAY-DEV-ID'), 'appId' => getenv('EBAY-APP-ID'), 'certId' => getenv('EBAY-CERT-ID')]);
     } else {
         $this->service = $service;
     }
     if (!is_null($userToken)) {
         $this->userToken = $userToken;
     }
     if (getenv('EBAY-RUNAME')) {
         $this->ruName = getenv('EBAY-RUNAME');
     }
     $this->store = $store;
 }