Buy a forge at /pricing (#11138)
Open /pricing with no account. Each plan shows its size, price, crew credit said as a count of ordinary asks ("Crew credit for 10 ordinary asks each month."; the free plan's is "…once, to start"; left out when it is under one ask) and forge count, read from the same plans as GET /api/v1/plans (test/pricing-plans-agree.test.ts). Type the forge's name and an email, press the paid plan's button, pay at the provider's checkout, and the page you return to (/pricing/done) shows the claim link once. Open it to take the forge over.
- Asks, not dollars (#16132): an ask costs the
billing.ask_centslimit (default 50 cents; the operator sets it from the crew's ledger, under Limits), and a credit is shown as whole asks, rounded down.creditWordsinsrc/billing/plan_words.tsbuilds the sentence for /pricing, the home's plans, the terminal's plans screen and the owner's plan row (the host writes the ask price into the forge'splan.json).GET /api/v1/plansand the structured data on /pricing stay in dollars (creditUsd, "Crew credit (USD a month)"). Test:bun test test/pricing-words.test.ts. - Free plan: its button goes to
/forges/new. - Closed the tab?
/pricing/resend: name and email you bought with; a new link is mailed there (needs mail configured) and the old one stops. - No provider connected: paid plans show their price and one muted phrase, "not on sale yet · ask the operator".
- Operator: connect Stripe under Settings → Billing. A paid order whose forge could not be made shows under "Paid, not made" with Retry and a link to the provider's dashboard to refund; a flow alarm names it.
- Limits: one client address may have 3 orders waiting at once (counted by socket address, never a header); a name is held 35 minutes and the provider's checkout stops being payable at 31, so a late payer never finds the name given away; a claim link is mailed again at most once a day per order.
- Terminal: palette → "Get a forge (plans)" (
src/tui/screens/pricing.ts): up/down picks a paid plan, Tab switches name/email, Enter places the order (the per-address cap counts the SSH client's bucket). The checkout address is printed as text to open anywhere; after paying press r, and the claim link appears once, by the ticket the order was placed with. Free is not sold there: use Start my forge. Test:bun test test/tui-pricing.test.ts. - Receipt (#16046): the page after payment links to
/pricing/orders/<id>: the plan, the amount, the day the payment arrived (UTC) and the forge, with a download of the same as printable HTML (/pricing/orders/<id>/receipt.html?download=1). Only the buyer (the order's cookie, two days) or an admin who is a person can open it; anyone else, and an order not yet paid, gets a missing page. The amount is the price stored on the order when it was made (orders from before that show "not recorded"). The page after payment links to it whichever way the link is shown. The terminal prints the same four facts when the order is ready, claimed or not, but has no way to the printable HTML: that file is the buyer's browser's (the cookie), so open the receipt page there. Code:src/billing/receipt.ts. Test:bun test test/billing-order-receipt.test.ts. - Code:
src/actions/order.ts(rules),src/billing/orders.ts(store),src/web/pages/pricing.ts(pages). The paid path is described indocs/SPAWN.md. - Test:
bun test test/pricing-order.test.ts.
After the card form (#13262)
Under the order form /pricing lists three steps, from AFTER_PAYMENT_STEPS in
src/billing/plan_words.ts: you pay, a forge is made, a link arrives by email.
The same words are the "After you pay" row on /terms, the line under the plans
(AFTER_PAYMENT) and the terminal's pricing screen. One block holds the steps, the
lapse sentence /terms also prints, and the Terms and Privacy links. With no
payment provider the page says paid plans are not on sale yet and shows the steps
as what will happen; the terminal screen hides them.