Fix bug where ticket payment form doesn't work

This commit is contained in:
Eric 2019-05-30 13:05:11 -05:00 committed by Eric Schultz
parent cd5b5c038e
commit e8b581e657

View file

@ -57,6 +57,7 @@ function create_card(holder, card_obj, options) {
// First, tokenize the card with Stripe.js
return tokenize_with_stripe(card_obj)
.catch(display_stripe_err)
// Then, save a Card record in our db
.then(function(stripe_resp) {
appl.def('card_form', statuses.before_create)
@ -112,3 +113,17 @@ function display_err(resp) {
appl.def('loading', false)
}
}
function display_stripe_err(resp) {
if(resp && resp.error) {
appl.def('card_form', {
loading: false,
error: true,
status: resp.error.message,
progress_width: '0%'
})
appl.def('loading', false)
throw new Error()
}
}