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
Create a cascade flow (backend)
This is the flow created bynpm run seed in the SaaS demo — tested and working:
| Setting | What it does for SaaS |
|---|---|
strategy: 'cascade' | Try primary processor; on decline, fall through to next |
stickyProcessorEnabled: true | Returning customers reuse their last successful processor |
threeDsEnabled: true | SCA for EU rebills |
fallbackProcessorConfigs | Ordered list of backup processors/TPAs |
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
PasspaymentFlowId on every charge — first payment and rebills:
Add more processors to increase approval rate
Connect Stripe, Checkout.com, or Airwallex in the dashboard, then add them to the flow:paymentInstrumentId works across all processors.
Switch TPA without re-collecting cards
When your live TPA (tpa_xxx) has issues:
- Provision a new TPA (or connect a direct Stripe/Adyen processor)
- Add it to the payment flow’s
fallbackProcessorConfigs - Optionally disable the old processor
- Existing subscriptions rebill through the new route automatically
Inspect your flow at runtime
GET /api/payment-flow so your frontend can display the active routing config.
Strategies reference
| Strategy | Best for SaaS |
|---|---|
simple | Single processor — dev/testing |
cascade | Recommended — try primary, fall through on decline |
| Weighted + sticky | Split traffic across processors, stick returning customers |
