BuildShip Logo
BuildShipΒ Community

Stripe Payment Processing

Setup Stripe Payment for your product with workflows for payment checkout link creation and post payment checkout processing. This is a great starter template that can be customized to meet your own requirements such as updating a membership, selling payment based products, incrementing user credits, etc.

281

Report this template

Select the reason for reporting

Describe the issue in detail

Share template

Link to template

https://templates.buildship.com/template/actXDZnvehpY/

This template contains 3 flows:

Inputs

Remix the template to run it with your own values.

Output

Read me

πŸ“– Read Me

Overview

Implement Stripe payment processing for your product with streamlined workflows for generating checkout links and managing post-payment actions.

This versatile starter template is fully customizable, enabling you to adapt it to your needs, such as updating memberships, selling products, adding user credits, and more.

This use case shows how to create payment for an imaginary credit-based service and increments user credits after a successful checkout.

Prerequisites

  1. Get your secret key from your Stripe accountStripe secret
  2. A Stripe product to create payment for. You must have a product configured with at least one pricing option. When testing you'll need to enter the price ID to create a payment checkout session.Stripe secret

To create a new product in Stripe, refer to their official API documentation.

✍️ How to Use

Step 1: Using the Stripe Payment Checkout Link Creator template to create a checkout session

This template creates a payment checkout session for a specified product Price ID and returns the checkout session URL for payments

To start accepting payments for your service or product, you'll first need to create a payment checkout session. This requires two inputs:

  • Price ID: The ID associated with the product's price.
  • Quantity: The number of units to be purchased.

You can retrieve the price ID from your product in the stripe dashboard:

Stripe secret

Before proceeding ensure you've selected or added your Stripe secret key:

With aforementioned being completed you're now ready to create your payment checkout session by testing πŸ§ͺ the workflow:

Stripe secret

Next, copy the checkout session URL, open in a new tab and you'll be greeted with a checkout form which you can proceed to fill out and PAY.

Stripe secret

NOTE ❗❗️: During development you can enable test mode in your Stripe dashboard and use any of the Stripe testing cards available to simulate payments to test your integration without moving any real money.

See Stripe documentation for more details.

What happens after you click "Pay"? Almost anything you want! You could increment user credits, update membership status, or even trigger personalized messages. In our case, were incrementing user credits. This is where the Stripe Payment Checkout Completed template comes into play πŸ‘‡

Step 2: Processing payments with the Stripe Payment Checkout Completed template

This template listens for a checkout.session.completed event from Stripe, creates a new customer if they don't already exist, and increments credits.

To start processing payments, you'll need to create a webhook in your Stripe dashboard that listens for checkout.session.completed events. This webhook will notify your BuildShip workflow whenever a payment is successfully completed, allowing you to perform actions such as updating order statuses, sending confirmation emails, or fulfilling purchases.

Luckily for you, the only thing you need to do is Ship πŸš€ your Stripe Payment Checkout Completed workflow and this will automatically create and configure the webhook for you in Stripe. This is because the workflow uses the Stripe Webhooks trigger to do all the heavy lifting.

Requirements:

  1. In the trigger config, select or add your Stripe secret key:

πŸš€ Ship your workflow

Now whenever a checkout session is created using the Stripe Payment Checkout Link Creator and submitted, your workflow will be called with the full event object. This event object will contain useful data, such as customer details, payment status, product information, and more.

REMIX

These workflows provide a starter foundation for processing payments. Depending on your payment processing needs, BuildShip offers numerous integrations to perform various actions, such as creating invoice PDFs, saving orders in a spreadsheet, sending email notifications, and much more.

What you choose to do from here is entirely up to you πŸ’‘.

πŸ”— Resources

Any additional information like demo links or YouTube tutorials.