show success message

This commit is contained in:
Rimian Perkins
2017-05-24 13:55:04 +10:00
parent 1853bdd6f5
commit 3c431b9915
3 changed files with 8 additions and 1 deletions
@@ -47,6 +47,8 @@ module DiscourseDonations
end
if charge['paid'] == true || charge['status'] == 'active'
output['success'] = true
output['messages'] << I18n.t('donations.payment.success')
output['rewards'] << { type: :group, name: group_name } if group_name
@@ -90,6 +90,9 @@ export default Ember.Component.extend({
ajax('/charges', { data: params, method: 'post' }).then(data => {
self.concatMessages(data.messages);
self.endTranscation();
if(data.success) {
self.setSuccess();
}
});
}
}
@@ -93,7 +93,9 @@
{{/each}}
{{#if success}}
<p>{{i18n 'discourse_donations.messages.success'}}</p>
{{#if create_accounts}}
<p>Please <strong>check your email</strong> to get your log in link.</p>
{{/if}}
{{/if}}
</div>
</div>