Skip to content

Commit

Permalink
Fix duplicate order notes/emails on subscription renewal orders (#3572)
Browse files Browse the repository at this point in the history
* Unlock the subscription renewal payment after finishing processing the request

* Unlock the order if a failure occurred creating the intent

* add changelog entry
  • Loading branch information
mattallan committed Nov 7, 2024
1 parent 6ae72f2 commit e799735
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*** Changelog ***

= 8.8.2 - xxxx-xx-xx =
* 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.
* Fix - Prevent marking orders on-hold with order note "Process order to take payment" when the payment has failed.
Expand Down
9 changes: 4 additions & 5 deletions includes/compat/trait-wc-stripe-subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,18 +499,15 @@ 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() );

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

/* translators: error message */
$renewal_order->update_status( 'failed' );
$this->unlock_order_payment( $renewal_order );

return;
}

Expand Down Expand Up @@ -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 );
}

/**
Expand Down
8 changes: 2 additions & 6 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o

== Changelog ==

= 8.8.1 - 2024-10-28 =
* Tweak - Disables APMs when using the legacy checkout experience due Stripe deprecation by October 29, 2024.
* Fix - Prevent marking orders on-hold with order note "Process order to take payment" when the payment has failed.
* Fix - Prevent subscriptions from being marked as "Pending" when a customer attempts to change their payment method to a declining card.
* Fix - Delay updating the subscription's payment method until after the intent is confirmed when using the new checkout experience.
* Fix - Display a success notice to customers after successfully changing their subscription payment method to a card that required 3DS authentication.
= 8.8.2 - xxxx-xx-xx =
* 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).

0 comments on commit e799735

Please sign in to comment.