feat(rotation): buy automatic rotation, $29 per team per 30 days (CoinPay) (#272)

- Rotation page button + POST /api/credshare/teams/:slug/rotation/auto/checkout
  open a CoinPay hosted checkout (owner/admin only).
- POST /api/coinpay/webhook and the page's return check settle once per checkout
  session (rotation_payments); paying again extends from the current end.
- Hourly sweep: renewal email 3 days before, switch off when the days run out.
  A team switched on by hand (paid_until NULL) never expires.
- Migration 012 (both dialects), CSP form-action allows coinpayportal.com.

Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sh1pt-actions-fleet[bot] 2026-10-29 05:12:01 +00:00 • committed by GitHub
parent 63ecfb4ed6
commit 0cfb94e56c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 521 additions and 15 deletions

View file

@ -250,7 +250,7 @@ test("policy: the Rotation page shows the 90-day policy, due pills and an Approv
const { body } = await owner.call("GET", "/teams/policy/rotation");
assert.match(body, /90-day policy/);
assert.match(body, /pill warn">due/);
assert.match(body, /paid add-on/);
assert.match(body, /Turn on automatic rotation, \$29 \/ 30 days/);
const { body: premium } = await owner.call("GET", "/teams/premium/rotation");
assert.match(premium, /Automatic rotation is on/);
const s = await owner.call("POST", "/api/credshare/teams/strict/rotation/due");