mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Add retry counter meta to order to avoid duplicate invoice error on consequent tries
This commit is contained in:
parent
355bac28f9
commit
c072e8550a
6 changed files with 26 additions and 40 deletions
|
@ -88,8 +88,6 @@ class OrderProcessorTest extends TestCase
|
|||
$sessionHandler
|
||||
->expects('order')
|
||||
->andReturn($currentOrder);
|
||||
$sessionHandler
|
||||
->expects('destroy_session_data');
|
||||
|
||||
$orderEndpoint = Mockery::mock(OrderEndpoint::class);
|
||||
$orderEndpoint
|
||||
|
@ -129,15 +127,6 @@ class OrderProcessorTest extends TestCase
|
|||
$this->environment
|
||||
);
|
||||
|
||||
$cart = Mockery::mock(\WC_Cart::class);
|
||||
$cart
|
||||
->expects('empty_cart');
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
when('WC')
|
||||
->justReturn($woocommerce);
|
||||
|
||||
$woocommerce->cart = $cart;
|
||||
|
||||
$wcOrder
|
||||
->expects('update_meta_data')
|
||||
->with(
|
||||
|
@ -211,8 +200,6 @@ class OrderProcessorTest extends TestCase
|
|||
$sessionHandler
|
||||
->expects('order')
|
||||
->andReturn($currentOrder);
|
||||
$sessionHandler
|
||||
->expects('destroy_session_data');
|
||||
$orderEndpoint = Mockery::mock(OrderEndpoint::class);
|
||||
$orderEndpoint
|
||||
->expects('patch_order_with')
|
||||
|
@ -234,21 +221,8 @@ class OrderProcessorTest extends TestCase
|
|||
->shouldReceive('has')
|
||||
->andReturnFalse();
|
||||
|
||||
$cart = Mockery::mock(\WC_Cart::class);
|
||||
$cart
|
||||
->shouldReceive('empty_cart');
|
||||
|
||||
$woocommerce = Mockery::Mock(\Woocommerce::class);
|
||||
$woocommerce
|
||||
->shouldReceive('__get')
|
||||
->with('cart')
|
||||
->set('cart', $cart);
|
||||
when('WC')
|
||||
->justReturn($woocommerce);
|
||||
|
||||
$logger = Mockery::mock(LoggerInterface::class);
|
||||
|
||||
|
||||
$testee = new OrderProcessor(
|
||||
$sessionHandler,
|
||||
$orderEndpoint,
|
||||
|
@ -260,15 +234,6 @@ class OrderProcessorTest extends TestCase
|
|||
$this->environment
|
||||
);
|
||||
|
||||
$cart = Mockery::mock(\WC_Cart::class);
|
||||
$cart
|
||||
->expects('empty_cart');
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
$woocommerce->cart = $cart;
|
||||
|
||||
when('WC')
|
||||
->justReturn($woocommerce);
|
||||
|
||||
$wcOrder
|
||||
->expects('update_meta_data')
|
||||
->with(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue