Escrow
Stripe holds the wallet. Cloudflare prices the floor.
Bids never touch a card directly. Collectors fund an escrow wallet through Stripe Checkout. Holds, sit-out profits, and at-cost wins settle on that balance. The Registrar fee is a bookkeeping line — not a Stripe application fee.
The zip is also stored in project artifacts as domaingems-source.zip and STRIPE.md.
- 01
Card → Checkout → wallet
Signed-in collectors pick $250 / $500 / $1,000. The server creates a Stripe Checkout Session with
client_reference_idand metadata set to their user id. Success returns to the desk withsession_id; the webhook is the source of truth. - 02
Idempotent credit
checkout.session.completed(and async success) creditsprofiles.wallet_centsonce persession_id. The success URL calls the same ledger helper, so a delayed webhook still cannot double-pay. - 03
Bids hold wallet, not the card
Serialized bidding in the auction engine already moves cents on the profile. Stripe is only the on-ramp. Sit-out profits and sole-bidder at-cost refunds stay in-ledger.
- 04
Settlement still conserves
Winner pays Registrar floor + sit-out profits. Leftover forfeited slices refund to the winner. The house does not take an application fee on the Cloudflare floor.
Environment
Do not commit secrets. Preview runs without Stripe (demo wallet). Production injects keys on deploy.
| Variable | Where | Purpose |
|---|---|---|
| STRIPE_SECRET_KEY | server | Checkout + retrieve sessions (sk_test_ or sk_live_) |
| STRIPE_WEBHOOK_SECRET | server | Verify POST /api/stripe/webhook (whsec_…) |
| VITE_STRIPE_PUBLISHABLE_KEY | optional | pk_… — not required for hosted Checkout; shown in status |
Webhook
Endpoint: /api/stripe/webhook
Events: checkout.session.completed, checkout.session.async_payment_succeeded, async_payment_failed, expired.
Signature is verified with the raw body. Unsigned events are rejected.
Test cards
Success: 4242 4242 4242 4242
Decline: 4000 0000 0000 0002
Any future expiry, any CVC, any ZIP. 3-D Secure: 4000 0025 0000 3155.
Preview vs live
This instance is Preview wallet. Desk buttons credit the $1,000 demo wallet (cap $5,000).
Deposit amounts: $250.00 · $500.00 · $1,000.00
Registrar
Cloudflare Check still prices the opening bid. On win, production registers with the Registrar API. Stripe never talks to Cloudflare — settlement writes a registration ledger row for the at-cost fee.
Full operator notes ship in the zip as STRIPE.md. Auction mechanics.