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 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' => '/'))); }
/** * @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; }
public function setMerchant(Merchant $merchant) { $this->setData([self::COLUMN_API_KEY => $merchant->getApiKey(), self::COLUMN_HOST => $merchant->getHost(), self::COLUMN_PATH => $merchant->getPath()]); }