Hey Jonathan,
Stripe.js doesn’t return these checks, Stripe checkout does if you pass the amount parameter (it just does a quick authorization on the card).
I saw this hack on some random tutorial / sample code somewhere and it looks like if you pass an amount as the second parameter to createToken, testing with some test card numbers, it functions the same way Checkout does by doing that authorization.
For example:
$("#customButton").on("click", function() {
Stripe.card.createToken({
number: $('#cardNumber').val(),
cvc: $('#CVC').val(),
exp_month: $('#expMonth').val(),
exp_year: $('#expYear').val()
},100, stripeResponseHandler);
});
Note this isn’t documented anywhere, and I suppose is subject to all the risks that come with using undocumented stuff, but it does save you from using Checkout.
Also note that the authorization is normally just for $0 or $1 so the charge you attempt to make for can still be declined for insufficient funds or some other reason.
--
Matt Arkin
Kollective Solutions