Merge branch 'messages' into staging

This commit is contained in:
Rimian Perkins 2017-03-13 15:26:56 +11:00
commit 3dd9f8c393
5 changed files with 11 additions and 3 deletions

View File

@ -41,6 +41,7 @@ export default Ember.Component.extend({
this.get('stripe').createToken(this.get('card')).then(data => { this.get('stripe').createToken(this.get('card')).then(data => {
self.set('result', null); self.set('result', null);
self.set('success', false);
if (data.error) { if (data.error) {
self.set('result', data.error.message); self.set('result', data.error.message);
@ -54,6 +55,7 @@ export default Ember.Component.extend({
}; };
ajax('/charges', { data: params, method: 'post' }).then(data => { ajax('/charges', { data: params, method: 'post' }).then(data => {
if(data.status == 'succeeded') { self.set('success', true) };
self.set('transactionInProgress', false); self.set('transactionInProgress', false);
self.set('result', data.outcome.seller_message); self.set('result', data.outcome.seller_message);
}); });

View File

@ -30,4 +30,8 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
{{#if success}}
<span>{{i18n 'discourse_donations.messages.success'}}</span>
{{/if}}
</form> </form>

View File

@ -5,5 +5,5 @@ en:
amount: Betrag amount: Betrag
card: Kreditkarte oder Bankkarte card: Kreditkarte oder Bankkarte
submit: Spende bezahlen submit: Spende bezahlen
currency: Currency messages:
hide_zip_code: Hide Zip Code success: Thank you for your donation!

View File

@ -5,3 +5,5 @@ en:
amount: Amount amount: Amount
card: Credit or debit card card: Credit or debit card
submit: Make Payment submit: Make Payment
messages:
success: Thank you for your donation!

View File

@ -1,6 +1,6 @@
# name: discourse-donations # name: discourse-donations
# about: Integrating Discourse with Stripe for donations # about: Integrating Discourse with Stripe for donations
# version: 1.9.1 # version: 1.9.2
# url: https://github.com/choiceaustralia/discourse-donations # url: https://github.com/choiceaustralia/discourse-donations
# authors: Rimian Perkins # authors: Rimian Perkins