craftcms / commerce-stripe

Stripe payment gateway for Craft Commerce
https://plugins.craftcms.com/commerce-stripe
MIT License
30 stars 50 forks source link

Live environment fails when test customer is used #311

Open ryssbowh opened 4 days ago

ryssbowh commented 4 days ago

Description

We have a website just gone live (migrated from Craft 3) where payments are failing for admin users. Those users have been making payments on the dev version of the website and in Stripe they are linked to a test environment. Stripe complains :

Could not fetch Stripe customer: No such customer: 'cus_Ge1tS7lpPzAWCK'; a similar object exists in test mode, but a live mode key was used to make this request

The only thing I can do is deleting the record in the stripe_customers table and it fixes the issue.

Shouldn't stripe customers be environment aware ? or should we have a way to delete those references in Craft itself ?

Thank you

Steps to reproduce

  1. Make a payment on a dev site in a Stripe test environment
  2. Make a payment on the live version of the dev site in a Stripe production environment

Additional info

linear[bot] commented 4 days ago

PT-2147 Live environment fails when test customer is used