Skip to content

Commit 2c6cab0

Browse files
authored
Fix duplicate order notes/emails on subscription renewal orders (#3572)
* Unlock the subscription renewal payment after finishing processing the request * Unlock the order if a failure occurred creating the intent * add changelog entry
1 parent d6c5821 commit 2c6cab0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Add - Add support for Stripe Link payments via the new Stripe Checkout Element on the product, cart, checkout and pay for order pages.
1919
* Add - Show ECE button preview on settings page.
2020
* Tweak - Remove the subscription order notes added each time a source wasn't migrated.
21+
* Fix - Prevent marking renewal orders as processing/completed multiple times due to handling the Stripe webhook in parallel.
2122

2223
= 8.8.1 - 2024-10-28 =
2324
* Tweak - Disables APMs when using the legacy checkout experience due Stripe deprecation by October 29, 2024.

includes/compat/trait-wc-stripe-subscriptions.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,15 @@ public function process_subscription_payment( $amount, $renewal_order, $retry =
499499

500500
throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
501501
}
502-
503-
// TODO: Remove when SEPA is migrated to payment intents.
504-
if ( 'stripe_sepa' !== $this->id ) {
505-
$this->unlock_order_payment( $renewal_order );
506-
}
507502
} catch ( WC_Stripe_Exception $e ) {
508503
WC_Stripe_Logger::log( 'Error: ' . $e->getMessage() );
509504

510505
do_action( 'wc_gateway_stripe_process_payment_error', $e, $renewal_order );
511506

512507
/* translators: error message */
513508
$renewal_order->update_status( 'failed' );
509+
$this->unlock_order_payment( $renewal_order );
510+
514511
return;
515512
}
516513

@@ -561,6 +558,8 @@ public function process_subscription_payment( $amount, $renewal_order, $retry =
561558

562559
do_action( 'wc_gateway_stripe_process_payment_error', $e, $renewal_order );
563560
}
561+
562+
$this->unlock_order_payment( $renewal_order );
564563
}
565564

566565
/**

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
128128
* Add - Add support for Stripe Link payments via the new Stripe Checkout Element on the product, cart, checkout and pay for order pages.
129129
* Add - Show ECE button preview on settings page.
130130
* Tweak - Remove the subscription order notes added each time a source wasn't migrated.
131+
* Fix - Prevent marking renewal orders as processing/completed multiple times due to handling the Stripe webhook in parallel.
131132

132133
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)