Add some billing details
This commit is contained in:
@@ -43,7 +43,9 @@ export default Ember.Component.extend({
|
||||
|
||||
actions: {
|
||||
submitStripeCard() {
|
||||
this.stripe.createPaymentMethod("card", this.card).then(
|
||||
const paymentOptions = { billing_details: this.get("billing") };
|
||||
|
||||
this.stripe.createPaymentMethod("card", this.card, paymentOptions).then(
|
||||
result => {
|
||||
if (result.error) {
|
||||
this.set("cardError", result.error.message);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
goBack() {
|
||||
return DiscourseURL.redirectTo("/patrons");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1 +1,9 @@
|
||||
export default Discourse.Route.extend({});
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
return Ember.Object.create({
|
||||
name: "",
|
||||
email: "",
|
||||
phone: ""
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -44,13 +44,40 @@
|
||||
{{combo-box valueAttribute="value" content=amounts value=amount}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="display-row">
|
||||
<div class="field">
|
||||
{{i18n 'discourse_patrons.billing.name'}}
|
||||
</div>
|
||||
<div class="value">
|
||||
{{input value=billing.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-row">
|
||||
<div class="field">
|
||||
{{i18n 'discourse_patrons.billing.email'}}
|
||||
</div>
|
||||
<div class="value">
|
||||
{{input value=billing.email}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-row">
|
||||
<div class="field">
|
||||
{{i18n 'discourse_patrons.billing.phone'}}
|
||||
</div>
|
||||
<div class="value">
|
||||
{{input value=billing.phone}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="section-column">
|
||||
<div style>
|
||||
{{stripe-card
|
||||
amount=amount
|
||||
currency=currency
|
||||
billing=billing
|
||||
handleConfirmStripeCard=(action "handleConfirmStripeCard")
|
||||
}}
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
<div class="donations-page-payment">
|
||||
{{donation-form
|
||||
billing=model
|
||||
paymentSuccessHandler=(action "paymentSuccessHandler")
|
||||
stripePaymentHandler=(action "stripePaymentHandler")
|
||||
}}
|
||||
|
||||
@@ -5,3 +5,7 @@
|
||||
<div class="donations-page-description">
|
||||
{{cook-text siteSettings.discourse_patrons_success_page}}
|
||||
</div>
|
||||
|
||||
{{#d-button action="goBack" class="btn btn-primary"}}
|
||||
{{i18n 'discourse_patrons.button.success'}}
|
||||
{{/d-button}}
|
||||
|
||||
Reference in New Issue
Block a user