DocsPlugins

Stripe

Stripe for Payments: Stripe Checkout for each payment, signed webhooks, and Stripe Connect for a marketplace’s sellers.

The payments-stripe plugin lets the Payments plugin take payments with Stripe. Each payment opens Stripe Checkout, so card details never reach your server. To add it:

sluurp plugin add payments payments-stripe

Set up a payee

  1. In Stripe, make a restricted key with Checkout Sessions: Write. That is all it needs. A test key (rk_test_…) takes test payments.
  2. In Stripe, add a webhook endpoint at the address the admin shows, /api/payments/webhook/stripe/<payee>, for the checkout.session.completed event, and copy its signing secret (whsec_…).
  3. In the admin, open Payments, add a payee with provider Stripe, and paste the key and the signing secret.

A webhook call is believed only when Stripe signed it with that secret and it is fresh; anything else is refused. A payment is settled by asking Stripe about it, not on the call’s word alone.

Sellers of a marketplace

A Stripe payee can onboard sellers with Stripe Connect. Each seller is paid what they sell, less the platform’s fee. From a plugin’s server code, make the seller’s account and send them to its onboarding:

functions/api.ts
const { account, url } = ctx.plugins.call("payments", "connect", { payee: "shop", email: seller.email, back });

Keep account (acct_…). Ask whether the seller can be paid yet with { payee, account, check: true }, then pay them by starting a payment with destination: account and the platform’s fee_cents.

Taking payments in your app is the same for every provider: see Payments.

View as Markdown