adding new testcases for Auth Capture

This commit is contained in:
Ganesh Hegde
2013-05-28 18:20:40 +05:30
parent fd997f6b8b
commit 479730d1c4
3 changed files with 112 additions and 10 deletions

View File

@@ -2,6 +2,9 @@
namespace PayPal\Test\Api;
use PayPal\Api\Capture;
use PayPal\Api\Refund;
use PayPal\Api\Authorization;
use PayPal\Api\Amount;
use PayPal\Test\Constants;
class CaptureTest extends \PHPUnit_Framework_TestCase {
@@ -52,4 +55,33 @@ class CaptureTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals($c1, $c2);
}
public function testOperations()
{
$authId = AuthorizationTest::authorize();
$auth = Authorization::get($authId);
$amount = new Amount();
$amount->setCurrency("USD");
$amount->setTotal("1.00");
$captr = new Capture();
$captr->setId($authId);
$captr->setAmount($amount);
$capt = $auth->capture($captr);
$captureId = $capt->getId();
$this->assertNotNull($captureId);
$refund = new Refund();
$refund->setId($captureId);
$refund->setAmount($amount);
$capture = Capture::get($captureId);
$this->assertNotNull($capture->getId());
$retund = $capture->refund($refund);
$this->assertNotNull($retund->getId());
}
}