An open API service indexing awesome lists of open source software.

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

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