/** * @inheritdoc */ public function init() { $this->locator = new ServiceLocator(); if ($this->username && $this->password) { \Twocheckout::username($this->username); \Twocheckout::password($this->password); } if (!$this->privateKey) { throw new InvalidConfigException('Invalid private key was specified'); } \Twocheckout::privateKey($this->privateKey); if (!$this->sellerId) { throw new InvalidConfigException('Invalid seller id was specified'); } \Twocheckout::sellerId($this->sellerId); if (!$this->secretWord) { throw new InvalidConfigException('Invalid secret word was specified'); } \TwoCheckout::verifySSL($this->verifySSL); \Twocheckout::sandbox($this->sandbox); \Twocheckout::format($this->format); }
/** * @covers \yii\twocheckout\TwoCheckout::approve() */ public function testApprove() { $params = array('sid' => $this->twoCheckout->sellerId, 'key' => '7AB926D469648F3305AE361D5BD2C3CB', 'total' => '0.01', 'order_number' => '4774380224'); $this->assertEquals(true, $this->twoCheckout->approve($params)); }