payments-and-monetizationlisted
Install: claude install-skill konradcinkusz/architecture-standards
# Payments, subscriptions and metering
**Read [`references/PAYMENTS-AND-MONETIZATION.md`](references/PAYMENTS-AND-MONETIZATION.md) before applying any of this.**
That file is the standard; everything below it is a summary to help you decide
whether this skill applies and to check your work afterwards.
## What this standard covers
- The model in one paragraph
- Merchant of record vs payment gateway
- Mock-first
- Webhooks
- Subscription lifecycle
- Quota and metering
- Entitlement enforcement is layered
- Tenant mode
- Introducing paid tiers to an existing user base
## Failure modes
| Symptom | Cause |
|---|---|
| Every production webhook rejected | Signature header name assumed, not confirmed; or webhook secret unset (correct behaviour — set the secret) |
| Webhooks accepted in production without signatures | The mock-mode fallback was made symmetric; restore reject-in-production |
| Subscription grants applied twice | No idempotency on provider event id; redelivery is normal, not exceptional |
| Cancellations never take effect | Lifecycle events landing in the mapper's default branch; only payment events were handled |
| Paying user loses days after early renewal | Extension computed from payment date instead of `max(expiry, payment date)` |
| Renewal-day usage missing from the new period | Quota period reset from the extended expiry base, not the payment date |
| Webhook dropped: "order not found" | Provider webhook beat your checkout write; synthesize from payload and