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

20 lines
491 B
Plaintext
Raw Normal View History

2019-09-11 17:58:08 -04:00
import DiscourseURL from "discourse/lib/url";
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-09-14 04:31:11 -04:00
paymentSuccessHandler(paymentIntentId) {
// DiscourseURL.redirectTo(`patrons/${paymentIntentId}`);
2019-09-11 17:14:16 -04:00
}
}
2019-09-11 07:09:34 -04:00
});