Get paid with Stripe¶
Users buy credit packs by card on the My Compute page; the money lands in the bank account connected to your Stripe account. You configure exactly one value — your Stripe secret key. The platform provisions the webhook endpoint and its signing secret automatically via the Stripe API.
1. Create a Stripe account¶
- Sign up at dashboard.stripe.com/register.
- To receive real money, complete activate payments: business details and the bank account for payouts. (Skip this to start in test mode.)
2. Copy your secret key¶
Dashboard → Developers → API keys → Secret key:
sk_test_…— test mode: no real money, pay with card4242 4242 4242 4242.sk_live_…— live mode: real cards, real payouts.
The key is stored on your master only — in the platform database (or
deploy/.env, if you pinned it there yourself) — and is never shown again in
the UI.
3. Connect it — either path¶
During deploy — the wizard asks:
Stripe payments — users buy credits by card, you get paid (optional).
Paste your Stripe secret key (sk_...) or Enter to skip:
The key is validated against the Stripe API on the spot, then connected at the end of the deploy through the same path as the web UI — so it stays manageable from Configuration → Payments afterward.
Or later, from the web UI — log in as admin → Configuration → Payments → paste the key → Connect. Validation and webhook setup happen on the spot; the card shows mode (test/live) and webhook status.
Requirements¶
- Public URL —
WEBUI_URLindeploy/.envmust be set to the address users (and Stripe) reach, e.g.https://platform.example.com. The webhook is created at{WEBUI_URL}/api/v1/credits/webhook. Live mode requires HTTPS (./deploy/setup-https.sh); test mode also works over plain HTTP. - Reachable webhook — if the master sits behind Cloudflare or a WAF,
allow Stripe's webhook requests (user agent
Stripe/1.0); otherwise payments succeed but credits are never minted.
How it works / troubleshooting¶
- Checkout:
POST /v1/credits/checkoutcreates a Stripe-hosted checkout session; on payment Stripe callsPOST /v1/credits/webhook, which mints the paid credits (idempotent per event, signature-verified). - Webhook deliveries are rejected (403) when no signing secret is
configured — unsigned minting is a hole, not a convenience. Local dev can
opt out with
STRIPE_ALLOW_UNSIGNED=1. .envwins over the web UI: whenSTRIPE_SECRET_KEYis set indeploy/.env, the Payments card is read-only and says so.- Webhook status and errors: Configuration → Payments, or
GET /v1/admin/stripe. Re-connecting recreates the webhook endpoint (Stripe reveals a signing secret only at creation). - Set
STRIPE_WEBHOOK_SECRETin.envonly if you manage the webhook endpoint yourself in the Stripe dashboard (events:checkout.session.completed).