If you have any questions or need further assistance, don’t hesitate to join our Discord community. We’re always there to connect with you and offer support!

What is Stripe?

Stripe Pn Stripe is a cloud-based fintech platform that lets businesses of every size accept payments, move money, and embed financial services with just a few lines of code. Its core offering is a unified set of REST and GraphQL APIs along with prebuilt UI components such as Checkout, Payment Links, and Elements. These handle everything from card payments to over 100 local methods, in-person terminals, invoicing, and fraud protection through Radar. If you’re building an app with Trickle and want to integrate Stripe for payments, we recommend using Stripe Payment Links. This method is simple, secure, and does not expose any API keys. The integration is straightforward. You just need to embed the Stripe-generated payment link into your Trickle app. This method is best suited for fixed-amount payment scenarios such as e-commerce checkouts or subscription plans.

Stripe Integration Steps

1

Register a Stripe account

Sign up at https://stripe.com, activate your account, and link your bank account. Be sure to complete your Business settings, including logo and business information.
2

Create products and prices on Stripe

Set up your products (e.g. “Pro Plan”) and assign corresponding pricing models (monthly, yearly, etc.).Stripe 1 Pn
3

Create a Payment Link on Stripe

Set parameters and preview the checkout page.
  • Create new payment link Stripe 2 Pn
  • Configure link parameters and preview the UI on the right-hand side. Stripe 4 Pn
4

Embed the Payment Link in your Trickle App

When users proceed to checkout, they will be redirected to the Stripe-hosted payment page to complete the transaction.Providing the payment link to Trickle AI, and ask AI to link the payment link when checkout.
5

Grant user access after payment

After successful payment, you’ll need to grant corresponding access or features to the user.

Stripe Webhook Integration

If you want this process to be fully automated, you’ll need to handle Stripe’s webhook events via a backend service. We recommend integrating with Supabase Edge Functions for this purpose. Additionally, you’ll also have to store user-related data in Supabase.
1

Integrate with Supabse

  • Following the instructions to connect Supabase: Supabase integration
  • Use Supabase Authentication to manage user registration and login.
  • Store user data in Supabase, especially the subscription status field.
  • Use Supabase Edge Functions to handle Stripe webhook events. When a payment is completed, update the user’s subscription status in the Supabase database.
2

Deploy a Stripe Webhook Handler on Supabase

  • Deploy the stripe-webhook template function in Supabase. Stripe 3 Pn
  • Copy the function endpoint URL. For example: https://projectid.supabase.co/functions/v1/stripe-webhook Stripe 5 Pn
  • Disable JWT verification on this function. Stripe 6 Pn
3

Set Up Stripe Webhook and Destination

  • Add a new webhook destination in Stripe. Stripe 7 Pn
  • Select the event type: checkout.session.completed. Stripe 8 Pn
  • Set the webhook endpoint to the Supabase Edge Function URL above. Stripe 9 Pn
  • Copy the Webhook Signing Secret. Stripe 10 Pn
4

Configure Stripe Webhook Secret in Supabase

  • In Supabase, go to environment variables and set: Key: STRIPE_WEBHOOK_SIGNING_SECRET Value: [your secret from the previous step] Stripe 11 Pn
5

Use Trickle AI to Generate Edge Function Code

  • Paste the Supabase Edge Function code into Trickle AI. “This is a Supabase Edge Function for handling Stripe webhook events. Please modify it so that when a checkout.session.completed event is received, it updates the user’s subscription status to true in the Supabase database.”
    You can also paste an example Stripe event payload to help AI better understand the context.
6

Deploy & Test the Edge Function

  • Copy the code from Trickle AI and paste it to Supabase Edge function.
  • Test using Stripe’s test mode, with card number 4242 4242 4242 4242.
7

Perform End-to-End Testing

  • Fully test the integration across user flows, including:
    • Payment initiation
    • Stripe checkout completion
    • Webhook event handling
    • Subscription status update in Supabase
    • Feature access control in your Trickle app