add a success message
This commit is contained in:
parent
057d204b87
commit
1933272154
|
@ -41,6 +41,7 @@ export default Ember.Component.extend({
|
|||
this.get('stripe').createToken(this.get('card')).then(data => {
|
||||
|
||||
self.set('result', null);
|
||||
self.set('success', false);
|
||||
|
||||
if (data.error) {
|
||||
self.set('result', data.error.message);
|
||||
|
@ -54,6 +55,7 @@ export default Ember.Component.extend({
|
|||
};
|
||||
|
||||
ajax('/charges', { data: params, method: 'post' }).then(data => {
|
||||
if(data.status == 'succeeded') { self.set('success', true) };
|
||||
self.set('transactionInProgress', false);
|
||||
self.set('result', data.outcome.seller_message);
|
||||
});
|
||||
|
|
|
@ -30,4 +30,8 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if success}}
|
||||
<span>{{i18n 'discourse_donations.messages.success'}}</span>
|
||||
{{/if}}
|
||||
</form>
|
||||
|
|
|
@ -5,5 +5,5 @@ en:
|
|||
amount: Betrag
|
||||
card: Kreditkarte oder Bankkarte
|
||||
submit: Spende bezahlen
|
||||
currency: Currency
|
||||
hide_zip_code: Hide Zip Code
|
||||
messages:
|
||||
success: Thank you for your donation!
|
||||
|
|
|
@ -5,3 +5,5 @@ en:
|
|||
amount: Amount
|
||||
card: Credit or debit card
|
||||
submit: Make Payment
|
||||
messages:
|
||||
success: Thank you for your donation!
|
||||
|
|
Loading…
Reference in New Issue