From 948399662d71a0d1cbdb30b2323bb85a56bbd2d3 Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Fri, 25 Oct 2019 13:40:03 +1100 Subject: [PATCH] transition to billing after payment --- assets/javascripts/discourse/controllers/patrons-index.js.es6 | 4 ++-- .../discourse/controllers/patrons-subscribe.js.es6 | 1 + assets/javascripts/discourse/routes/user-billing.js.es6 | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/discourse/controllers/patrons-index.js.es6 b/assets/javascripts/discourse/controllers/patrons-index.js.es6 index ad83561..516acba 100644 --- a/assets/javascripts/discourse/controllers/patrons-index.js.es6 +++ b/assets/javascripts/discourse/controllers/patrons-index.js.es6 @@ -1,4 +1,3 @@ -import DiscourseURL from "discourse/lib/url"; import { ajax } from "discourse/lib/ajax"; export default Ember.Controller.extend({ @@ -13,7 +12,8 @@ export default Ember.Controller.extend({ }, paymentSuccessHandler(paymentIntentId) { - DiscourseURL.redirectTo(`patrons/${paymentIntentId}`); + bootbox.alert("ok payment good... some kind of message"); + this.transitionToRoute("user.billing", Discourse.User.current().username.toLowerCase()); } } }); diff --git a/assets/javascripts/discourse/controllers/patrons-subscribe.js.es6 b/assets/javascripts/discourse/controllers/patrons-subscribe.js.es6 index 671cce3..cbb98be 100644 --- a/assets/javascripts/discourse/controllers/patrons-subscribe.js.es6 +++ b/assets/javascripts/discourse/controllers/patrons-subscribe.js.es6 @@ -35,6 +35,7 @@ export default Ember.Controller.extend({ subscription.save().then(() => { bootbox.alert("ok payment good... some kind of message"); + this.transitionToRoute("user.billing", Discourse.User.current().username.toLowerCase()); }); }); } diff --git a/assets/javascripts/discourse/routes/user-billing.js.es6 b/assets/javascripts/discourse/routes/user-billing.js.es6 index 8b2ee5b..f78ad8e 100644 --- a/assets/javascripts/discourse/routes/user-billing.js.es6 +++ b/assets/javascripts/discourse/routes/user-billing.js.es6 @@ -1,7 +1,6 @@ export default Discourse.Route.extend({ model() { - console.log('billing'); return {}; },