Skip to content

Commit

Permalink
Added discounts to subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Erin Dalzell authored and Erin Dalzell committed Mar 7, 2018
1 parent 5bd0c1e commit 644c0e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## REQUIREMENTS ##

1. At the moment Charge requires PHP 7.1
1. Charge requires PHP 7.1

## INSTALLATION ##

Expand Down Expand Up @@ -63,6 +63,7 @@ Charge Form, `{{ charge:payment_form }}`

* for a one-time charge pass in the `amount` (in cents), `description`, and optionally the `currency` as parameters on the tag
* for a subscription, have a `plan` field in your form with the Stripe Plan
* if you want to discount the subscription, send a `coupon` value. See [Stripe's documentation](https://stripe.com/docs/subscriptions/discounts) for setting up discounts.
* if you want to redirect the customer after the charge, use a `redirect` parameter
* inside the tag, `success`, `errors` and `details` are available as variables
* outside the tag use `{{ charge:success }}`, `{{ charge:errors }}` and `{{ charge:details }}` instead.
Expand All @@ -73,6 +74,7 @@ Statamic Form, `{{ form:create }}`
* `stripeEmail` or `email` - email of customer
* for a one-time charge, somewhere in your form you need to set the `description`, `amount` (in cents) or `amount_dollars` (like 23.45), and optionally `currency` via `{{ charge:data }}` or a form field
* for a subscription, include a `plan` field along with the above email field. Neither `currency`, `amount` nor `description` are needed for subscriptions
* if you want to discount the subscription, send a `coupon` value. See [Stripe's documentation](https://stripe.com/docs/subscriptions/discounts) for setting up discounts.
* the `customer_id` is available in the `submission` data
* please note the `data-*` attributes on the form items. Those are required.
* use the standard `success` and `error` variables.
Expand Down

0 comments on commit 644c0e4

Please sign in to comment.