Skip to content

Commit 9d98c93

Browse files
malithsenwjrosa
andauthored
Fix free trial subscription purchases with payment methods that require redirection (#4530)
* Remove oc special case for setting/unsetting return_url * Add readme entries * Remove extra changelog entry * Remove extra parentheses Co-authored-by: Wesley Rosa <[email protected]> --------- Co-authored-by: Wesley Rosa <[email protected]>
1 parent c778297 commit 9d98c93

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
@@ -16,6 +16,7 @@
1616
* Fix - 3DS authentication modal not shown when using Google Pay
1717
* Update - Improve Stripe API connector logging to include request/response context
1818
* Fix - Require credit cards to be enabled before Apple Pay and Google Pay can be enabled in PMC
19+
* Fix - Free trial subscription orders with payment methods that require redirection (eg: iDeal, Bancontact)
1920
* Tweak - Update checkout error message for invalid API key to be more generic and user-friendly
2021

2122
= 9.7.1 - 2025-07-28 =

includes/class-wc-stripe-intent-controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@ private function build_base_payment_intent_request_params( $payment_information
10071007

10081008
$request = $this->maybe_add_mandate_options( $request, $payment_information['selected_payment_type'] );
10091009

1010-
// Does not set the return URL if Single Payment Element is enabled or if the request needs redirection.
1011-
if ( $this->get_upe_gateway()->is_oc_enabled() || $this->request_needs_redirection( $payment_method_types ) ) {
1010+
// Does not set the return URL if the request needs redirection.
1011+
if ( $this->request_needs_redirection( $payment_method_types ) ) {
10121012
$request['return_url'] = $payment_information['return_url'];
10131013
}
10141014

@@ -1097,8 +1097,8 @@ public function create_and_confirm_setup_intent( $payment_information ) {
10971097
$request['confirm'] = 'false';
10981098
}
10991099

1100-
// Removes the return URL if Single Payment Element is not enabled or if the request doesn't need redirection.
1101-
if ( ( ! $this->get_upe_gateway()->is_oc_enabled() || ! $this->request_needs_redirection( $request['payment_method_types'] ) ) ) {
1100+
// Removes the return URL if the request doesn't need redirection.
1101+
if ( ! $this->request_needs_redirection( $request['payment_method_types'] ) ) {
11021102
unset( $request['return_url'] );
11031103
}
11041104

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
125125
* Fix - 3DS authentication modal not shown when using Google Pay
126126
* Update - Improve Stripe API connector logging to include request/response context
127127
* Fix - Require credit cards to be enabled before Apple Pay and Google Pay can be enabled in PMC
128+
* Fix - Free trial subscription orders with payment methods that require redirection (eg: iDeal, Bancontact)
128129
* Tweak - Update checkout error message for invalid API key to be more generic and user-friendly
129130

130-
131131
[See changelog for full details across versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)