show a bootbox message instead of console log

This commit is contained in:
Rimian Perkins 2019-10-24 16:37:14 +11:00
parent eead6fd345
commit 21b27f169a
1 changed files with 2 additions and 10 deletions

View File

@ -13,13 +13,9 @@ export default Ember.Controller.extend({
actions: { actions: {
stripePaymentHandler() { stripePaymentHandler() {
// https://stripe.com/docs/billing/subscriptions/payment#signup-flow
this.stripe.createToken(this.get("cardElement")).then(result => { this.stripe.createToken(this.get("cardElement")).then(result => {
if (result.error) { if (result.error) {
// Inform the customer that there was an error. bootbox.alert(result.error.message);
// var errorElement = document.getElementById('card-errors');
// errorElement.textContent = result.error.message;
} else { } else {
const customerData = { const customerData = {
source: result.token.id source: result.token.id
@ -38,11 +34,7 @@ export default Ember.Controller.extend({
} }
subscription.save().then(() => { subscription.save().then(() => {
console.log('ok'); bootbox.alert("ok payment good... some kind of message");
// return DiscourseURL.redirectTo(
// Discourse.SiteSettings
// .discourse_patrons_subscription_group_landing_page
// );
}); });
}); });
} }