discourse-subscriptions/assets/javascripts/discourse/controllers/patrons-index.js.es6

23 lines
585 B
Plaintext
Raw Normal View History

2019-09-11 07:09:34 -04:00
import { ajax } from "discourse/lib/ajax";
export default Ember.Controller.extend({
actions: {
2019-09-12 23:46:32 -04:00
stripePaymentHandler(data) {
2019-09-11 08:06:01 -04:00
return ajax("/patrons/patrons", {
2019-09-12 23:46:32 -04:00
data,
2019-09-11 07:09:34 -04:00
method: "post"
}).catch(() => {
2019-09-11 17:14:16 -04:00
return { error: "An error occured while submitting the form." };
2019-09-11 07:09:34 -04:00
});
2019-09-11 17:43:27 -04:00
},
2019-10-29 23:19:43 -04:00
paymentSuccessHandler(/* paymentIntentId */) {
bootbox.alert(I18n.t("discourse_patrons.transactions.payment.success"));
2019-10-24 23:00:59 -04:00
this.transitionToRoute(
"user.billing",
Discourse.User.current().username.toLowerCase()
);
2019-09-11 17:14:16 -04:00
}
}
2019-09-11 07:09:34 -04:00
});