Integrations

Stripe

Take payments in the app you build, through your own Stripe account.

Connect your own Stripe account to take payments in the apps you build. Payments go straight to your Stripe account, with your own keys.

What you can do

  • Take one-time payments and subscriptions in your app.
  • Give your customers a portal to manage their subscription.
  • React to payments with webhooks.
  • Query your Stripe data with SQL, next to your own tables.

Take payments in your app

  1. Add a database

    Payments run on your project backend, so set up a database first. See Lyna Cloud.

  2. Connect your Stripe account

    Open Settings > Lyna Cloud > Payments and choose Configure integration. Paste your Stripe publishable and secret keys, review the Stripe data, and pick the edge functions to deploy: Checkout session, Payment intent, Subscription manager, Customer portal and Webhook handler. See Payments.

  3. Build the flow

    Ask the AI, for example: "Add a pricing page with a Buy button that opens Stripe Checkout through the checkout session function, and a thank-you page after payment."

  4. Test, then go live

    Build with your test keys and Stripe's test cards. When everything works, replace them with your live keys and publish.

The edge functions

FunctionWhat it does in your app
Checkout sessionOpens a Stripe Checkout page for a purchase.
Payment intentStarts a payment that your own form completes.
Subscription managerCreates and changes your customers' subscriptions.
Customer portalOpens the page where a customer manages their subscription.
Webhook handlerReceives the events your Stripe account sends.

Query your Stripe data

After setup, your customers, products, prices, subscriptions, invoices, payment intents, charges, balance and events are tables in the stripe schema. Query them on the Query tab of Payments, or join them with your own tables in the SQL editor.

Webhooks

To react to payments (for example, to unlock a feature when a subscription starts), deploy the Webhook handler function.

  1. Create the endpoint in Stripe

    In your Stripe Dashboard, create a webhook endpoint that points to the function's invoke URL.

  2. Paste the signing secret

    Copy the endpoint's signing secret and paste it in the setup.

Your Lyna plan

Your Lyna plan is billed separately, through a secure checkout. Upgrade, change or cancel your plan, update your card or download invoices in Settings > Account > Subscription and usage. See Subscription and usage.

Need help?

Ask the team, read what changed, or learn from the blog.