recoder-site/public/thanks.html
caelum0x 65bf2849ae feat(RCD-MON): fix recoder.xyz payment path -- checkout, webhook, entitlement
- 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>
2026-12-01 16:14:37 +03:00

74 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Thanks — Recoder</title>
<meta name="description" content="Your Recoder checkout is complete.">
<meta name="robots" content="noindex">
<link rel="canonical" href="https://recoder.xyz/thanks">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<header class="site">
<div class="wrap bar">
<a href="/" class="logo">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><polyline points="8 5 2 12 8 19"></polyline><polyline points="16 5 22 12 16 19"></polyline></svg>
Recoder
</a>
<nav class="site-nav">
<a href="/pricing">Pricing</a>
<a href="/contact">Contact</a>
<a href="https://rithub.dev" class="btn btn-accent" target="_blank" rel="noopener">Open Rithub</a>
</nav>
</div>
</header>
<main>
<section class="hero" style="padding-top:88px;padding-bottom:56px;">
<div class="wrap-narrow">
<h1 style="font-size:40px;">You're set</h1>
<p class="sub" id="thanks-message">Your payment went through. A receipt is on its way to your email.</p>
<div class="hero-actions">
<a href="https://rithub.dev" class="btn btn-accent" target="_blank" rel="noopener">Open Rithub</a>
<a href="#" class="btn btn-plain" id="manage-link" style="display:none;">Manage subscription</a>
</div>
</div>
</section>
</main>
<footer class="site">
<div class="wrap bar">
<nav>
<a href="/pricing">Pricing</a>
<a href="/terms">Terms</a>
<a href="/privacy">Privacy</a>
<a href="/refund">Refund policy</a>
<a href="/contact">Contact</a>
</nav>
<div class="copy">&copy; 2026 Erebos Labs</div>
</div>
</footer>
<script>
(function () {
var params = new URLSearchParams(window.location.search);
var sessionId = params.get("session_id");
var pending = params.get("pending");
var messageEl = document.getElementById("thanks-message");
var manageLink = document.getElementById("manage-link");
if (pending) {
messageEl.textContent = "Still confirming your payment. Refresh in a few seconds, then try \"Manage subscription\".";
}
if (sessionId) {
manageLink.style.display = "inline-flex";
manageLink.href = "/api/portal?session_id=" + encodeURIComponent(sessionId);
}
})();
</script>
</body>
</html>