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.
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
Get your secret key from your Stripe account
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.
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:
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:
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.
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.
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:
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 π‘.