[Plugin: Gravity Forms Stripe Add-On] Solution to the Invalid Token Error
-
Didn’t feel right having to pay someone to fix their own plugin.. especially being a dev myself ?? So here is how to fix the Invalid Token error:
-stripe.php line 2103, replace:
$needle = "});" . "}" . "jQuery(document).ready(function($){" . "gformInitSpinner_{$form_id}();";
with
$needle = "} );}jQuery(document).ready(function($){gformInitSpinner_{$form_id}();";
– The error is essentially the new gforms plugin has ONE extra space somewhere where the search and replace happens (right after the first } bracker ). This will allow the stripe js to be inserted again.
– This fix still requires that the form be in Ajax mode, as the insertion point is based on the gform ajax js code.
BONUS
In the backend, my keys would show up as invalid when I put them in. If you are having this issue, try this fix:
– stripe.php near line 663, replace:
Stripe_Token::create( array( 'card' => array( 'number' => '4242424242424242', 'exp_month' => 3, 'exp_year' => $year, 'cvc' => 314 ), 'currency' => 'usd' ) );
with
Stripe_Token::create( array( 'card' => array( 'number' => '4242424242424242', 'exp_month' => 3, 'exp_year' => $year, 'cvc' => 314 )) );
- The topic ‘[Plugin: Gravity Forms Stripe Add-On] Solution to the Invalid Token Error’ is closed to new replies.