diff --git a/app/assets/javascripts/admin/payments/services/stripe_elements.js.coffee b/app/assets/javascripts/admin/payments/services/stripe_elements.js.coffee index 9ecf2b1db1f3..e777ec2910d1 100644 --- a/app/assets/javascripts/admin/payments/services/stripe_elements.js.coffee +++ b/app/assets/javascripts/admin/payments/services/stripe_elements.js.coffee @@ -14,6 +14,7 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta @stripe.createToken(@card, cardData).then (response) => if(response.error) StatusMessage.display 'error', response.error.message + console.log(JSON.stringify(response.error)) else secrets.token = response.token.id secrets.cc_type = @mapCC(response.token.card.brand) @@ -29,9 +30,10 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta @stripe.createPaymentMethod({ type: 'card', card: @card }, @card, cardData).then (response) => if(response.error) StatusMessage.display 'error', response.error.message + console.log(JSON.stringify(response.error)) else secrets.token = response.paymentMethod.id - secrets.cc_type = response.paymentMethod.card.brand + secrets.cc_type = @mapCC(response.paymentMethod.card.brand) secrets.card = response.paymentMethod.card submit() diff --git a/app/assets/javascripts/darkswarm/services/stripe_elements.js.coffee b/app/assets/javascripts/darkswarm/services/stripe_elements.js.coffee index acd220f092e5..6e5bfc79fb28 100644 --- a/app/assets/javascripts/darkswarm/services/stripe_elements.js.coffee +++ b/app/assets/javascripts/darkswarm/services/stripe_elements.js.coffee @@ -15,6 +15,7 @@ Darkswarm.factory 'StripeElements', ($rootScope, Loading, RailsFlashLoader) -> if(response.error) Loading.clear() RailsFlashLoader.loadFlash({error: t("error") + ": #{response.error.message}"}) + console.log(JSON.stringify(response.error)) else secrets.token = response.token.id secrets.cc_type = @mapCC(response.token.card.brand) @@ -32,9 +33,10 @@ Darkswarm.factory 'StripeElements', ($rootScope, Loading, RailsFlashLoader) -> if(response.error) Loading.clear() RailsFlashLoader.loadFlash({error: t("error") + ": #{response.error.message}"}) + console.log(JSON.stringify(response.error)) else secrets.token = response.paymentMethod.id - secrets.cc_type = response.paymentMethod.card.brand + secrets.cc_type = @mapCC(response.paymentMethod.card.brand) secrets.card = response.paymentMethod.card submit()