forked from LiveCarta/PayPal-PHP-SDK
Updated Payment APIs
- Updated SDK Models to latest Payment APIs - Updated Unit Tests
This commit is contained in:
@@ -28,6 +28,8 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public $mockPayPalRestCall;
|
||||
|
||||
public $apiContext;
|
||||
|
||||
public static $batchId;
|
||||
|
||||
public function setUp()
|
||||
@@ -62,7 +64,7 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
PayoutsFunctionalTest::$batchId = $obj->getSenderBatchHeader()->getSenderBatchId();
|
||||
$params = array('sync_mode' => 'true');
|
||||
$result = $obj->create($params, null, $this->mockPayPalRestCall);
|
||||
$result = $obj->create($params, $this->apiContext, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId());
|
||||
$this->assertEquals('SUCCESS', $result->getBatchHeader()->getBatchStatus());
|
||||
@@ -80,7 +82,7 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet($payoutBatch)
|
||||
{
|
||||
$result = Payout::get($payoutBatch->getBatchHeader()->getPayoutBatchId(), null, $this->mockPayPalRestCall);
|
||||
$result = Payout::get($payoutBatch->getBatchHeader()->getPayoutBatchId(), $this->apiContext, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertNotNull($result->getBatchHeader()->getBatchStatus());
|
||||
$this->assertEquals(PayoutsFunctionalTest::$batchId, $result->getBatchHeader()->getSenderBatchHeader()->getSenderBatchId());
|
||||
@@ -96,7 +98,7 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$items = $payoutBatch->getItems();
|
||||
$item = $items[0];
|
||||
$result = PayoutItem::get($item->getPayoutItemId(), null, $this->mockPayPalRestCall);
|
||||
$result = PayoutItem::get($item->getPayoutItemId(), $this->apiContext, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals($item->getPayoutItemId(), $result->getPayoutItemId());
|
||||
$this->assertEquals($item->getPayoutBatchId(), $result->getPayoutBatchId());
|
||||
@@ -117,7 +119,7 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$this->markTestSkipped('Transaction status needs to be Unclaimed for this test ');
|
||||
return;
|
||||
}
|
||||
$result = PayoutItem::cancel($item->getPayoutItemId(), null, $this->mockPayPalRestCall);
|
||||
$result = PayoutItem::cancel($item->getPayoutItemId(), $this->apiContext, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals($item->getPayoutItemId(), $result->getPayoutItemId());
|
||||
$this->assertEquals($item->getPayoutBatchId(), $result->getPayoutBatchId());
|
||||
|
||||
Reference in New Issue
Block a user