Exemple #1
0
 public function testPayout()
 {
     $targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IDeal(), $this->config);
     $targetPay->setAmount(1.0);
     $this->assertEquals(0.3, $targetPay->getPayout());
     $targetPay->setAmount(10.0);
     $this->assertEquals(9.300000000000001, $targetPay->getPayout());
 }
Exemple #2
0
 /**
  * @expectedException TPWeb\TargetPay\Exception\AmountException
  */
 public function testSetAmount()
 {
     $targetPay = new TargetPay(null, $this->config);
     $targetPay->setAmount("ABC");
 }
Exemple #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());
 }