Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
0
 public function testSettingPaymentMethods()
 {
     $store = new Store('*****@*****.**', ['location' => 'Varna', 'country' => 'Bulgaria', 'postCode' => '9000']);
     $store->addPaymentOptions([Store::PAYMENT_CASH_ON_DELIVERY, Store::PAYMENT_VISA_MASTER_CARD]);
     $this->assertEquals(['COD', 'VisaMC'], $store->getPaymentOptions(), 'Payment options were not set correctly.');
 }