Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

fix(modal-checkout): prevent inital page submit event propagation #1949

Closed chickenn00dle closed 2 weeks ago

chickenn00dle commented 2 weeks ago

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/1207817176293825/1208747968528669/f

This PR fixes an issue where a stripe script was causing payment method validation when transitioning from billing details to payment info in our modal checkout.

We fix this by preventing event propagation on the submit handler in our script.

Screenshot 2024-11-12 at 17 05 00

How to test the changes in this Pull Request:

  1. As admin, enable stripe and ensure you are using the updated checkout experience
  2. As a logged out brand new reader, initiate checkout via any checkout button or donation block
  3. Go through the modal checkout flow until you get to the payment method step
  4. Confirm the payment method does not show any validation errors
  5. Add some invalid payment info (or submit without adding payment details)
  6. Confirm payment method validation errors appear
  7. Add valid payment info and confirm you can complete checkout

Other information: