示例#1
0
 public function testAmount()
 {
     $targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IDeal(), $this->config);
     $targetPay->setAmount(1.0);
     $this->assertEquals(1.0, $targetPay->getAmount());
     $targetPay->setAmount(10.0);
     $this->assertEquals(10.0, $targetPay->getAmount());
 }
示例#2
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());
 }
示例#3
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());
 }