Record what was bought through Stripe Checkout.
Syntax
$ vela enable ordersAdds orders on top of payments with Stripe and the cart, on a project with a backend: what a buyer paid for, written by Stripe’s webhook so the app can act on it. Creates two collections:
orders
order_linesAn order is one Checkout Session, keyed by the session id, so a redelivered or replayed event updates the row it already made. Its status is Stripe’s payment_status (paid, unpaid, no_payment_required); a payment that settles after Checkout (a bank debit) is recorded unpaid and updated when it clears or fails. The lines are Stripe’s own line items, as it priced them: name, unit amount, quantity, total.
What it adds
src/routes/webhooks/stripe/handlers/checkout/- Handlers forcheckout.session.completedand the twoasync_paymentevents, routed fromdispatch.ts, so they run inside thestripe-eventworkflow with its retries./checkout/successnow shows the order’s lines once the webhook has recorded it, and Stripe’s summary until then.
With auth on, the order records the buyer’s Stripe customer and user, signed-in buyers see their own orders at /orders and /orders/[id], and an Orders item joins the user menu. With notifications on, a paid order drops one on its buyer. Guests have Stripe’s receipt.
Testing locally
Forward Stripe’s events to your dev server and complete a checkout with a test card:
$ stripe listen --forward-to localhost:5173/webhooks/stripeOther providers
Shopify keeps its own orders; link to the store’s customer account pages. WhatsApp orders are submissions of the hosted order form and live in the VelaStack dashboard. vela enable orders is for Stripe.