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

15 lines
376 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: {
stripePaymentHandler(paymentMethodId, amount) {
2019-09-11 08:06:01 -04:00
return ajax("/patrons/patrons", {
2019-09-11 07:09:34 -04:00
data: { paymentMethodId, amount },
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:14:16 -04:00
}
}
2019-09-11 07:09:34 -04:00
});