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

Fix fingerprint set error on legacy checkout #3743

Merged
merged 6 commits into from
Jan 20, 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
@@ -1,6 +1,7 @@
*** Changelog ***

= 9.2.0 - xxxx-xx-xx =
* Fix - Fixes an error with the fingerprint property setting when using the legacy checkout.
* Fix - Fixes order attribution data for the Express Checkout Element when using the Blocks API to process.
* Tweak - Process ECE orders using the Blocks API.
* Fix - Fixes incorrect error message for card failures due insufficient funds on the shortcode checkout page (legacy).
Expand Down
8 changes: 6 additions & 2 deletions includes/payment-tokens/class-wc-stripe-payment-tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ public function woocommerce_get_customer_payment_tokens_legacy( $tokens, $custom
$token->set_last4( $source->card->last4 );
$token->set_expiry_month( $source->card->exp_month );
$token->set_expiry_year( $source->card->exp_year );
if ( isset( $source->card->fingerprint ) ) {
$token->set_fingerprint( $source->card->fingerprint );
}
}

$token->set_fingerprint( $source->fingerprint );
$token->set_user_id( $customer_id );
$token->save();
$tokens[ $token->get_id() ] = $token;
Expand Down Expand Up @@ -221,7 +223,9 @@ public function woocommerce_get_customer_payment_tokens_legacy( $tokens, $custom
$token->set_gateway_id( WC_Gateway_Stripe_Sepa::ID );
$token->set_last4( $source->sepa_debit->last4 );
$token->set_user_id( $customer_id );
$token->set_fingerprint( $source->fingerprint );
if ( isset( $source->sepa_debit->fingerprint ) ) {
$token->set_fingerprint( $source->sepa_debit->fingerprint );
}
$token->save();
$tokens[ $token->get_id() ] = $token;
} else {
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
== Changelog ==

= 9.2.0 - xxxx-xx-xx =
* Fix - Fixes an error with the fingerprint property setting when using the legacy checkout.
* Fix - Fixes order attribution data for the Express Checkout Element when using the Blocks API to process.
* Tweak - Process ECE orders using the Blocks API.
* Fix - Fixes incorrect error message for card failures due insufficient funds on the shortcode checkout page (legacy).
Expand Down
Loading