• Resolved alexstillwagon

    (@alexstillwagon)


    The PMP plugin will not process credit cards using Stripe. When a user submits the form the validation fails giving the error “Please complete all required fields.” (All fields are complete.)

    Console throws the following error on the checkout page load:

    Uncaught ReferenceError: Stripe is not defined
    at ?level=1:27

    Which points to:
    =====

    <!–// this identifies your website in the createToken call below

    Stripe.setPublishableKey(‘pk_live_CENSORED’);

    pmpro_require_billing = true;

    var tokenNum = 0;

    ======

    Note the call to the Stripe function.

    The Stripe JS is loading directly from https://js.stripe.com/v2/

    Please help. Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alexstillwagon

    (@alexstillwagon)

    I have found a workaround / patch for the broken code. Manual edit required.

    1. EDIT /paid-memberships-pro/classes/gateways/class.pmprogateway_stripe.php

    2. On line 364 change add_action("wp_head", "pmpro_stripe_javascript"); to add_action("wp_footer", "pmpro_stripe_javascript");

    This will cause the JS to load in the proper order (i.e. after Stripe.js and jQuery) so that the JS call to stripe does not fail.

    Plugin Author Andrew Lima

    (@andrewza)

    Hi @alexstillwagon,

    Thank you for sharing this with us. I will be sure to hand this over to our development team to look into this and apply the code into the next update possible.

    Please do not hesitate to contact us should you have any further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught ReferenceError: Stripe is not defined’ is closed to new replies.