woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
228 stars 201 forks source link

[Split PE] Duplicated saved APM tokens when coming from non-PE #2894

Closed a-danae closed 6 months ago

a-danae commented 7 months ago

Describe the bug

When saving APMs in develop and switching to Split PE, they get duplicated. This would be the scenario when users upgrade to 8.0.0.

We need to handle this migration gracefully:

To Reproduce

Creating the tokens in an older version

  1. Check out develop
  2. Select EUR as the store currency
  3. Under the Stripe settings, enable UPE and enable SEPA
  4. As a shopper, go to the checkout page
  5. Select "Use a new payment method"
  6. Select SEPA
  7. Enter AT611904300234573201 and check off "Save payment information to my account for future purchases"
  8. Place the order
  9. Go to My Account > Payment methods
  10. Notice there's a token for the SEPA payment method, all good

Upgrading to 8.0.0

  1. Check out add/deferred-intent
  2. Reload the My Account > Payment methods page
  3. Notice that the tokens for SEPA got duplicated
  4. Go to the shortcode checkout page
  5. Notice the SEPA payment methods exist under both the Credit Card and the SEPA gateways

Expected behavior The APMs must not appear duplicated for the merchant or the shopper.

Additional context

Butwhy

image
a-danae commented 6 months ago

@wjrosa I was working on another issue and ended up fixing this behavior as a side-effect of those changes.

This should be fixed by https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2926