the form submits but an ajax error happens

This commit is contained in:
Rimian Perkins 2019-09-11 21:52:04 +10:00
parent 02c9ea873a
commit df1d5a3181
4 changed files with 8 additions and 6 deletions

View File

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

View File

@ -1,8 +1,8 @@
<h3>{{i18n 'discourse_donations.title' site_name=siteSettings.title}}</h3> <h3>{{i18n 'discourse_patrons.title' site_name=siteSettings.title}}</h3>
<div class="donations-page-description"> <div class="donations-page-description">
{{cook-text siteSettings.discourse_donations_page_description}} {{cook-text siteSettings.discourse_patrons_page_description}}
</div> </div>
<div class="donations-page-payment"> <div class="donations-page-payment">

View File

@ -1,5 +1,5 @@
.discourse-donations-section-columns { .discourse-patrons-section-columns {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -37,7 +37,7 @@
padding: 20px 0; padding: 20px 0;
} }
.discourse-donations-section-columns { .discourse-patrons-section-columns {
margin: 20px; margin: 20px;
padding: 20px; padding: 20px;
border: 1px $primary-low-mid solid; border: 1px $primary-low-mid solid;
@ -48,7 +48,7 @@
margin: 20px 0; margin: 20px 0;
} }
.discourse-donations-confirmation { .discourse-patrons-confirmation {
width: 100%; width: 100%;
td { td {