Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy: skip save logic when using saved payment method #3994

Merged
merged 4 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Add - Use idempotency keys when creating payment intents, to help prevent duplicate charges for a single order.
* Fix - Allow to save card during checkout with account creation.
* Add - Add BLIK LPM feature flag.
* Fix - Skip unnecessary save step when already using a saved payment method for legacy checkout.
* Fix - Avoid duplicate payment method element for classic checkout.
* Fix - ACSS: Handle errors and edge cases.

Expand Down
5 changes: 4 additions & 1 deletion includes/class-wc-gateway-stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,10 @@ public function modify_successful_payment_result( $result, $order_id ) {

$force_save_source_value = apply_filters( 'wc_stripe_force_save_source', false );

if ( $this->save_payment_method_requested() || $force_save_source_value ) {
// We want to save the payment method if requested or forced, AND if we are not
// already using a saved payment method.
if ( ( $this->save_payment_method_requested() || $force_save_source_value ) &&
! $this->is_using_saved_payment_method() ) {
$query_params['save_payment_method'] = true;
}

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
* Add - Use idempotency keys when creating payment intents, to help prevent duplicate charges for a single order.
* Fix - Allow to save card during checkout with account creation.
* Add - Add BLIK LPM feature flag.
* Fix - Skip unnecessary save step when already using a saved payment method for legacy checkout.
* Fix - Avoid duplicate payment method element for classic checkout.
* Fix - ACSS: Handle errors and edge cases.

Expand Down
Loading