Critical error on /checkout/ and /payment-methods/ pages for some customers with saved cards when legacy checkout is enabled #3718
Labels
component: UPE
Issues related to adding UPE functionality
priority: medium
The issue/PR is medium priority—it affects lots of customers substantially, but not critically.
type: bug
The issue is a confirmed bug.
Describe the bug
Some of our long-time customers who have multiple saved cards are currently not able to check out due to a regression bug in this plugin. The bug seems related to the changes in https://github.com/woocommerce/woocommerce-gateway-stripe/pull/3635/files. Here's the crash info:
WC_Stripe_Payment_Token_CC::set_fingerprint(): Argument #1 ($fingerprint) must be of type string, null given, called in /www/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-tokens/class-wc-stripe-payment-tokens.php on line 188
As far as I can tell, this is because the line should actually be
$token->set_fingerprint( $source->card->fingerprint );
, as Stripe's API doesn't returnfingerprint
at the root level of a source object. The same bug exists on a few other lines in this class as well.To Reproduce
Steps to reproduce the behavior:
wp_woocommerce_payment_tokens
to simulate the case where a card is defined in Stripe but not synced to the WC databaseExpected behavior
The
/checkout/
and/payment-methods/
pages do not crash when legacy checkout is enabled and customers have saved cards.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: