Anyone?
Stripe Customer cant be charged with active card
I have posted this question maybe one too many times. But I am still struggling with this error. I am working on the Stripe Checkout Series episode 2 titled Custom Checkout.
I have added the 'e' parameter and added the e.preventDefault() - just as Jeffery has as a fix to the error he received. I am still getting that same error whether I have the e.preventDefault or not.
Here is the code:
document.querySelector('button').addEventListener('click', function(e) { stripe.open({
name: 'My Book',
description: 'Book Description',
zipCode: true,
amount:4500
});
e.preventDefault();
});
Here is the error output:
Card in ApiRequestor.php line 112:
Cannot charge a customer that has no active card 1.in ApiRequestor.php line 112 2.at ApiRequestor->handleApiError('{ "error": { "message": "Cannot charge a customer that has no active card", "type": "card_error", "param": "card", "code": "missing" } } ', '402', array('Server' => 'nginx', 'Date' => 'Sat, 03 Dec 2016 19:40:02 GMT', 'Content-Type' => 'application/json', 'Content-Length' => '157', 'Connection' => 'keep-alive', 'Access-Control-Allow-Credentials' => 'true', 'Access-Control-Allow-Methods' => 'GET, POST, HEAD, OPTIONS, DELETE', 'Access-Control-Allow-Origin' => '*', 'Access-Control-Max-Age' => '300', 'Cache-Control' => 'no-cache, no-store', 'Request-Id' => 'req_9g5Xb6TP2RevCk', 'Stripe-Version' => '2016-07-06'), array('error' => array('message' => 'Cannot charge a customer that has no active card', 'type' => 'card_error', 'param' => 'card', 'code' => 'missing'))) in ApiRequestor.php line 259
I have followed episode 1 and 2 to the last detail. Every piece of code matches Jefferys. Could it be version errors? - I am running php 7 and laravel 5.3
Any reason why I am still getting that error?
Please or to participate in this conversation.