Stripe Checkout
This module is built on top of Stripe Checkout, which is low-code payment integration that can be customized from their portal.
Redirect To Stripe Checkout
Redirect your customers to Stripe’s conversion-optimized Checkout, a Stripe-hosted page to securely collect payment information. When the customer completes their purchase, they are redirected back to your website.
warning
When the customer is redirected back to the success URL, we shouldn't assume that the payment is transferred. Since the customer can just navigate to this website directly.
Setup
To start using this we first have to enable it inside Stripe. Here is where you can enable it:
- Go to Stripe Dashboard.
- Navigate to Settings (gear icon in the top right corner)
- Navigate to "Checkout and Payment Links" under "Payments".
- In the bottom of this page there is a section called "CLIENT-ONLY INTEGRATION" we have to enable that.
Getting the Publishable key
- Go to Stripe Dashboard.
- Navigate to "Developers"
- Navigate to "API keys" in the side panel
- Under "Standard keys" you should see the key
Items Format
Items is an array of objects. More can be read here on the Stripe API Docs.
Example
[
{
// The ID of the price that the customer would like to purchase or subscribe to. May also be a SKU or plan.
// This is just an example, where you have to use your own ID.
"price": "price_1L5S6aHOo4vCBkMgnSou0t4U",
// The quantity of units for the item.
"quantity": 1
}
]
Inputs
Data | Description |
---|---|
Publishable key | This is the Y value the the snap action will have as destination when triggered. |
Mode | The type of payment mode we will process. |
Success URL | The relative URL to where the customer will be redirect when the payment is successful. |
Cancel URL | The relative URL to where the customer will be redirect when the payment is canceled. |
Items | The products that the customer wants to purchase. More information about the format above. |
Signal | Description |
---|---|
Redirect To Checkout | Redirect to the Stripe Checkout. |
Outputs
Data | Description |
---|---|
Error | This will only be available when On Error is triggered. |
Is Loading | This is true, when loading the Stripe plugin and redirecting. |
Signal | Description |
---|---|
On Error | Occurs on Stripe errors. |
On Start Loading | Occurs when we start loading the Stripe plugin and redirecting. |
On Done Loading | Occurs when we are done loading the Stripe plugin and redirecting. |