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

15 lines
378 B
JavaScript

import { ajax } from "discourse/lib/ajax";
export default Ember.Controller.extend({
actions: {
stripePaymentHandler(paymentMethodId, amount) {
return ajax("/patrons/patrons", {
data: { paymentMethodId, amount },
method: "post"
}).catch(() => {
return { error: 'An error occured while submitting the form.' };
});
},
},
});