Skip to main content

Payment Flows for SaaS

Time: ~10 minutes | Difficulty: Intermediate Payment flows are TagadaPay’s routing engine. For SaaS, they solve the problem Stripe cannot: run multiple processors/TPAs behind one vaulted card, with automatic cascade and failover.
Tested in production with TPA tpa_fb15b76112a8 (live Adyen-backed) and sandbox processor cascade. See mini-saas-billing.

The problem with Stripe

The TagadaPay model

If a TPA is banned: update the payment flow to route through a different TPA or processor. Customers never re-enter their card.

Create a cascade flow (backend)

This is the flow created by npm run seed in the SaaS demo — tested and working:
About threeDsEnabled: this toggles whether 3DS is requested — how it runs is decided by the processor the flow routes to. With hosted-3DS PSPs (Adyen, Stripe, TagadaPay TPAs) the charge simply returns requireAction: 'redirect' and the processor hosts the challenge; you never create a 3DS session yourself. Standalone 3DS sessions (threeds.createSession) exist only for gateway-style processors like NMI and are rarely needed — see Quick Start.

Charge through a flow

Pass paymentFlowId on every charge — first payment and rebills:
Verified output from production test:

Add more processors to increase approval rate

Connect Stripe, Checkout.com, or Airwallex in the dashboard, then add them to the flow:
No frontend changes. No re-vaulting. The same paymentInstrumentId works across all processors.

Switch TPA without re-collecting cards

When your live TPA (tpa_xxx) has issues:
  1. Provision a new TPA (or connect a direct Stripe/Adyen processor)
  2. Add it to the payment flow’s fallbackProcessorConfigs
  3. Optionally disable the old processor
  4. Existing subscriptions rebill through the new route automatically
For subscription-level processor migration, use:
See Subscriptions & Rebilling.

Inspect your flow at runtime

The SaaS demo exposes this at GET /api/payment-flow so your frontend can display the active routing config.

Strategies reference

Full multi-PSP guide: Multi-PSP Routing & Vault.