Why Use Multi-Gateway Failover
Without Orchestra, a provider outage means lost transactions. With multi-gateway failover, your payment flow stays resilient:- Provider downtime - If Stripe is down, transactions automatically route to Adyen
- Regional issues - Network problems in one region don’t affect your entire payment flow
- Rate limiting - Exceed limits on one provider, overflow to another
- Business continuity - Maintain 99.9%+ payment availability
How It Works
Instead of specifying a singlepaymentGatewayAccountName, use the plural paymentGatewayAccountNames with an array of gateway account names:
Basic Example
Use
paymentGatewayAccountNames (plural) for failover. The singular paymentGatewayAccountName routes to a single provider without failover.Failover Logic
Orchestra tries each gateway in order:- First attempt - Transaction sent to first gateway in array
- Check result - If successful, return immediately
- On failure - Try next gateway in array
- Repeat - Continue until success or all gateways exhausted
- Final result - Return success from first working gateway, or failure if all fail
What Triggers Failover
Orchestra attempts the next gateway when:- Gateway returns an error response (500, 503)
- Gateway is unreachable (network timeout)
- Gateway explicitly rejects the transaction
- Gateway rate limit exceeded
What Doesn’t Trigger Failover
Orchestra does NOT fail over when:- Card is declined by the issuing bank (legitimate decline)
- Insufficient funds
- Invalid card number or CVV
- Card expired
Configuration Strategies
Primary + Backup
Most common setup: one primary provider, one backup for emergencies.Geographic Routing
Different providers for different regions:Load Distribution
Distribute load across multiple providers for high-volume scenarios:Works With All Operations
Multi-gateway failover works with:- Charge - Immediate payment capture
- Authorize - Hold funds for later capture
- Tokenize - Generate gateway tokens
paymentGatewayAccountNames instead of paymentGatewayAccountName in any request.
Response Details
The response includes which gateway succeeded:paymentGatewayAccountName in the response to track which provider processed the transaction. This helps with:
- Cost analysis per provider
- Performance monitoring
- Debugging routing issues
Testing Failover
Test your failover configuration using mock gateways:"paymentGatewayAccountName": "test-success".
See Mock PSPs for testing strategies.
Best Practices
Order by Preference
List gateways in order of preference. Lowest cost or best performance first.
Monitor Usage
Track which gateways are being used. High failover rates indicate primary issues.
Test Regularly
Verify failover works by simulating primary gateway failures.
Geographic Alignment
Use providers with strong presence in your target markets.