Cloudflare Turnstile with PayPal should prevent spam donations and not record a transaction in PayPal when denied

This is related to our work to make PayPal Donations authorize before capture. It still requires an update to Cloudflare.

Description

Currently, with Cloudflare Turnstile enabled, you will get a “permission denied” when submitting a donation with PayPal, but a transaction will still get processed in PayPal, no donation is recorded in GiveWP.

Steps to Reproduce

  1. Enable Cloudflare turnstile, create a V2 form, and then donate using PayPal.
  2. Observe that you will get “Permission Denied” from Cloudflare Turnstile, but the transaction will still go on to PayPal.
  3. No record of the donation is in GiveWP.

Screenshots / Videos

[https://www.loom.com/share/a119d70258664a06a50c6bb038d105f2?sid=3e7beda7-000c-4f1d-b2d0-6d409a8dfdb7|https://www.loom.com/share/a119d70258664a06a50c6bb038d105f2?sid=3e7beda7-000c-4f1d-b2d0-6d409a8dfdb7|smart-embed]

Options

  • Exclude Cloudflare from prevalidation or server validation (hacky)
  • Re-render the Cloudflare field after the validation hook (most ideal)