As part of updating/migrating SEPA tokens over to pm_ IDs, we also worked on a change (see https://github.com/woocommerce/woocommerce-gateway-stripe/pull/3241) that removed support for displaying and storing any legacy src_ tokens.
This fix was introduced because payment method requests with SEPA src_ tokens would failed.
From Stripe's docs on sources (https://docs.stripe.com/sources), they do however still support source tokens for card payments and so we should continue to support them in our extension.
While investigating https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3498, we found that Google Pay and Apple Pay were still create valid credit card payment methods beginning with src_ and so our changes to remove/hide all saved cards with sources unexpectedly impacted customers that purchased using our Payment Request buttons.
The changes in this PR brings back support for displaying and storing payment methods starting with src_ but only for credit cards.
Proposed changes:
df909d63f8cab522a6c486c53a997b16dbe50548 - Introduces a new helper function to validate payment method IDs (i.e. only allow source IDs if the payment method is 'card')
d6bc810179e52a1bda457ef19a4b46018dc285be - Don't delete any saved sources when the type is 'CC'
3f03fd17b497b879d9936935f7a26da8f4641960 - Allow for legacy sources to be stored in the woocommerce_payment_tokens table if the payment method type is 'card'
Fixes #3498
Changes proposed in this Pull Request:
As part of updating/migrating SEPA tokens over to
pm_
IDs, we also worked on a change (see https://github.com/woocommerce/woocommerce-gateway-stripe/pull/3241) that removed support for displaying and storing any legacysrc_
tokens. This fix was introduced because payment method requests with SEPAsrc_
tokens would failed.From Stripe's docs on sources (https://docs.stripe.com/sources), they do however still support source tokens for card payments and so we should continue to support them in our extension.
While investigating https://github.com/woocommerce/woocommerce-gateway-stripe/issues/3498, we found that Google Pay and Apple Pay were still create valid credit card payment methods beginning with
src_
and so our changes to remove/hide all saved cards with sources unexpectedly impacted customers that purchased using our Payment Request buttons.The changes in this PR brings back support for displaying and storing payment methods starting with
src_
but only for credit cards.Proposed changes:
woocommerce_payment_tokens
table if the payment method type is 'card'Testing instructions
For the purpose of testing, I removed all my existing saved cards via the My Account > Payment methods page.
_wcstripe_feature_ece
is set to 'no' in wp-options)trunk
, go to My Account > payment methods and confirm you have no saved payment methodswp_woocommerce_payment_tokens
table and notice there's no saved stripe tokens.wp_woocommerce_payment_tokens
table again and confirm you now see the savedsrc_
token with type 'CC'.changelog.txt
andreadme.txt
(or does not apply)Post merge