woocommerce / woocommerce-gateway-stripe

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

"Use a New Payment Method" Button Incorrectly Appears During Checkout in WooCommerce Stripe Gateway Plugin #3252

Closed shohanhossainnab closed 3 weeks ago

shohanhossainnab commented 4 months ago

Describe the bug The "Use a new payment method" radio button incorrectly appears during the checkout process under specific conditions, causing order failures when not selected by the customer.

To Reproduce Steps to reproduce the behavior:

  1. Ensure "New Checkout Experience" is enabled.
  2. Create a free product with 0 price, but make sure shipping is enabled
  3. Create two shipping zones: 1. With free shipping(Should be your default address so that the checkout page has that selected automatically), 2. With a shipping fee (This is the one we will select on the checkout page to trigger the bug)
  4. Ensure the customer is not logged in.
  5. Add the free product to the car
  6. Go to the checkout page (cart total shows $0.00).
  7. Check the behavior with address the address where free shipping is enabled.
  8. Now, change the address to match the paid shipping zone.
  9. Cart total will update with a $XX charge
  10. Observe the "Use a new payment method" radio button appearing next to the credit card block

Expected behavior The "Use a new payment method" radio button should only appear when "Enable payment methods via saved card" is enabled and the customer is logged in with an existing saved card.

Screenshots J2rFm1.png

Environment (please complete the following information):

Additional context Initial report 8367652-zen

ryanr14 commented 3 months ago

I know this may be an unlikely edge case, but I wanted to check in for our merchant. Especially since there hasn't been a human review on this so far that I can see. :)

I added the bug label.