mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-08 15:22:46 +00:00
Add some billing details
This commit is contained in:
parent
a87fcae149
commit
9b69c58be4
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Accept payments from visitors to your [Discourse](https://www.discourse.org/) application. Integrates with [Stripe](https://stripe.com).
|
Accept payments from visitors to your [Discourse](https://www.discourse.org/) application. Integrates with [Stripe](https://stripe.com).
|
||||||
|
|
||||||
This is a newer version of https://github.com/rimian/discourse-donations. Many thanks to Chris Beach and Angus McLeod who helped on that project.
|
This is a newer version of https://github.com/rimian/discourse-donations.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -28,3 +28,7 @@ Test with these credit card numbers:
|
|||||||
## Warranty
|
## Warranty
|
||||||
|
|
||||||
This software comes without warranties or conditions of any kind.
|
This software comes without warranties or conditions of any kind.
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
|
Many thanks to Chris Beach and Angus McLeod who helped on the previous version of this plugin.
|
||||||
|
@ -43,7 +43,9 @@ export default Ember.Component.extend({
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
submitStripeCard() {
|
submitStripeCard() {
|
||||||
this.stripe.createPaymentMethod("card", this.card).then(
|
const paymentOptions = { billing_details: this.get("billing") };
|
||||||
|
|
||||||
|
this.stripe.createPaymentMethod("card", this.card, paymentOptions).then(
|
||||||
result => {
|
result => {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
this.set("cardError", result.error.message);
|
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}}
|
{{combo-box valueAttribute="value" content=amounts value=amount}}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
<div class="section-column">
|
<div class="section-column">
|
||||||
<div style>
|
<div style>
|
||||||
{{stripe-card
|
{{stripe-card
|
||||||
amount=amount
|
amount=amount
|
||||||
currency=currency
|
currency=currency
|
||||||
|
billing=billing
|
||||||
handleConfirmStripeCard=(action "handleConfirmStripeCard")
|
handleConfirmStripeCard=(action "handleConfirmStripeCard")
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<div class="donations-page-payment">
|
<div class="donations-page-payment">
|
||||||
{{donation-form
|
{{donation-form
|
||||||
|
billing=model
|
||||||
paymentSuccessHandler=(action "paymentSuccessHandler")
|
paymentSuccessHandler=(action "paymentSuccessHandler")
|
||||||
stripePaymentHandler=(action "stripePaymentHandler")
|
stripePaymentHandler=(action "stripePaymentHandler")
|
||||||
}}
|
}}
|
||||||
|
@ -5,3 +5,7 @@
|
|||||||
<div class="donations-page-description">
|
<div class="donations-page-description">
|
||||||
{{cook-text siteSettings.discourse_patrons_success_page}}
|
{{cook-text siteSettings.discourse_patrons_success_page}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#d-button action="goBack" class="btn btn-primary"}}
|
||||||
|
{{i18n 'discourse_patrons.button.success'}}
|
||||||
|
{{/d-button}}
|
||||||
|
@ -21,9 +21,11 @@ en:
|
|||||||
payment_information: Credit card information
|
payment_information: Credit card information
|
||||||
submit: Make payment $
|
submit: Make payment $
|
||||||
confirm: Confirm payment $
|
confirm: Confirm payment $
|
||||||
invoice: "invoice"
|
billing:
|
||||||
invoice_prefix: "You gave"
|
name: Full name
|
||||||
receipt: "Receipt sent to {{email}}."
|
email: Email
|
||||||
confirmation:
|
confirmation:
|
||||||
amount: Amount $
|
amount: Amount $
|
||||||
last4: Card number
|
last4: Card number
|
||||||
|
buttons:
|
||||||
|
success: Go back
|
||||||
|
Loading…
x
Reference in New Issue
Block a user