woocommerce / woocommerce-gateway-stripe

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

Payment Tokens with prefix "src_" are being deleted resulting in missing credit card details #3347

Open phillipswdc opened 1 month ago

phillipswdc commented 1 month ago

Describe the bug when accessing /my-account/payment-methods/ payment tokens starting with the prefix src_ are deleted locally from the _woocommerce_payment_tokens and the _woocommerce_payment_tokenmeta tables. The CC is not deleted from Stripe

To Reproduce Steps to reproduce the behavior:

  1. ensure that new checkout experience is enabled by going to... /wp-admin/admin.php?page=wc-settings&tab=checkout&section=stripe&panel=settings and checking that "Enable the legacy checkout experience" is not checked
  2. go to *_woocommerce_paymenttoken table and grab a user id with the src prefixed payment token
  3. find user change password
  4. Open another browser type or a private browser log in as user and navigate to the /my-account/payment-methods/ for this user and it should remove ANY payment method that uses the src_ prefix

tokens with the card and pm prefix are not removed

if you enable the legacy checkout this no longer happens

Expected behavior payment tokens with src_ prefix are not deleted

Screenshots This is a screenshot of mysql work bench of the payment token table isolating a users payment tokens

before opening users /my-account/payment-methods/

Screenshot 2024-08-08 at 6 32 26 PM

after opening users /my-account/payment-methods/

Screenshot 2024-08-08 at 6 32 58 PM

Environment (please complete the following information):

Additional context This was discovered in our production environment confirmed in our staging environment both with all of our plugins and custom theme.

I took a backup of the current production environment and installed locally in Docker removed all plugins except Woo and Stripe and deactivated our custom theme installing storefront.

I believe that this issue started after updating to the latest version of this trip gateway plugin

phillipswdc commented 1 month ago

Update it is deleted when you go to the checkout also

phillipswdc commented 1 month ago

Looks like this may have been fixed with latest version of plugin.

a-danae commented 1 month ago

Hey @phillipswdc ! Thanks for the report!

Looks like this may have been fixed with latest version of plugin.

Would you please confirm if this is the case?

Also, would you please confirm whether the tokens continue having an ID that begins with src_?

phillipswdc commented 1 month ago

New tokens have pm it is only our old tokens that remain src I did test with latest version and it does look like it is clear.

Do you know what version of the plugin started with this issue?