From 70b928707f2a365b51e9198eacddda1592930cb6 Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Mon, 29 May 2017 10:48:32 +1000 Subject: [PATCH] disable the button as soon as it is clicked --- assets/javascripts/discourse/components/stripe-card.js.es6 | 4 +++- plugin.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/stripe-card.js.es6 b/assets/javascripts/discourse/components/stripe-card.js.es6 index 606670b..14e50ca 100644 --- a/assets/javascripts/discourse/components/stripe-card.js.es6 +++ b/assets/javascripts/discourse/components/stripe-card.js.es6 @@ -52,15 +52,17 @@ export default Ember.Component.extend({ submitStripeCard() { let self = this; + self.set('transactionInProgress', true); + this.get('stripe').createToken(this.get('card')).then(data => { self.set('result', []); if (data.error) { self.set('result', data.error.message); + self.endTranscation(); } else { - self.set('transactionInProgress', true); let params = { stripeToken: data.token.id, diff --git a/plugin.rb b/plugin.rb index e41d108..50805b5 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,6 +1,6 @@ # name: discourse-donations # about: Integrating Discourse with Stripe for donations -# version: 1.11.0 +# version: 1.11.1 # url: https://github.com/choiceaustralia/discourse-donations # authors: Rimian Perkins