• Resolved mlacecilia

    (@mlacecilia)


    I’m testing my first plugin install.
    My page is based on multiple payment buttons and shows correctly, but the buttons don’t trigger the expected action and debugger shows some error:

    Uncaught ReferenceError: stripeHandlerNG is not defined
    at HTMLDocument.<anonymous> ((index):53)
    at j (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at Function.ready (jquery.js:2)
    at HTMLDocument.K (jquery.js:2)

    Access to XMLHttpRequest at ‘https://checkout.stripe.com/v3/checkout/button.css&#8217; from origin ‘https://thc.mlacecilia.com&#8217; has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

    Any hint about?
    TIA

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Alexander C.

    (@alexanderfoxc)

    Hi.

    The reason why buttons aren’t clickable is not related to CORS error, but rather the absence of stripe-handler-ng.js script on the page. Some plugin or theme config prevents it from being loaded.

    Try to switch your theme to one of the default WP themes and see if it works. If it is, then let me know which theme and\or pagebuilder you’re using on your website so I can try to reproduce the issue on my test server.

    Thread Starter mlacecilia

    (@mlacecilia)

    Hi Alexander,
    you’re right.
    Switching back to default theme solves the issue.

    Unluckily I’m working on a site developed some year ago by other guys.
    Maybe the culprit could be the obsolete “WP exec PHP” plugin that’s denying also to update to newer PHP version?
    I need to stay to PHP 7.3.11 otherwise the site stop to work.

    Plugin Contributor Alexander C.

    (@alexanderfoxc)

    I think the issue is caused by your custom theme. As a guess, I think it’s missing some default WP routines which many plugins (including ours) rely on.

    It’s difficult to see what’s wrong without being able to see source code of your theme, but I’d suggest you to have a look at it and make sure both wp_head(); and wp_footer(); lines are there. wp_head(); should be in your theme’s header.php file and wp_footer(); should be in footer.php (if your theme have those files).

    Also you don’t need to update to newer version of PHP for Stripe Payments plugin to operate, as the issue it not related to PHP version.

    Thread Starter mlacecilia

    (@mlacecilia)

    Again, you was right.
    Both wp_footer() and wp_head() was missing in the custom theme.
    After adding them into respective files the plugin is working flawlessly.
    I’m very much satisfied by plugin behaviour and support.
    Thanks a lot!

    Maurizio

    • This reply was modified 6 years ago by mlacecilia.
    Plugin Contributor Alexander C.

    (@alexanderfoxc)

    Good to know you got this resolved…

    … and that my psychic abilities are not rusted 🙂

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

The topic ‘stripeHandlerNG and CORS issue’ is closed to new replies.