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.

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.

Price follows the place, and at-cost codes (#16205)

When paid forges run on a cloud account (Pinned forges → "paid forges run on"), the buyer may pick where it runs. The plan's price is for the plan's default place. A dearer place adds the difference to the monthly price, rounded up to the next dollar: "Show the price" renders the plans with the chosen place and says on each plan what the place adds, and the checkout line says it too ("Small forge (digitalocean:nyc3:s-2vcpu-4gb: +$12 a month)"). The amount is fixed when the order is placed and kept on the order, and the checkout charges exactly it (inline price_data, no dashboard setup).

An at-cost code is made where a gift code is (Settings → Billing → Codes, POST /api/v1/codes with kind: "at_cost", the terminal's codes screen with c), with uses and an expiry as now; the link it gives is /pricing?code=…. A buyer with one pays the place's monthly cost plus the payment fee (src/billing/at_cost.ts: 2.9% and 30 cents, grossed up so the forge keeps the cost), rounded up to the next dollar: the plan row shows "was" the normal price and "at cost" with the amount. A code is for one plan and never gives a plan free: the gift door refuses it (wrong_kind), and a gift code is refused here. A use is held by each open checkout (name held for 30 minutes) and spent when it is paid, so one use cannot fund many pending orders; a checkout that lapses gives its use back. Revoking stops new checkouts; one already open and paid is honoured at the price it quoted. Every look at a code, by the link or by Show the price, counts a try for the client, as a gift code's does.

At-cost needs a machine to cost, so it is refused while paid forges run hosted.

Settings → Billing, and the terminal's Sold forges screen (admin only), list each sold forge: plan, place, what its machine costs, what the buyer pays, the provider's fee and the margin. An at-cost forge reads zero margin. Orders keep the cost they were sold at, so a catalog that moves later rewrites no past sale.

Not done yet: an at-cost subscription does not follow a place's later cost change at its next renewal. Test: bun test test/order-cloud.test.ts test/at-cost.test.ts.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs