Пример #1
0
 public function testCurrency()
 {
     $targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IDeal(), $this->config);
     $this->assertEquals("EURO", $targetPay->getCurrency());
 }
Пример #2
0
 /**
  * @expectedException TPWeb\TargetPay\Exception\AmountException
  */
 public function testSetAmount()
 {
     $targetPay = new TargetPay(null, $this->config);
     $targetPay->setAmount("ABC");
 }
Пример #3
0
 public function testCalculateAmount()
 {
     $targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IVR(), $this->config);
     $targetPay->transaction->setCountry(IVR::BELGIUM);
     $targetPay->transaction->setPaymentDone(true);
     $targetPay->transaction->country->setAmountPerAction(2.0);
     $targetPay->transaction->setMode("PM");
     $targetPay->transaction->setDuration(300);
     $targetPay->transaction->calculateAmount();
     $this->assertEquals(10.0, $targetPay->getAmount());
 }
Пример #4
0
 public function testPaymentInfoMisterCash()
 {
     $config = $this->config;
     $config['layoutcode'] = "56445";
     $config['test'] = true;
     $targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\MisterCash(), $config);
     $targetPay->transaction->setLang("NL");
     $targetPay->setAmount(10.0);
     $targetPay->transaction->setDescription("UNIT Testing");
     $targetPay->transaction->setReturnUrl("https://www.tpweb.org");
     $targetPay->getPaymentInfo();
     $this->assertContains("https://www.targetpay.com/mrcash/launch.php5?transactionID=", $targetPay->transaction->getMisterCashUrl());
     $this->assertTrue($targetPay->transaction->getTransactionId() > 0);
     $targetPay->checkPaymentInfo();
     $this->assertTrue($targetPay->transaction->getPaymentDone());
     $this->assertEquals(10.0, $targetPay->getAmount());
 }