
Stripe or Razorpay remains the source of truth for charges, invoices, refunds,
disputes, taxes, and account-level financial operations. InsForge is not a
payment processor or merchant of record, and it does not replace the provider
dashboard.
Choose a provider
Stripe Payments
Use Stripe Checkout, Products, Prices, Subscriptions, and Billing Portal.
Razorpay Payments
Use Razorpay Orders, Items, Plans, Subscriptions, and Razorpay Checkout.
Architecture
Provider-native tables keep provider concepts intact:| Provider | Runtime tables | Catalog tables | Subscription tables |
|---|---|---|---|
| Stripe | payments.stripe_checkout_sessions, payments.stripe_customer_portal_sessions | payments.stripe_products, payments.stripe_prices | payments.stripe_subscriptions, payments.stripe_subscription_items |
| Razorpay | payments.razorpay_orders | payments.razorpay_items, payments.razorpay_plans | payments.razorpay_subscriptions |
| Table | Purpose |
|---|---|
payments.provider_connections | Provider key, account, sync, and webhook setup status by provider and environment. |
payments.customer_mappings | App billing subject to provider customer ID mapping. |
payments.customers | Admin/customer mirror for dashboard visibility. |
payments.webhook_events | Verified provider webhook event ledger. Use this for durable fulfillment triggers. |
payments.transactions | InsForge dashboard/reporting projection for successful, failed, and refunded payment activity. |
payments.transactions is not the fulfillment contract. It is a projection built from provider events and sync. For business logic, create app-owned tables such as public.orders, public.credit_ledger, or public.team_entitlements, then populate them from verified rows in payments.webhook_events.
Fulfillment
Do not fulfill from a Stripe success URL or a Razorpay Checkout callback alone. Those are user experience signals. Durable fulfillment should run from verified provider webhook events.NEW.provider and NEW.event_type. Protect your app-owned fulfillment tables with your own RLS policies.
Webhook events are processed independently and providers give no ordering guarantee across events. Rows derived from an event are committed before that event is marked processed, but rows owned by other events — such as payments.customer_mappings, which checkout completion creates — may not exist yet when your trigger fires. Resolve billing subjects from the event payload first and treat lookups into other tables as fallbacks. See the provider guides for subscription fulfillment examples.
Build with it
TypeScript payments guide
Pick the Stripe or Razorpay provider module for app code.
REST patterns
Review provider-specific Payments API routes and webhook routes.
Next steps
- Read Stripe Payments if you are using Stripe Checkout or Billing Portal.
- Read Razorpay Payments if you are using Razorpay Orders or Subscriptions.
- Configure provider keys in Dashboard -> Payments -> Settings.
- Add app-specific RLS or server-side membership checks for billing subjects.
- Add trigger-backed fulfillment from
payments.webhook_events.