Skip to content

Instantly share code, notes, and snippets.

@tatey
Created January 8, 2014 10:06
Show Gist options
  • Save tatey/8314480 to your computer and use it in GitHub Desktop.
Save tatey/8314480 to your computer and use it in GitHub Desktop.
braintree.onSubmitEncryptForm($form, function(event) {
disableSubmitButton(true);
event.preventDefault();
var payment = Payment($form.serialize());
payment.save(function() {
// Success
window.location = payment.thank_you_url;
}, function() {
// Failure
var failureMessage = 'Payment failed';
$form
.attr('action', data.retry_order_url)
.append(failureMessage);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment