Multi-provider payments

Payment orchestration: routing, failover, and who owns the cards

Payment orchestration gets sold as a bigger approval rate. What it actually buys you is a choice of provider per payment, and a way to keep taking money when one of them is down. Both depend on something less exciting: holding the card credentials somewhere every provider can use. Here's what an orchestration layer does, the network rules that limit failover, build vs buy, and how to move cards out of a PSP, with the router design from chapter 18.

Retry rules are from the Visa Rules (24 October 2026 edition); Stripe Orchestration, Vault and Forward and the card export process are from Stripe's docs, all checked on 14 November 2026. Ask each acquirer how it applies the reattempt rules to you.

Payment orchestration is a layer between your checkout and two or more payment providers that decides, for each payment, which provider to send it to (routing), what to do when that provider fails (failover), and keeps the card credentials in one vault so that any provider can be used. A payment orchestration platform is that layer sold as a product.

It does four jobs:

JobWhat it meansThe hard part
RoutingPick a provider per payment: by country, currency, card type, amount, cost or recent approval rateGetting enough data per segment to know which is better
FailoverSend the payment elsewhere when a provider is down or declinesThe network rules below, and not charging twice
VaultStore cards once, use them with every providerPCI scope, and network tokens that belong to one provider
ReportingOne view of payments across providersEvery provider reports, settles and pays fees differently

When one PSP is still enough

Most businesses don't need it. You probably don't if one provider supports every country and payment method you sell in, you have no second acquiring contract to route to, and your outage plan is a status page. Orchestration starts to pay when you have a measured reason: a market where another acquirer approves more of your customers' cards, a negotiated rate somewhere else, or an outage that cost you a day's revenue.

Vendors publish approval uplift figures. We don't repeat them: they're averages over other people's traffic. Measure your own approval rate per provider and card country, with a holdout, before and after.

Failover has rules

Sending a declined payment to a second provider is the feature everyone wants and the one the card networks restrict. From the Visa Rules (24 October 2026 edition, Table 7-2) (Visa Rules):

  • Category 1, "Issuer will never approve" (codes 04, 07, 12, 14, 15, 41, 43, 46, 57, R0, R1, R3): "a Merchant must never resubmit an Authorization Request ... for the same Payment Credential". A different provider is still the same card.
  • Categories 2, 3 and 4 (insufficient funds, data quality, generic codes): reattempts permitted, "up to 20 attempts in 30 days". That limit is per card, so count attempts across every provider, not per provider. Visa's 2020 rule notice allowed 15. Soft vs hard declines covers the categories and Mastercard's Merchant Advice Codes.
  • Don't change the story. A merchant reattempting after a decline "must not intentionally manipulate any data elements from the original Authorization Request", and the list starts with the acquiring identifier and the acquirer and merchant country (Visa Rules). Cross-processor retries exist as a product (Stripe offers one, below), so keep merchant country, MCC and the rest identical on the retry, and ask your acquirers how they apply the rule to you.

Two more stops. If the customer already went through 3D Secure on the first attempt, don't retry elsewhere: Stripe's own Orchestration doesn't (Stripe). And a timeout is not a decline. Stripe's guidance for a connection error is to treat the result as indeterminate, "don't assume that it succeeded or that it failed" (Stripe). Look up the payment before you try another provider, or the customer gets two holds for one order.

In code: a failover that stays inside the rules

# Visa Category 1: never resubmit for the same card (Visa Rules, Table 7-2).
VISA_NEVER_RETRY = {"04", "07", "12", "14", "15", "41", "43", "46", "57",
                    "R0", "R1", "R3"}
MAX_ATTEMPTS = 2  # one failover, not a tour of every acquirer you have


class ProviderUnavailable(Exception):
    """Timeout, connection error or 5xx: the provider never gave an answer."""


def charge(payment, chain, breakers, attempts_this_month):
    """Try providers in order. Stop on approval, a hard decline, or the cap.

    attempts_this_month: authorizations already sent for this card in the
    last 30 days, across every provider (Visa's limit is per card, not per PSP).
    """
    tried = 0
    for provider in chain:
        if tried >= MAX_ATTEMPTS or attempts_this_month + tried >= 20:
            break
        if breakers[provider.name].is_open():
            continue  # skipping a known-down provider costs no attempt
        tried += 1
        try:
            result = provider.authorize(payment, idempotency_key=f"{payment.id}:{provider.name}")
        except ProviderUnavailable:
            breakers[provider.name].record_failure()
            # The authorization may exist. Find out before going elsewhere,
            # or the customer gets two holds for one order.
            existing = provider.find_authorization(payment.id)
            if existing is not None:
                return existing
            continue
        breakers[provider.name].record_success()
        if result.approved:
            return result
        if result.three_ds_attempted:
            return result  # the customer already failed or passed 3DS once
        if payment.card_brand == "visa" and result.network_code in VISA_NEVER_RETRY:
            return result  # the issuer will never approve this card
        if result.network_code is None:
            return result  # no network code, no basis for a retry decision
        # Soft decline: one more provider may try, with identical order data.
    return None

Provider failures (timeouts, 5xx, an open circuit breaker) are where failover earns its keep, because the issuer never saw the payment. Declines are where it gets you fined. The chapter 18 router below does the eligibility and ranking that decides the chain.

Build vs buy

Build your ownBuy an orchestration platformPSP-native routing
Who holds the card dataYou: your systems store card numbers, and you're in SAQ D territory or a full assessmentThe vendor's vault, under its own PCI attestationThe PSP's vault
Who builds each provider integrationYouThe vendorThe PSP
Who's the processor for routed paymentsEach providerEach providerEach provider: on Stripe, the third-party processor "continues to act as the processor", and its fees and loss liability stay under your terms with it (Stripe)
Disputes, refunds, settlementPer providerPer provider, often one dashboardPer provider: Stripe's Orchestration doesn't handle disputes or settlement for third-party processors

Stripe's Orchestration is in private preview. It routes PaymentIntents to other processors by rules, retries failed payments on a second processor, and reports success rates per processor; it doesn't support non-card payments, Link, Connect or Terminal (Stripe).

Under it sits the Vault and Forward API: Stripe stores the card and forwards it to a third-party endpoint on your request, so you can use Stripe's Payment Element and vault with another processor. It's "available only to businesses with a dedicated Stripe account team", forwards only to endpoints Stripe has approved, and leaves refunds and disputes with the third party (Stripe). The approved list includes processors (Adyen, Braintree, Checkout.com, Fiserv, Worldpay and others) and orchestration and vault vendors, among them Spreedly, Yuno, ProcessOut, PaymentsOS, VGS, Basis Theory, TokenEx and Evervault. That list is also a fair map of who sells orchestration and vaulting.

Getting your cards out of Stripe

The vault is the lock-in. Stripe will hand over your customers' card data, on these terms (Stripe):

  • It goes only to another PCI DSS Level 1 payment processor, which shows a current Attestation of Compliance or a listing on Visa's Global Registry of Service Providers.
  • The receiver supplies a PGP public key of at least 4096 bits, hosted over HTTPS on a domain named in its AOC or registry listing.
  • Stripe sends an encrypted JSON file with card details, customer emails and metadata. Cards saved through Link are excluded, and payment history and subscriptions aren't exported: pull those through the API.
  • You start it by contacting Stripe support with the name of the new processor.

Note what the documented export contains: card numbers, expiry dates and billing addresses. It doesn't mention network tokens. Stripe requests network tokens on your behalf, and they're "specific to a card-merchant pair" (Stripe), so plan on your new processor provisioning its own after the import. Network tokens covers why they matter for stored cards.

The export is a one-time move. If you want to route between providers continuously, you need one vault that every provider can draw from: an orchestration vendor's, Stripe's through Vault and Forward, or your own.

Eligibility first, rules second, fallbacks third: the router that builds the chain the failover code above walks. From chapter 18.

Payment Router Design (Your Decision Engine)

Think of the payment router as your system's brain. Every payment that comes in gets analyzed: Where's this customer from? How much are they spending? What payment method? Then it makes a smart decision about which provider to try first.

We learned this the hard way. Our first system was exactly that Stripe-then-PayPal backup, and it stayed that way for far too long. Real orchestration considers context.

With the chain chosen, the orchestrator works down it until a provider accepts the payment or the chain runs out.

Implementation: src/examples/18-orchestration/payment_orchestrator.py

Key Components: - PaymentOrchestrator: Core routing engine with intelligent provider selection - PaymentExecutor: Cascading execution with automatic fallback - PaymentContext: Request context for routing decisions - ProviderConfig: Provider capabilities and constraints

Payment Routing Flow (Conceptual):

# Core orchestration pattern (conceptual)
def route_payment(context):
    # 1. Filter eligible providers
    eligible = filter_providers(
        country=context.country,
        currency=context.currency,
        payment_method=context.payment_method,
        amount=context.amount
    )

    # 2. Apply routing rules (amount rules first, so they apply everywhere)
    if context.amount > 1000:
        primary = select_provider(WORLDPAY, eligible)  # Negotiated high-value rate
    elif context.amount < 10:
        primary = select_cheapest_provider(eligible)
    elif context.country in ['US', 'CA']:
        primary = select_provider(STRIPE, eligible)
    elif context.country in ['GB', 'DE', 'FR']:
        primary = select_provider(ADYEN, eligible)
    else:
        primary = select_best_scored_provider(eligible)  # Default for everything else

    # 3. Select fallback providers
    fallbacks = select_fallbacks(eligible, primary)

    return [primary] + fallbacks  # Routing chain

See src/examples/18-orchestration/README.md for complete implementation with execution engine, metrics collection, and provider configuration management.

Design principles that actually work:

Eligibility comes first. Don't even think about routing a EUR 500 payment to a USD-only provider. Sounds obvious, but plenty of systems skip the check and then wonder why everything fails. From there, base your business rules on real data rather than meeting-room theory - "European providers work better in Europe" holds up because the success rate numbers say so, not because it sounds plausible.

Always have a Plan B and a Plan C. The whole point of orchestration is resilience, and we've seen systems with a single fallback that wasn't enough. Log every routing decision, because three months from now someone will ask "why did we route this payment to Adyen instead of Stripe?" and you'll need an answer. Finally, keep the rules in config files, not code. When you need to emergency-route all traffic away from a misbehaving provider, you don't want to wait for a deployment.

Where orchestration usually starts: a direct processor for the bulk of card volume, a PSP for the rest. From chapter 4.

The Hybrid Approach

Many large businesses use both: high-volume cards through a direct processor for lower fees, and a PSP for everything else where convenience wins. This usually runs through payment orchestration - a routing layer that picks the cheapest, highest-success provider per transaction. Chapter 18 covers it in detail.

Questions

What is payment orchestration?

Payment orchestration is a layer between your checkout and two or more payment providers. It routes each payment to a provider, fails over when one is down or declines, and keeps card credentials in one vault so any provider can be used. A payment orchestration platform sells that layer as a product.

What is payment routing?

Payment routing is choosing which provider or acquirer handles each payment, using rules on things like card country, currency, amount, cost and recent approval rates. It's one of the jobs an orchestration layer does.

Can I retry a declined card on a different payment processor?

Only for some declines. Under Visa's rules, a Category 1 decline (such as stolen card or no such account) must never be resubmitted for the same card, on any provider. Other declines may be retried up to 20 times in 30 days per card, across all providers, without changing data such as the merchant country. Don't retry after the customer has already been through 3D Secure.

Does Stripe offer payment orchestration?

Yes, in private preview. Stripe Orchestration routes payments to other processors by rules and can retry failed payments on a second processor. The other processor stays the processor for those payments, and disputes and settlement stay with it. It doesn't support non-card payments, Link, Connect or Terminal.

How do I export card data from Stripe?

Contact Stripe support with the name of your new processor. Stripe sends an encrypted JSON file with card details, emails and metadata, only to a PCI DSS Level 1 processor with a current AOC or Visa registry listing and a 4096-bit PGP key. Link cards, payment history and subscriptions aren't included.

What the book adds

The rest of chapter 18

  • Cascading execution with circuit breakers
  • Scoring providers on approval, cost, geography and latency
  • A/B testing a routing change without losing money
  • What a transaction really costs per provider
  • Per-provider monitoring that catches a degraded PSP

30-day money-back · Instant PDF and EPUB

All 42 chapters