• Resolved allanjardine

    (@allanjardine)


    I’ve setup “Simple CAPTCHA Alternative with Cloudflare Turnstile” on my site, but when I enable it for WooCommerce Forms (on checkout, before payment), the turnstile widget shows up, but not completing it doesn’t stop the user from clicking on the Paypal pay button, and the Paypal payment screen showing up. I’d expected either the button to be blocked or for an error to be shown saying to complete the Turnstile challenge (similar to what happens if the T&Cs checkbox isn’t selected).

    Do I need to do something else to stop the Paypal button from bypassing Turnstile?

    I don’t have other payment methods configured on the site, so I haven’t been able to check it with Stripe or similar.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter allanjardine

    (@allanjardine)

    After a bit of poking around I could that the woocommerce_checkout_process action wasn’t being triggered:

    add_action('woocommerce_checkout_process', 'cfturnstile_woo_checkout_check');

    This thread suggests that woocommerce_checkout_process is not called until after the Paypal order is created, which seems too late. Hooking into the woocommerce_after_checkout_validation action appears to allow it to work as expected:

    add_action('woocommerce_after_checkout_validation', 'cfturnstile_woo_checkout_check');

    Did you just paste that line of code into a snippet? Or do we need anything else from that thread you posted?

    Thread Starter allanjardine

    (@allanjardine)

    Hi,

    Thanks for the reply. I ended up modifying the plugin code slightly to add that extra action hook. It has been working well for me over the last month.

    Allan

    is it possible to post what you ended up using? I am ripping my hair out over here because of this lol.

    Thread Starter allanjardine

    (@allanjardine)

    In this file I added:

    add_action('woocommerce_after_checkout_validation', 'cfturnstile_woo_checkout_check');

    in between lines 87 and 88. i.e. it now looks like:

            // Check Turnstile
    add_action('woocommerce_checkout_process', 'cfturnstile_woo_checkout_check');
    add_action('woocommerce_after_checkout_validation', 'cfturnstile_woo_checkout_check');
    function cfturnstile_woo_checkout_check() {

    That was the only change I needed.

    Hi,

    This fix will be applied in the next update.

    Thread Starter allanjardine

    (@allanjardine)

    That’s super – thank you!

    thank you for sharing the code! And HURRAY for the fix! 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘WooCommerce turnstile being ignored’ is closed to new replies.