mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Refactor capture status, make like authorization status
This commit is contained in:
parent
bfec11b174
commit
1a7eae93c2
6 changed files with 175 additions and 39 deletions
|
@ -8,6 +8,7 @@ use Requests_Utility_CaseInsensitiveDictionary;
|
|||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext;
|
||||
use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\PatchCollection;
|
||||
|
@ -278,7 +279,7 @@ class OrderEndpointTest extends TestCase
|
|||
$expectedOrder->shouldReceive('purchase_units')->once()->andReturn(['0'=>$purchaseUnit]);
|
||||
$purchaseUnit->shouldReceive('payments')->once()->andReturn($payment);
|
||||
$payment->shouldReceive('captures')->once()->andReturn(['0'=>$capture]);
|
||||
$capture->shouldReceive('status')->once()->andReturn('');
|
||||
$capture->shouldReceive('status')->once()->andReturn(new CaptureStatus(CaptureStatus::COMPLETED));
|
||||
|
||||
$result = $testee->capture($orderToCapture);
|
||||
$this->assertEquals($expectedOrder, $result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue