fix snake case
This commit is contained in:
@@ -26,13 +26,19 @@ export default Ember.Component.extend({
|
||||
this.set("confirmation", false);
|
||||
},
|
||||
|
||||
handleConfirmStripeCard(paymentMethod) {
|
||||
handleConfirmStripeCard(paymentMethod, receiptEmail) {
|
||||
this.set("receiptEmail", receiptEmail);
|
||||
this.set("confirmation", paymentMethod);
|
||||
},
|
||||
|
||||
confirmStripeCard() {
|
||||
const paymentMethodId = this.confirmation.id;
|
||||
this.stripePaymentHandler(paymentMethodId, this.amount).then(
|
||||
const data = {
|
||||
paymentMethodId: this.confirmation.id,
|
||||
amount: this.amount,
|
||||
receiptEmail: this.receiptEmail
|
||||
};
|
||||
|
||||
this.stripePaymentHandler(data).then(
|
||||
paymentIntent => {
|
||||
if (paymentIntent.error) {
|
||||
this.set("paymentError", paymentIntent.error);
|
||||
|
||||
@@ -62,7 +62,10 @@ export default Ember.Component.extend({
|
||||
if (result.error) {
|
||||
this.set("cardError", result.error.message);
|
||||
} else {
|
||||
this.handleConfirmStripeCard(result.paymentMethod);
|
||||
this.handleConfirmStripeCard(
|
||||
result.paymentMethod,
|
||||
this.get("billing.email")
|
||||
);
|
||||
}
|
||||
},
|
||||
() => {
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
stripePaymentHandler(paymentMethodId, amount) {
|
||||
stripePaymentHandler(data) {
|
||||
return ajax("/patrons/patrons", {
|
||||
data: { paymentMethodId, amount },
|
||||
data,
|
||||
method: "post"
|
||||
}).catch(() => {
|
||||
return { error: "An error occured while submitting the form." };
|
||||
|
||||
@@ -10,11 +10,13 @@ export default Discourse.Route.extend({
|
||||
|
||||
return ajax("/patrons/patrons", {
|
||||
method: "get"
|
||||
}).then((result) => {
|
||||
user.set('email', result.email);
|
||||
return user;
|
||||
}).catch(() => {
|
||||
return user;
|
||||
});
|
||||
})
|
||||
.then(result => {
|
||||
user.set("email", result.email);
|
||||
return user;
|
||||
})
|
||||
.catch(() => {
|
||||
return user;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<div class="value">
|
||||
{{input type="email" value=billing.email}}
|
||||
<div class="desc">{{i18n 'discourse_patrons.payment.email_info'}}</div>
|
||||
<div class="desc">{{i18n 'discourse_patrons.payment.receipt_info'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-row">
|
||||
|
||||
Reference in New Issue
Block a user