You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce separate flow to handle subscription change payment method requests for deferred intents (#3539)
* Introduce separate change payment method flow for deferred intents
* Tell subscriptions to not update the payment method until after we've created/confirmed the deferred intent
* Remove the current change payment method handling inside the process_payment function
* Change some UPE methods to protected/public to be used inside the subs trait and intent controller
* Update confirm_change_payment_from_setup_intent_ajax() to support new change payment flow for 3DS cards
* Add changelog entries
* Fix small typos in comments
* Send the confirm_change_payment ajax request to process subscription payment method changes after completing CashApp
* Revert change to return url
---------
Co-authored-by: James Allan <[email protected]>
Copy file name to clipboardExpand all lines: changelog.txt
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,9 @@
3
3
= 8.8.1 - xxxx-xx-xx =
4
4
* Tweak - Disables APMs when using the legacy checkout experience due Stripe deprecation by October 29, 2024.
5
5
* Fix - Prevent marking orders on-hold with order note "Process order to take payment" when the payment has failed.
6
+
* Fix - Prevent subscriptions from being marked as "Pending" when a customer attempts to change their payment method to a declining card.
7
+
* Fix - Delay updating the subscription's payment method until after the intent is confirmed when using the new checkout experience.
8
+
* Fix - Display a success notice to customers after successfully changing their subscription payment method to a card that required 3DS authentication.
6
9
7
10
= 8.8.0 - 2024-10-17 =
8
11
* Fix - Update URL and path constants to support use of symlinked plugin.
thrownewWC_Stripe_Exception( 'subscriptions_not_found', __( "We're not able to process this subscription change payment request payment. Please try again later.", 'woocommerce-gateway-stripe' ) );
1091
1091
}
1092
1092
@@ -1104,8 +1104,23 @@ public function confirm_change_payment_from_setup_intent_ajax() {
// Check if the subscription has the delayed update all flag and attempt to update all subscriptions after the intent has been confirmed. If successful, display the "updated all subscriptions" notice.
// Because this new payment does not require action/confirmation, remove this filter so that WC_Subscriptions_Change_Payment_Gateway proceeds to update all subscriptions if flagged.
@@ -1059,4 +1158,24 @@ public function disable_subscription_edit_for_india( $editable, $order ) {
1059
1158
1060
1159
return$editable;
1061
1160
}
1161
+
1162
+
/**
1163
+
* When handling a subscription change payment method request with deferred intents,
1164
+
* don't immediately update the subscription's payment method to Stripe until we've created and confirmed the setup intent.
1165
+
*
1166
+
* For purchases with a 3DS card specifically, we don't want to update the payment method on the subscription until after the customer has authenticated.
1167
+
*
1168
+
* @param bool $update_payment_method Whether to update the payment method.
1169
+
* @param string $new_payment_method The new payment method.
1170
+
* @param WC_Subscription $subscription The subscription.
// For Voucher payment method types (Boleto/Oxxo/Multibanco), redirect the customer to a URL hash formatted #wc-stripe-voucher-{order_id}:{payment_method_type}:{client_secret}:{redirect_url} to confirm the intent which also displays the voucher.
2551
2544
returnsprintf(
@@ -2558,12 +2551,13 @@ private function get_redirect_url( $return_url, $payment_intent, $payment_inform
// For Wallet payment method types (CashApp/WeChat Pay), redirect the customer to a URL hash formatted #wc-stripe-wallet-{order_id}:{payment_method_type}:{payment_intent_type}:{client_secret}:{redirect_url} to confirm the intent which also displays the modal.
Copy file name to clipboardExpand all lines: readme.txt
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -113,5 +113,8 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
113
113
= 8.8.1 - xxxx-xx-xx =
114
114
* Tweak - Disables APMs when using the legacy checkout experience due Stripe deprecation by October 29, 2024.
115
115
* Fix - Prevent marking orders on-hold with order note "Process order to take payment" when the payment has failed.
116
+
* Fix - Prevent subscriptions from being marked as "Pending" when a customer attempts to change their payment method to a declining card.
117
+
* Fix - Delay updating the subscription's payment method until after the intent is confirmed when using the new checkout experience.
118
+
* Fix - Display a success notice to customers after successfully changing their subscription payment method to a card that required 3DS authentication.
116
119
117
120
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).
0 commit comments