Create a gist now

Instantly share code, notes, and snippets.

function stripeResponseHandler(status, response) {
if (response.error) {
else {
var form$ = $("#stripe-form");
var token = response['id'];
form$.append("<input type='hidden' name='stripeToken' value='" + token + "'/>");
$(document).ready(function() {
$("#stripe-form").submit(function(event) {
$('.submit').attr("disabled", "disabled");
number: $('.credit-number').val(),
cvc: $('.credit-security').val(),
exp_month: $('.card-expiry-month').val(),
exp_year: $('.card-expiry-year').val()
}, stripeResponseHandler);
// prevent the form from submitting with the default action
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment