Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public function testBuildingEntity()
 {
     $entity = new Merchant();
     $this->assertInstanceOf('Expressly\\Entity\\Merchant', $entity->setApiKey('dXNlcm5hbWU6cGFzc3dvcmQ='));
     $this->assertInstanceOf('Expressly\\Entity\\Merchant', $entity->setHost('https://a-shop.com'));
     $this->assertInstanceOf('Expressly\\Entity\\Merchant', $entity->setPath('/'));
     $this->assertEquals('https://a-shop.com', $entity->getHost());
     $this->assertEquals('/', $entity->getPath());
     $this->assertEquals('dXNlcm5hbWU6cGFzc3dvcmQ=', $entity->getApiKey());
     $this->assertEquals('username', $entity->getUuid());
     $this->assertEquals('password', $entity->getPassword());
     $this->assertJson(json_encode($entity->toArray()));
     $this->assertJsonStringEqualsJsonString(json_encode($entity->toArray()), json_encode(array('apiKey' => 'dXNlcm5hbWU6cGFzc3dvcmQ=', 'host' => 'https://a-shop.com', 'path' => '/')));
 }
 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;
 }
 /**
  * @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;
 }
Ejemplo n.º 5
0
 public function setMerchant(Merchant $merchant)
 {
     $this->setData([self::COLUMN_API_KEY => $merchant->getApiKey(), self::COLUMN_HOST => $merchant->getHost(), self::COLUMN_PATH => $merchant->getPath()]);
 }