public function setMerchant(Merchant $merchant) { $model = \Mage::getModel('core/config'); $model->saveConfig(self::APIKEY, $merchant->getApiKey(), 'default', 0); $model->saveConfig(self::PATH, $merchant->getPath(), 'default', 0); $model->saveConfig(self::HOST, $merchant->getHost(), 'default', 0); $this->merchant = $merchant; }
public function testComparisonDifferentEndpoint() { $merchantA = new Merchant(); $merchantA->setApiKey('abc')->setHost('https://a-shop.com')->setPath('/'); $merchantB = new Merchant(); $merchantB->setApiKey('abc')->setHost('https://a-shop.com')->setPath('/shop2'); $this->assertFalse(Merchant::compare($merchantA, $merchantB)); }
public function testRequiredFields() { $merchant = new Merchant(); $merchant->setApiKey('dXNlcm5hbWU6cGFzc3dvcmQ='); $event = new BannerEvent($merchant, '*****@*****.**'); $this->assertEquals('*****@*****.**', $event->getEmail()); $this->assertEquals('Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=', $event->getBasicHeader()); $this->assertEquals('username', $event->getUuid()); }
public function testRequiredFields() { $merchant = new Merchant(); $merchant->setApiKey('dXNlcm5hbWU6cGFzc3dvcmQ='); $event = new CustomerMigrateEvent($merchant, '7e73aeb8-4e38-4dc4-b6a9-9fff5b2a39f7'); $this->assertEquals('7e73aeb8-4e38-4dc4-b6a9-9fff5b2a39f7', $event->getUuid()); $this->assertEquals(CustomerMigrateEvent::MIGRATED_CUSTOMER, $event->getStatus()); $this->assertEquals('Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=', $event->getBasicHeader()); }
public function testConstruction() { $merchant = new Merchant(); $merchant->setPath('/'); $customer = new Customer(); $customer->setFirstName('Test'); $customer->setLastName('User'); $presenter = new CustomerMigratePresenter($merchant, $customer, '*****@*****.**', '58', 'en'); return $presenter; }
public function testRequiredFields() { $merchant = new Merchant(); $merchant->setApiKey('dXNlcm5hbWU6cGFzc3dvcmQ='); $event = new PasswordedEvent($merchant); $this->assertInstanceOf('Expressly\\Entity\\Merchant', $event->getMerchant()); $this->assertEquals('username', $event->getUuid()); $this->assertEquals('password', $event->getPassword()); $this->assertEquals('dXNlcm5hbWU6cGFzc3dvcmQ=', $event->getApiKey()); $this->assertEquals('Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=', $event->getBasicHeader()); }
public function setMerchant(Merchant $merchant) { update_option(self::UUID, $merchant->getUuid()); update_option(self::DESTINATION, $merchant->getDestination()); update_option(self::HOST, $merchant->getHost()); update_option(self::OFFER, $merchant->getOffer()); update_option(self::PASSWORD, $merchant->getPassword()); update_option(self::PATH, $merchant->getPath()); update_option(self::IMAGE, $merchant->getImage()); update_option(self::TERMS, $merchant->getTerms()); update_option(self::POLICY, $merchant->getPolicy()); $this->merchant = $merchant; return $this; }
public function setMerchant(Merchant $merchant) { if (!Merchant::compare($this->merchant, $merchant)) { $this->save($merchant); } return $this; }
/** * @param Merchant $merchant * @return $this */ public function setMerchant(Merchant $merchant) { $this->update_params(['expressly_api_key' => $merchant->getApiKey(), 'expressly_host' => $merchant->getHost(), 'expressly_path' => $merchant->getPath()]); $this->merchant = $merchant; return $this; }
/** * */ private function updateMerchant() { $merchant = new Expressly\Entity\Merchant(); $merchant->setApiKey(JComponentHelper::getParams('com_expressly')->get(self::API_KEY))->setHost(JComponentHelper::getParams('com_expressly')->get(self::HOST))->setPath(JComponentHelper::getParams('com_expressly')->get(self::PATH)); $this->merchant = $merchant; }
private function updateMerchant() { $merchant = new Expressly\Entity\Merchant(); $merchant->setName(get_option(self::NAME))->setUuid(get_option(self::UUID))->setDestination(get_option(self::DESTINATION))->setHost(get_option(self::HOST))->setOffer(get_option(self::OFFER))->setPassword(get_option(self::PASSWORD))->setPath(get_option(self::PATH))->setImage(get_option(self::IMAGE))->setTerms(get_option(self::TERMS))->setPolicy(get_option(self::POLICY)); $this->merchant = $merchant; }
public function getMerchant() { $merchant = new Merchant(); $merchant->setApiKey($this->_config->getValue('expressly/consumer/' . self::COLUMN_API_KEY))->setHost($this->_config->getValue('expressly/consumer/' . self::COLUMN_HOST))->setPath($this->_config->getValue('expressly/consumer/' . self::COLUMN_PATH)); return $merchant; }