Payments overview
Unified Pancake, legacy Waffo and Creem billing.
Disabled by default
PAYMENT_PROVIDER=none: no simulated payment success. Waffo needs sandbox/production environment, merchant ID/API key, PKCS8 private and SPKI public key (PEM/base64 DER). Creem needs test/production environment, API/webhook keys and five CREEM_PRODUCT_* IDs matching config/billing.ts exactly. Never mix environments.
Money and API
USD defaults remain Starter $29/month or $290/year (1000 monthly credits), Pro $99/month or $990/year (10000 monthly credits), $5 for 200 credits. Annual plans release monthly within the paid year; cancellation stops renewal, not paid installments.
POST /api/payments/checkout: key, kind, stable idempotencyKey, optional locale. Server owns identity/money/credit snapshot. GET /api/payments/orders/[orderId] is owner-only; return URL parameters or ACTIVE are not payment proof. PayButton / useCheckout unify UI.
Legacy /api/payments/creem/checkout stays Creem, accepts old key/kind and reuses unfinished same-product orders. Historical IDs are preserved.
Unknown timeouts keep their persisted request ID. Creem timeouts without checkout ID require signed webhook recovery/operator reconciliation, not another merchant request.
Refund/dispute flags pause grants for manual reconciliation; no blind negative-credit debit or automatic refund API call. This fulfillment path does not send payment-success emails.
Actual merchant acceptance still requires your credentials and checkout/renewal/cancellation/refund/dispute/duplicate-notification tests. Local tests are not sandbox acceptance.
See Webhooks, Credits, Deployment.
Waffo Pancake (not legacy Waffo)
For pancake.waffo.ai use PAYMENTPROVIDER=pancake and all eight PANCAKE* values in .env.example. Merchant/store/product use MER*/STO*/PROD_ IDs; mode is explicit test/prod. API environment is determined by the signing key, not by a mode flag: use matching API and webhook keys. Keys are server-only PEM RSA keys. Explicit tax inclusion/category and a pack-key-to-product JSON map are required.
This adapter supports full-price USD one-time packs only. Configure newPurchasePolicy and pricing UI for that offer; subscription keys/history must not be deleted. Subscriptions, prorated credits and zero-charge card checks are not implemented for Pancake. Missing actual charge facts or a mismatch enter reconciliation, never a free grant. Apply additive migration 0014 only on a confirmed target after review/backup. Legacy PAYMENT_PROVIDER=waffo remains waffo.com, not Pancake.