add success handler

This commit is contained in:
Rimian Perkins 2019-09-12 07:43:27 +10:00
parent fdd4d1ed5f
commit 36c1731565
4 changed files with 7 additions and 1 deletions

View File

@ -34,7 +34,7 @@ export default Ember.Component.extend({
if (paymentIntent.error) {
this.set("paymentError", paymentIntent.error);
} else {
// console.log('ok done');
this.paymentSuccessHandler();
}
}
);

View File

@ -9,6 +9,10 @@ export default Ember.Controller.extend({
}).catch(() => {
return { error: "An error occured while submitting the form." };
});
},
paymentSuccessHandler() {
DiscourseURL.redirectTo("patrons/thanks");
}
}
});

View File

@ -7,6 +7,7 @@
<div class="donations-page-payment">
{{donation-form
paymentSuccessHandler=(action "paymentSuccessHandler")
stripePaymentHandler=(action "stripePaymentHandler")
}}
</div>

1
jsapp Symbolic link
View File

@ -0,0 +1 @@
assets/javascripts/discourse