add an error message

This commit is contained in:
Rimian Perkins 2017-03-06 11:25:09 +11:00
parent 7f8330cb62
commit 66b15be4d8
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { getRegister } from 'discourse-common/lib/get-owner';
export default Ember.Component.extend({
donateAmounts: [1, 5, 10, 25],
error_message: null,
result: null,
amount: null,
stripe: null,
@ -33,7 +34,7 @@ export default Ember.Component.extend({
self.set('result', null);
if (result.error) {
console.log(result.error);
self.set('error_message', result.error.message);
}
else {
self.set('transactionInProgress', true);

View File

@ -22,6 +22,10 @@
{{loading-spinner size="small"}}
{{/if}}
{{#if error_message}}
<span class="error">{{error_message}}</span>
{{/if}}
{{#if result}}
<span>{{i18n 'discourse_donations.success'}}</span>
{{/if}}