https://github.com/statamic/stripe
Statamic v2 addon to simplify Stripe Checkout
https://github.com/statamic/stripe
addon statamic statamic-v2 stripe
Last synced: 10 months ago
JSON representation
Statamic v2 addon to simplify Stripe Checkout
- Host: GitHub
- URL: https://github.com/statamic/stripe
- Owner: statamic
- Created: 2016-06-02T19:18:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-02T16:15:59.000Z (over 9 years ago)
- Last Synced: 2025-02-15T20:57:08.695Z (12 months ago)
- Topics: addon, statamic, statamic-v2, stripe
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stripe
This tag acts as some syntactic sugar for [Stripe Checkout][checkout]. It simplifies your templates.
The server-side processing is up to you.
### Stripe.js
A shortcut to placing Stripe.js on your page. Put this at the bottom of your layout.
```
{{ stripe:js }}
Outputs:
```
### Stripe Checkout
A shortcut for generating a Stripe Checkout form.
Can be used as a single tag, or tag pair. When using as a tag pair, the content between the
tags will be injected inside the generated ``. This is useful for adding hidden
fields that your server side processing would need.
```
{{ stripe:checkout action="/my-action" amount="500" description="T-shirt" }}
{{ /stripe:checkout }}
Outputs:
```
#### Parameters
The `action` parameter specifies where the form will POST to after receiving a token from Stripe.
The server-side logic is up to you to develop with your own addon.
Any configuration option listed [in the Stripe Checkout docs](https://stripe.com/docs/checkout#integration-simple-options) are available to you on the tag
without the `data-` prefix, and with underscores instead of dashes.
For example, where in the docs it says `data-zip-code="true"`, you'd use `zip_code="true"`.
#### Configuration
You may create a `site/addons/stripe.yaml` file containing any parameters that should be used by
all `{{ stripe:checkout }}` tags on your site.
A great example would be to include your key, company name, logo image, etc.
```
name: Statamic
image: http://site.com/logo.png
key: pk_test_123456789
```
[checkout]: https://stripe.com/checkout