Stripe payment received

A Stripe-signed webhook records each paid Checkout session in a stripe_payment table, once (Stripe's event id and the session id both guard against repeats). Every new payment notifies your staff and emails the payer a short receipt. A Payments page for staff lists them, with a Check Stripe now button as a fallback that pulls recent sessions with your secret key (it never reaches the browser).

Stripe payment received: its 3 workflows, trigger to steps

What it adds to your app

Table stripe_payment (one row per paid Checkout session). A Stripe-signed webhook that records each paid session. Server function stripe-sync-payments (the manual fallback). Workflow: notify staff and email a receipt on each new payment. A Payments page for staff.

Tables

  • stripe_payment session_id, amount, currency, email, payer_name, description, paid_at

Pages

  • /stripe-payments Payments (‹staff_role›)

Components

  • StripePayments Staff payments list, filled by Stripe's webhook, with a Check Stripe now fallback

How its workflows run

Each one is a server workflow in your project: it runs on its trigger, with retries, and its runs show in the builder's log.

  1. Record each paid Stripe Checkout session

    When a webhook arrives: webhook stripe-checkout-events. Then: Look up stripe_payment, then Create stripe_payment.

  2. Check Stripe for paid Checkout sessions (fallback)

    When the app calls it: server function (‹staff_role›). Then: Call api.stripe.com, then Look up stripe_payment, then Create stripe_payment.

  3. Tell staff and email a receipt for each new payment

    When a row changes: stripe_payment created. Then: Notify, then Send email.

Set it up

It merges into the contract of an app you already have. Nothing is overwritten: a name you already use is refused until you pass a prefix.

  1. Pick the project

    Use the button above, or ask your coding agent with the Appbricx MCP server connected (quickstart).

  2. Point it at your tables and roles

    Leave out the ones with defaults; a wrong one is refused with the options your app has.

    ParamWhat it isExample
    staff_roleThe staff role that sees the Payments page, can check Stripe and is told about new payments. Optional.admin
  3. Connect what it calls

    add the STRIPE_WEBHOOK_SECRET secret (project settings); add the STRIPE_SECRET_KEY secret (project settings). A Stripe webhook endpoint at the URL get_contract lists for stripe-checkout-events (Backend, API in the builder), sending checkout.session.completed, with its signing secret in STRIPE_WEBHOOK_SECRET. STRIPE_SECRET_KEY only for the Check Stripe now fallback (a restricted key with read access to Checkout Sessions is enough).

  4. Preview, then apply to dev

    A dry run shows the diff and the check report; applying it changes your dev environment only.

  5. Deploy

    When dev looks right, deploy. Production gets a snapshot first, so you can roll back.

Use it with your coding agent

The agent reads the template, runs a dry run, shows you the diff and applies it.

Prompt
Add the Stripe payment received template (slug "stripe-payment-received") to my Appbricx project. Read it with get_template, run use_template with dry_run first and show me the diff, then apply it. Ask me where it attaches if you can't tell from my contract (staff_role: who manages payments).
MCP call
{
  "tool": "use_template",
  "arguments": {
    "slug": "stripe-payment-received",
    "project_id": "<your project id>",
    "params": {
      "staff_role": "admin"
    },
    "dry_run": true
  }
}
CLI
appbricx templates use stripe-payment-received --param staff_role=admin --dry-run

Works with

The services this template calls. Each page lists every action and what connecting it takes.

Your agent adds it. Appbricx runs it.