• Quim

    (@quim-codina)


    In the checkout page, if the user does not fill in the Stripe fields or the payment fails, a javascript error is triggered and the page is reloaded.

    Uncaught ReferenceError: rcpStripeEnableForm is not defined

    The rcpStripeEnableForm function is defined in the register.js file but not in the register.min.js file.

    restrict-content/core/includes/gateways/stripe/js/register.js
    restrict-content/core/includes/gateways/stripe/js/register.min.js

    This also happens in the Pro version

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The rcpStripeEnableForm function is defined in the register.js file but not in the register.min.js file.

    Minified versions of the .js file may not contain the same variable names as the unminified versions.

    I would strongly assume that …min.js is based on register.js, hence, the error would not be that you don’t find rcpStripeEnableForm in …min.js.

    Thread Starter Quim

    (@quim-codina)

    Thank you for your response.

    I have an old version of the Pro plugin and in the register.min.js file the rcpStripeEnableForm function is defined with this name.

    In my case I fixed it by removing .min from file’s url.

    add_filter('script_loader_src', function ($src, $handle) {
        if ($handle === 'rcp-stripe-register') {
            $src = str_replace('.min', '', $src);
        }
        return $src;
    }, 10, 2);

    I opened this topic so that the plugin authors can review it in the next updates.

    cerrone

    (@cerrone)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘rcpStripeEnableForm is not defined’ is closed to new replies.