mirror of
https://github.com/hanzoai/commerce.git
synced 2026-11-23 05:38:11 +00:00
- A plan can be paid by stablecoin: the first period opens its subscription when the deposit succeeds; each renewal raises its invoice, opens a deposit for the exact amount, leaves the subscription past due and announces renewal.action_required with the addresses, amount and expiry. The period starts only when the deposit succeeds, once; a deposit reported again changes nothing, and an unpaid deposit follows the dunning a card does. - A recurring token's remaining room is on the order and the subscription read. Three days before a renewal its token cannot cover (less room than the renewal, or expiring first), the agent is told once, with the path to supply a fresh token (POST /v1/billing/subscriptions/:id/agent-token). - The catalog resolves its payment types from the host's brand for an anonymous caller. Testing: go test ./api/billing; stablecoin plan and renewal (paid, unpaid, replayed) with a Stripe double; live Stripe test mode for the warning, the room, and a fresh token. Risk: new payment type for plans; the renewal sweep also announces token shortfalls. How to revert: git revert this commit.