Stripe Billing and customer-invoice payment surfaces, environment variables, Connect setup, webhooks, and go-live checks.
CentraKit uses Stripe for two distinct money flows:
Never collect or store raw card numbers, CVC, bank account details, legacy Tokens, Sources, Charges, or Card Element data. Prefer the Stripe Payment Element. Never persist PaymentIntent client secrets.
subscription mode start new subscriptions and upgrades.invoice_pdf or Hosted Invoice Page URLs.billing_plan_features copy aligned with the retention workflow./{orgSlug}/payments (organization.payments.manage).charges_enabled + enabled status).transfer_data.destination and application_fee_amount from the admin platform_settings.invoice_payment_fee row (percentage bps or fixed minor units; default 150 bps = 1.5%)./{orgSlug}/portal/invoices/[invoiceId] via the embedded Payment Element. Dynamic payment methods (card, iDEAL, etc.) follow Stripe Dashboard + currency/country configuration.invoice_payments. Webhooks update payment + invoice status atomically; browser returns only refresh UI.invoice_payments status.Set these per environment in Vercel (Stripe integration covers the keys):
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...Plan price IDs are not environment variables. Keep them in Stripe and the platform database. Use separate test and live products, prices, Portal configuration, Connect settings, and webhook signing secrets. Enable Connect in the Stripe Dashboard and complete platform profile / approval prerequisites before going live with destination charges.
centrakit_ai_input_tokens, centrakit_ai_output_tokens, centrakit_inbox_messages_sent, centrakit_api_requests, and centrakit_mcp_tool_calls.pnpm env:pull).payment_intent.*, charge.refunded, charge.dispute.created, and account.updated for invoice payments)./{orgSlug}/billing and /{orgSlug}/usage with organization.billing.manage, and /{orgSlug}/payments with organization.payments.manage.The webhook endpoint verifies signatures and records each Stripe event idempotently.
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedcustomer.updatedpayment_method.attachedpayment_method.detachedinvoice.createdinvoice.finalizedinvoice.finalization_failedinvoice.paidinvoice.payment_failedinvoice.payment_action_requiredinvoice.upcomingRouted by PaymentIntent/charge metadata (centrakit_purpose=customer_invoice_payment) or Connect account.updated:
payment_intent.succeededpayment_intent.payment_failedpayment_intent.canceledpayment_intent.requires_actioncharge.refundedcharge.dispute.createdaccount.updatedbilling_usage_meters.stripe_event_name.STRIPE_WEBHOOK_SECRET is the live signing secret./admin/settings invoice payment fee matches the commercial agreement.Last updated on