woocommerce / woocommerce-gateway-stripe

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

Retrying a failed payment using a 3DS card that also fails, results in the "manually capture" order note incorrectly being added to the order #3517

Closed mattallan closed 1 month ago

mattallan commented 1 month ago

Describe the bug

Reported in: 8789458-zd-a8c

When a customer purchases a product with a 3DS card that fails, and then attempts to fix the payment again using the same failing card, we incorrectly call $this->process_response( $charge, $order ); with a charge that has not been captured, resulting in the order being placed on-hold with the following order note:

Image

This order note instructs merchants to mark the order as processing to take payment, but this won't work since the card is failing and the charge is not captureable.

To Reproduce

  1. Enable the new checkout experience
  2. Make sure capture later is disabled: Image
  3. Purchase a product using a 3DS card that will decline: 4000008260003178
  4. On the SCA window, press "Complete" Image
  5. The checkout will fail
  6. Try again using the same failing 3DS card: 4000008260003178
  7. Now visit the WP Admin Edit Order page for this failing order
  8. Notice it has an order note saying to mark the order as processing to take payment 👎