- POST /api/checkout creates a live Dodo checkout session from an allowlisted product slug (weekly/monthly/pro/pro_annual/team), never a client-supplied product id. - POST /api/webhooks/dodo verifies the Standard Webhooks signature (webhook-id.webhook-timestamp.body, 5-min replay window) against a secret stored only as a Worker secret, records each delivery idempotently by webhook-id in D1, and upserts a per-customer entitlement row on subscription lifecycle events. - GET /api/entitlement is an internal-only lookup gated by a shared-secret header, for Recoder's app / Rithub to check a customer's billing state. - GET /api/portal resolves a checkout session's email, looks up the Dodo customer id from our own entitlements table, and redirects into Dodo's hosted customer portal -- no bespoke billing UI. - New /thanks page with a "Manage subscription" link; pricing cards now trigger checkout via one click (no form -- Dodo's hosted page collects email/card). - New D1 database recoder-billing (webhook_events + entitlements tables). This re-points recoder.xyz at a real backend: the live Dodo webhook (ep_3L0eElSCHnxNsth2aIBRdObJJzT) was 404ing against the old pure-static site. Verified live: bad signature -> 401, correctly-signed test event -> 200 + D1 row + idempotent replay, all 5 live checkout URLs return 200 on Dodo's hosted page, pricing/thanks screenshot clean at 1440 and 390 with no console errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
18 lines
404 B
JSON
18 lines
404 B
JSON
{
|
|
"name": "recoder-site",
|
|
"private": true,
|
|
"version": "1.0.0",
|
|
"description": "recoder.xyz static marketing + legal site, deployed as a Cloudflare Worker with static assets",
|
|
"scripts": {
|
|
"dev": "wrangler dev",
|
|
"deploy": "wrangler deploy"
|
|
},
|
|
"devDependencies": {
|
|
"wrangler": "^4.170.0"
|
|
},
|
|
"allowScripts": {
|
|
"esbuild@0.28.2": true,
|
|
"workerd@1.20261129.1": true
|
|
}
|
|
}
|