• Resolved WhitePointerNet

    (@whitepointernet)


    Having an issue with the payments not going through for the Stripe Subscription buttons just created on my new page.
    The test “Buy Now” button under “option 2” is where the subscription should be purchased from however when clicked it throws an error instead.

    Here is a line extracted from the code in question which is controlling the Stripe payments:

    jQuery(‘#swpm-stripe-payment-form-cfe7fb9ce248172abae28a459c2c2f21’).on(‘submit’,function(e) {

    This gets pointed out to have an error via the Chrome web inspector:
    Uncaught TypeError: jQuery(…).on is not a function.

    Anyone know how to work around this issue?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, are you running a cache plugin in your site? Also, I tested the URL above and the buttons are not clickable.

    Did you follow the instructions in the documentation below when you created the subscription button?

    https://simple-membership-plugin.com/sca-compliant-stripe-subscription-button/

    Regards.

    Thread Starter WhitePointerNet

    (@whitepointernet)

    Hi, thanks for your swift reply.

    There is Hummingbird caching all but that page and I have even tested the button with all plugins disabled except Simple WordPress Membership to no avail (the test button is the blue one that says “buy now” under the two unclickable buttons – those don’t work because the javascript is failing, they just don’t let you see the error page as that does).

    I actually followed the instructions in your provided link verbatim on my client’s Stipe account and the Website. FYI The website is running the latest Divi theme and WordPress. All site health checks show up ok. I’ve seen lots of threads relating to this as the resultant error code output:

    Fatal error! Payment with ref_id swpm_3c00eff0b05907f9acdd1cd53dd02525|1054 can’t be found

    In my case 1054 is the button ID and everything after swpm_ is just a temporary key I believe.
    I’ve seen the solutions regarding clearing cache, disabling cache and other plugins to diagnose – all done yet still not working. I’ve disabled all of the outgoing connection security on the host to see if it was getting blocked, even disabled the host firewall in addition to everything else yet still the same error keeps coming.

    So I’m here hoping to see some new advice become available as two days have been used scouring the web for answers to this now and some cases still remain unsolved. The solved ones I found here, Stacks and my other regular haunts still didn’t work for me.

    Thanks again and kind regards,

    Thread Starter WhitePointerNet

    (@whitepointernet)

    Found and completely solved the issue – Big shout out to Dan Mossop, developer for Divi Booster. He found this issue and it turns out the latest Divi updates have included a new “Performance” tab in the Divi Theme Options which has pre set jQuery deferral as a performance enhancement.

    Now he has made those two unclickable buttons working I can remove the test button which still does not work on its own page.

    I am very glad I purchased the Divi Booster Simple Membership Payment Button Module as without it I would have to disable that performance enhancement on all of the pages on my site.

    For everyone who runs Divi and does not have that plugin, the update to Divi will break the same functionality in all of theirs too. I suggest you get the developers to add an exception like Dan in his plugin which disables jQuery deferral on pages the button appears on.

    Happy to help, @whitepointernet

    To add to your recommendation to developers, I’ve found two ways to disable the jQuery deferral programmatically in Divi:

    1) Require jQuery as a dependency of your script when you enqueue it – in that case Divi should disable jQuery deferral itself.

    2) Use the following filter:

    add_filter('et_builder_enable_jquery_body', '__return_false');

    If you need to check for the presence of your button in the content to determine whether or not to disable deferral, you can get the page content as the second parameter to the callback, like so:

    add_filter('et_builder_enable_jquery_body', 'wpo_maybe_disable_jquery_deferral', 10, 2); 
    
    function wpo_maybe_disable_jquery_deferral($enabled, $content='') {
        return false !== strpos( $content, 'something-that-matches-your-button' ) ? false : $enabled;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Uncaught TypeError: jQuery(…).on is not a function.’ is closed to new replies.