woocommerce / woocommerce-gateway-stripe

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

Fix payment method detachment in live mode #3580

Closed wjrosa closed 2 weeks ago

wjrosa commented 2 weeks ago

Fixes #3582

Changes proposed in this Pull Request:

This PR fixes some issues that may happen with staging sites detaching payment methods from production accounts. Basically, some additional checks were added before detaching a payment method (with the new checkout experience enabled).

Testing instructions

  1. Create a WooCommerce Subscription
  2. Subscribe to a service with a test user
  3. Login to the dashboard.stripe.com and confirm that the Customer was created and has a Payment Method in place
  4. Setup a clone of that site, e.g. with WP Staging.
  5. Check if Stripe is connected on the clone. It might have to be re-connected given the new Stripe connection flow/mechanism.
  6. From WP Admin panel of the clone site, go to Users and delete the customer you created on Step 2.
  7. Go back to the Stripe Dashboard and look for the Customer. On this branch (fix/pm-dettachment-in-live-mode) the payment method will not be detached

Post merge

cc @grig-23