Skip to content

Commit

Permalink
Merge branch 'develop' into fix/legacy-skip-saved-payment-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
annemirasol authored Feb 28, 2025
2 parents fdba99c + 8f0fb61 commit fcecf9c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
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.
* Fix - Skip unnecessary save step when already using a saved payment method for legacy checkout.

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.
* Fix - Skip unnecessary save step when already using a saved payment method for legacy checkout.

Expand Down

0 comments on commit fcecf9c

Please sign in to comment.