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

Fixing reCAPTCHA and payment request button at checkout #3094

Merged

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

There are two main fixes here:

In pmpro-recaptcha-v3.js, we were validating reCAPTCHA when the submit button was clicked. This did not run in cases where the checkout form was submitted via JS. To fix this behavior, this PR updates the validation to occur when the form is submitted. This is closer to how we validate the reCAPTCHA v2 as well.

In pmpro-stripe.js, we had code to "force submit" the checkout form with form.get(0).submit(); after the payment request button was used or 3DS verification was completed. Although this worked for most use-cases, it prevents code running on the jQuery .submit() method to run. This prevented our new reCAPTCHA v3 code (and I assume the old v2 code) from running. The fix here was to just call form.submit();, which still allows .submit() methods to run.

Resolves XXX.

How to test the changes in this Pull Request:

  1. Set up reCATCHA v3 and the Stripe payment request button
  2. Check out with Apple/Google Pay
  3. See that before PR, "missing input" error is shown. After PR, the checkout works as expected

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?

@dparker1005 dparker1005 merged commit a8d6103 into strangerstudios:dev Aug 2, 2024
@dparker1005 dparker1005 deleted the checkout-js-submit-fixes branch August 2, 2024 15:17
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