Naresh Tiwari avatar
ProjectsShenanigansBlogsGuestBookResume
All posts

Behind the Pay Button: Why Payment Routing and Orchestration Are Interesting

How payment orchestration coordinates providers, routing decisions and eligible retries—and why payment correctness makes the engineering interesting.

October 9, 2026 · Payment systems · 4 min read

Behind the Pay Button: Pay, choose a route, and a payment provider

You click Pay, wait a few seconds, and see “Payment failed.”

Sometimes the problem is a temporary issue with the payment provider. For a business, that can mean losing a customer who was ready to buy.

This is where payment routing and orchestration become interesting: they give businesses more control over how payments are processed.

What is payment orchestration?

Payment orchestration connects multiple payment providers through a unified software layer. It coordinates payment operations, including routing, authorisation, and related workflows.

Routing is one decision within that process: choosing which provider should handle a particular transaction.

A useful analogy is navigation. Routing chooses a suitable road; orchestration manages the wider journey.

How does payment routing work?

A routing engine can first identify eligible providers, then apply business rules and consider current provider performance. The exact sequence depends on the implementation.

Customer clicks Pay, enters an orchestration layer, finds eligible providers and applies merchant rules. Dynamic routing considers current performance; otherwise the configured order is used. The selected provider receives the payment.
Figure 1: A simplified routing flow. Eligibility and configuration determine which providers can be considered. The supplied diagram names Juspay as its example orchestration layer; the exact sequence depends on the implementation.

For example, a provider might support the right payment method and currency, but currently be experiencing technical problems. Another eligible provider could be a better choice.

Routing can also account for processing costs and commercial commitments. The cheapest route and the route with the strongest acceptance rate may differ, so the business must decide what to prioritise.

What happens when a payment fails?

Some failures can be recovered by an eligible retry through another provider. However, retry decisions must consider the failure reason.

A successful payment is confirmed. A confirmed failure is retried through an alternative provider only if eligible. Pending or unknown results require resolving the payment status before another charge is attempted.
Figure 2: A conceptual failure-handling flow. An unknown result needs investigation before another charge is attempted.

Why can this be useful?

Consider a hypothetical batch of 1,000 payments:

  • 900 payments succeed initially.
  • Eligible fallback attempts recover another 60.
  • The final total becomes 960 successful payments.

This illustrates the potential benefit of fallback. It is example data, not a measured industry result or a guaranteed improvement.

Illustrative graph with a zero-based axis: 900 successful initial attempts and 960 successful payments after eligible fallback, from a hypothetical batch of 1,000.
Illustrative example: Initial attempts: 900 / After fallback: 960. Example data only; not a measured industry result or a guaranteed improvement.

The advantage is having alternatives when one provider struggles. Routing can help businesses pursue better acceptance rates, manage processing costs, and distribute traffic according to their requirements.

Why I find the technology interesting

From a developer’s perspective, payment orchestration brings several difficult engineering problems together.

Decisions change with live conditions. A provider that worked well earlier may become unreliable. Routing introduces a feedback loop: observe performance, make a decision, and evaluate the result.

Failure handling affects real money. A timeout raises a difficult question: did the payment fail, or did the response fail to arrive? Correct state management matters as much as choosing a provider.

Retries need safeguards. Idempotency keys help prevent repeated API requests from creating duplicate transactions. They are one part of payment correctness, alongside reliable status handling.

Technical decisions have visible business consequences. A routing decision can affect whether a customer completes an order, how much processing costs, and how smoothly checkout works.

My assessment is that orchestration becomes especially valuable when a business has multiple providers, significant payment volume, or complex routing requirements. A smaller application may find one gateway sufficient.

What makes this technology compelling is the combination of decision-making, distributed systems, and financial correctness—all hidden behind a single Pay button.

Naresh Tiwari

Software Developer

  • X
  • GitHub
  • LeetCode

"If you never want to be criticized, don't do anything new."

~ Jeff Bezos

Let's build something amazing.

Contact me about projects and collaborations

nareshtiwarilog@gmail.com

find me online

GitHub
GitHub
LeetCode
LeetCode
X
X
Instagram
Instagram

© 2026 Naresh Tiwari.