diff --git a/changelog.txt b/changelog.txt index 0000b895a..90b71d2a2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,6 +18,7 @@ * Add - Add support for Stripe Link payments via the new Stripe Checkout Element on the product, cart, checkout and pay for order pages. * Add - Show ECE button preview on settings page. * Tweak - Remove the subscription order notes added each time a source wasn't migrated. +* Fix - Prevent marking renewal orders as processing/completed multiple times due to handling the Stripe webhook in parallel. = 8.8.1 - 2024-10-28 = * Tweak - Disables APMs when using the legacy checkout experience due Stripe deprecation by October 29, 2024. diff --git a/includes/compat/trait-wc-stripe-subscriptions.php b/includes/compat/trait-wc-stripe-subscriptions.php index f9f9cc9d8..bc032d379 100644 --- a/includes/compat/trait-wc-stripe-subscriptions.php +++ b/includes/compat/trait-wc-stripe-subscriptions.php @@ -499,11 +499,6 @@ public function process_subscription_payment( $amount, $renewal_order, $retry = throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message ); } - - // TODO: Remove when SEPA is migrated to payment intents. - if ( 'stripe_sepa' !== $this->id ) { - $this->unlock_order_payment( $renewal_order ); - } } catch ( WC_Stripe_Exception $e ) { WC_Stripe_Logger::log( 'Error: ' . $e->getMessage() ); @@ -511,6 +506,8 @@ public function process_subscription_payment( $amount, $renewal_order, $retry = /* translators: error message */ $renewal_order->update_status( 'failed' ); + $this->unlock_order_payment( $renewal_order ); + return; } @@ -561,6 +558,8 @@ public function process_subscription_payment( $amount, $renewal_order, $retry = do_action( 'wc_gateway_stripe_process_payment_error', $e, $renewal_order ); } + + $this->unlock_order_payment( $renewal_order ); } /** diff --git a/readme.txt b/readme.txt index ac8b5b0f0..ea0f5787d 100644 --- a/readme.txt +++ b/readme.txt @@ -128,5 +128,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o * Add - Add support for Stripe Link payments via the new Stripe Checkout Element on the product, cart, checkout and pay for order pages. * Add - Show ECE button preview on settings page. * Tweak - Remove the subscription order notes added each time a source wasn't migrated. +* Fix - Prevent marking renewal orders as processing/completed multiple times due to handling the Stripe webhook in parallel. [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).