Mity Docs Mity Docs for Mity Digital
Stripe Checkout Fieldtype Documentation

Quick start

The Stripe Checkout fieldtype can be an odd one to get your head around (and how it fits in with your Forms blueprint). This guide can (hopefully) get you up to speed in a TL;DR version of the docs.

But please read the docs - they're really useful too.

Basically, to get started:

  1. Have a Stripe account (in dev mode is fine)

  2. Install the Stripe Checkout Fieldtype

  3. Complete the Environment Configuration

  4. Create a Form in Statamic that you want to collect money from, and in the Blueprint, add the Stripe Checkout Fieldtype and configure to your needs

This will output a Form, and may show the choice between One-time Payment or Subscription (depending on your fieldtype configuration).

On the frontend of your Statamic site:

  1. Output your Form markup as you want - Statamic docs are a good starting point

  2. User visits the form, and submits the form

  3. When submitted, this addon will try to create a Stripe Checkout URL, and if it does (i.e. has at least one Stripe Line Item to submit) will add redirect instructions for Statamic.

    1. If using a standard form POST, Statamic will handle the redirect

    2. If using JavaScript to submit, you'll need to grab and handle the redirect response

  4. The addon will also store a reference to the Checkout Session ID in your site's session in case you need to retrieve the Submission based on the returning Checkout Session ID from Stripe.

When a Form is submitted, as far as Statamic is concerned, it is considered submitted and complete before the redirect to Stripe takes place. This means that any email configuration you have for your Form will take place before the Stripe Checkout process is complete.

If this is unworkable for you, you could disable your Form's emails, and use the Checkout Session ID to send emails when the Success URL is hit and matches the Checkout Session ID. This will require a little coding on your part, but definitely achievable. Check out the Fieldtype Configuration for details on the Checkout Session ID.