updated CreditCardHistory.php, added sample and testcase for Reauthorization

This commit is contained in:
lathavairamani
2013-07-31 17:40:36 +05:30
parent e0046e3bbe
commit f1038717a7
6 changed files with 180 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\FundingInstrument;
use PayPal\Api\Transaction;
use PayPal\Exception\PPConnectionException;
class AuthorizationTest extends \PHPUnit_Framework_TestCase {
private $authorizations = array();
@@ -137,4 +138,19 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
$this->assertNotNull($void->getId());
}
public function testReauthorize(){
$authorization = Authorization::get('7GH53639GA425732B');
$amount = new Amount();
$amount->setCurrency("USD");
$amount->setTotal("1.00");
$authorization->setAmount($amount);
try{
$reauthorization = $authorization->reauthorize();
}catch (PPConnectionException $ex){
$this->assertEquals(strpos($ex->getMessage(),"500"), false);
}
}
}