Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating checkout nonce via AJAX #2963

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

When a user is created at checkout but the checkout fails (ex Stripe SCA) and the form is shown again, the nonce on that re-generated checkout form will not be specific to the newly created user object. This will cause nonce verification to fail when the form is then submitted again.

This PR adds JS to update the nonce value when the checkout form is displayed to ensure that we have the correct nonce value for the current user.

How to test the changes in this Pull Request:

  1. Set up site with Stripe
  2. Check out as new user using Stripe SCA test card
  3. Choose to authenticate successfully
  4. See that nonce fails before PR, but succeeds afterwards

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@dparker1005 dparker1005 merged commit 8f06efb into strangerstudios:dev Apr 18, 2024
@dparker1005 dparker1005 deleted the update-nonce-ajax branch April 18, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant