Payments Academy
Smart routing PAYMENT OPERATIONS STARTED LIVE 01 Smart routing - decision a gateway makes ACTIVE 02 Failover - what happens when the chosen acquirer does QUEUED 03 Retry strategies decide when to try - how many times, and with what delay. QUEUED 04 Circuit breakers protect the whole system - when an acquirer is failing badly. QUEUED 05 Real outage - matters. QUEUED 06 Merchant with no failover - would have lost the full hour of sales QUEUED Smart routing is the decision a gateway makes, in milliseconds, about which acquirer should handle a given transaction. Step 1 of 6 Smart routing STARTED Smart routing decision a gateway makes ACTIVE Failover what happens when the chosen acquirer does QUEUED Retry strategies decide when to try how many times, and with what delay. QUEUED Circuit breakers protect the whole system when an acquirer is failing badly. QUEUED Real outage matters. QUEUED Merchant with no failover would have lost the full hour of sales QUEUED Smart routing is the decision a gateway makes, in milliseconds, about which acquirer should handle a given transaction.
Failover: happens when chosen acquirer PAYMENT OPERATIONS IN PROGRESS LIVE 01 Smart routing - decision a gateway makes DONE 02 Failover - what happens when the chosen acquirer does ACTIVE 03 Retry strategies decide when to try - how many times, and with what delay. QUEUED 04 Circuit breakers protect the whole system - when an acquirer is failing badly. QUEUED 05 Real outage - matters. QUEUED 06 Merchant with no failover - would have lost the full hour of sales QUEUED Failover is what happens when the chosen acquirer does not respond. Step 2 of 6 Failover: happens when chosen acquirer IN PROGRESS Smart routing decision a gateway makes DONE Failover what happens when the chosen acquirer does ACTIVE Retry strategies decide when to try how many times, and with what delay. QUEUED Circuit breakers protect the whole system when an acquirer is failing badly. QUEUED Real outage matters. QUEUED Merchant with no failover would have lost the full hour of sales QUEUED Failover is what happens when the chosen acquirer does not respond.
Retry strategies decide when to try again PAYMENT OPERATIONS IN PROGRESS LIVE 01 Smart routing - decision a gateway makes DONE 02 Failover - what happens when the chosen acquirer does DONE 03 Retry strategies decide when to try - how many times, and with what delay. ACTIVE 04 Circuit breakers protect the whole system - when an acquirer is failing badly. QUEUED 05 Real outage - matters. QUEUED 06 Merchant with no failover - would have lost the full hour of sales QUEUED Retry strategies decide when to try again, how many times, and with what delay. Step 3 of 6 Retry strategies decide when to try again IN PROGRESS Smart routing decision a gateway makes DONE Failover what happens when the chosen acquirer does DONE Retry strategies decide when to try how many times, and with what delay. ACTIVE Circuit breakers protect the whole system when an acquirer is failing badly. QUEUED Real outage matters. QUEUED Merchant with no failover would have lost the full hour of sales QUEUED Retry strategies decide when to try again, how many times, and with what delay.
Circuit breakers protect the whole system PAYMENT OPERATIONS IN PROGRESS LIVE 01 Smart routing - decision a gateway makes DONE 02 Failover - what happens when the chosen acquirer does DONE 03 Retry strategies decide when to try - how many times, and with what delay. DONE 04 Circuit breakers protect the whole system - when an acquirer is failing badly. ACTIVE 05 Real outage - matters. QUEUED 06 Merchant with no failover - would have lost the full hour of sales QUEUED Circuit breakers protect the whole system when an acquirer is failing badly. Step 4 of 6 Circuit breakers protect the whole system IN PROGRESS Smart routing decision a gateway makes DONE Failover what happens when the chosen acquirer does DONE Retry strategies decide when to try how many times, and with what delay. DONE Circuit breakers protect the whole system when an acquirer is failing badly. ACTIVE Real outage matters. QUEUED Merchant with no failover would have lost the full hour of sales QUEUED Circuit breakers protect the whole system when an acquirer is failing badly.
Real outage shows why this PAYMENT OPERATIONS IN PROGRESS LIVE 01 Smart routing - decision a gateway makes DONE 02 Failover - what happens when the chosen acquirer does DONE 03 Retry strategies decide when to try - how many times, and with what delay. DONE 04 Circuit breakers protect the whole system - when an acquirer is failing badly. DONE 05 Real outage - matters. ACTIVE 06 Merchant with no failover - would have lost the full hour of sales QUEUED A real outage shows why this matters. Step 5 of 6 Real outage shows why this IN PROGRESS Smart routing decision a gateway makes DONE Failover what happens when the chosen acquirer does DONE Retry strategies decide when to try how many times, and with what delay. DONE Circuit breakers protect the whole system when an acquirer is failing badly. DONE Real outage matters. ACTIVE Merchant with no failover would have lost the full hour of sales QUEUED A real outage shows why this matters.
Merchant with no failover PAYMENT OPERATIONS COMPLETE LIVE 01 Smart routing - decision a gateway makes DONE 02 Failover - what happens when the chosen acquirer does DONE 03 Retry strategies decide when to try - how many times, and with what delay. DONE 04 Circuit breakers protect the whole system - when an acquirer is failing badly. DONE 05 Real outage - matters. DONE 06 Merchant with no failover - would have lost the full hour of sales ACTIVE A merchant with no failover would have lost the full hour of sales instead. Step 6 of 6 Merchant with no failover COMPLETE Smart routing decision a gateway makes DONE Failover what happens when the chosen acquirer does DONE Retry strategies decide when to try how many times, and with what delay. DONE Circuit breakers protect the whole system when an acquirer is failing badly. DONE Real outage matters. DONE Merchant with no failover would have lost the full hour of sales ACTIVE A merchant with no failover would have lost the full hour of sales instead.

Key points of this lesson, in order.

0:00 / 3:37 Step 1 of 6

Routing and Retries

Payment Gateway Architecture, Lesson 4 of 7, Narration 3:37, D09 Payment architecture and technology

Circuit breakerIdempotencyAcquirer

What you will learn

Your objective. By the end of this lesson, you will be able to explain routing and retries. Smart routing is the decision a gateway makes, in milliseconds, about which acquirer should handle a given transaction.

Why it matters. A gateway that offers only one acquirer cannot fail over, so multi acquirer support is a key question for a business analyst to ask during vendor evaluation.

Chapter objective: Learner explains payment gateway architecture, including checkout, token vault, routing, retries, and settlement, and designs a gateway flow for an online merchant. Learner practises this skill on realistic banking cases, explaining the reasoning clearly and using correct terminology throughout the work.

Key learning points

  • Smart routing
  • Failover: happens when chosen acquirer
  • Retry strategies decide when to try again
  • Circuit breakers protect the whole system
  • Real outage shows why this
  • Merchant with no failover

Key terms

Circuit breaker: A resilience pattern that stops calling a failing service after a set number of failures, giving it time to recover.

Idempotency: The property that repeating the same request has the same effect as sending it once. In payments, an idempotency key lets a client safely retry a request after a timeout without creating a duplicate...

Acquirer: A bank or licensed institution that processes card payments for merchants and receives transaction funds from card schemes on their behalf.

Banking architecture diagram showing Routing and Retries.

Practise this lesson

Exercise

Route the payment described in this lesson and justify the route.

Use the routing rules, the correspondent chain and the charges in this lesson.

  1. What to do. Name each bank in the chain, the message used on each leg, and the charges deducted at each step.

Correct result. The route follows the correspondent chain from the debtor agent to the creditor agent, with each intermediary deducting its charge and passing the remainder on. The message on each leg carries the information the next bank needs.

Why. Routing is a business decision with a cost. The wrong route is slower, more expensive, or fails.

Check your understanding

Practice question

Which of the following best describes routing and retries?

Takeaway and next step

What to remember

A gateway that offers only one acquirer cannot fail over, so multi acquirer support is a key question for a business analyst to ask during vendor evaluation.

Send a payment through the hub and watch it pass each component named in this lesson.

Open the Payment Hub Architecture Simulator →

Builds on "Gateway APIs".

Transcript and full text

Show transcript

Smart routing is the decision a gateway makes, in milliseconds, about which acquirer should handle a given transaction. The routing engine looks at the card type, the issuing bank, the transaction amount, the currency, the time of day and the recent approval rate for each acquirer. For example, a Visa credit card issued by Axis Bank for 12,000 rupees might route to Acquirer A, which approved 94 percent of similar Axis Bank transactions in the last hour, while a RuPay debit card for 450 rupees might route to Acquirer B, which charges a lower fee for small domestic debit payments. The goal is to maximize approvals and minimize cost at the same time, and the routing rules are tuned continuously from live performance data. Failover is what happens when the chosen acquirer does not respond. The gateway waits for a short timeout, often two to five seconds, and then sends the same authorization request to a backup acquirer. The customer sees only a slightly longer wait, not an error page, and the merchant avoids losing a sale because of a single bank outage. Failover works only when the merchant has more than one acquiring relationship, either directly or through the gateway, and when the backup acquirer supports the same card network and currency. A gateway that offers only one acquirer cannot fail over, so multi acquirer support is a key question for a business analyst to ask during vendor evaluation. Retry strategies decide when to try again, how many times, and with what delay. A retry makes sense for a temporary failure, such as a network timeout or a response code that means try again later, and it makes no sense for a hard decline, such as insufficient funds or a stolen card report. A common pattern is exponential backoff, where the first retry happens after one second, the second after two seconds, and the third after four seconds, with a maximum of three attempts. Each retry carries the same idempotency key, so a success on the second attempt does not create a duplicate charge. Retrying a hard decline wastes time, annoys the customer and can trigger fraud alerts, so the gateway must read the decline code before it decides. Circuit breakers protect the whole system when an acquirer is failing badly. A circuit breaker watches the error rate for each acquirer, and when failures pass a threshold, for example 50 percent of requests failing in five minutes, it opens the circuit and stops sending traffic to that acquirer for a cooling off period, often five to fifteen minutes. During that period, all traffic goes to healthy acquirers. After the cooling off period, the breaker allows a small number of test requests through, and if they succeed, it closes the circuit and restores normal routing. Without a circuit breaker, a gateway would keep hammering a dead acquirer, delaying every customer and filling logs with timeouts. A real outage shows why this matters. Suppose Acquirer A goes down at 7 in the evening during a festival sale, when a fashion merchant is processing 2,000 orders per hour. The gateway circuit breaker opens after 30 seconds of failures, and traffic shifts to Acquirer B within a minute. About 40 transactions fail during the switch, and the gateway retries the timeout cases automatically, so only 12 customers see an error and most of them succeed on a second attempt. The gateway dashboard records the incident, the number of transactions rerouted, and the approval rate by acquirer, so the merchant can claim service credits if the gateway contract includes an uptime guarantee. A merchant with no failover would have lost the full hour of sales instead.

Smart routing is the decision a gateway makes, in milliseconds, about which acquirer should handle a given transaction. The routing engine looks at the card type, the issuing bank, the transaction amount, the currency, the time of day and the recent approval rate for each acquirer. For example, a Visa credit card issued by Axis Bank for 12,000 rupees might route to Acquirer A, which approved 94 percent of similar Axis Bank transactions in the last hour, while a RuPay debit card for 450 rupees might route to Acquirer B, which charges a lower fee for small domestic debit payments. The goal is to maximize approvals and minimize cost at the same time, and the routing rules are tuned continuously from live performance data.

Failover is what happens when the chosen acquirer does not respond. The gateway waits for a short timeout, often two to five seconds, and then sends the same authorization request to a backup acquirer. The customer sees only a slightly longer wait, not an error page, and the merchant avoids losing a sale because of a single bank outage. Failover works only when the merchant has more than one acquiring relationship, either directly or through the gateway, and when the backup acquirer supports the same card network and currency. A gateway that offers only one acquirer cannot fail over, so multi acquirer support is a key question for a business analyst to ask during vendor evaluation.

Retry strategies decide when to try again, how many times, and with what delay. A retry makes sense for a temporary failure, such as a network timeout or a response code that means try again later, and it makes no sense for a hard decline, such as insufficient funds or a stolen card report. A common pattern is exponential backoff, where the first retry happens after one second, the second after two seconds, and the third after four seconds, with a maximum of three attempts. Each retry carries the same idempotency key, so a success on the second attempt does not create a duplicate charge. Retrying a hard decline wastes time, annoys the customer and can trigger fraud alerts, so the gateway must read the decline code before it decides.

Circuit breakers protect the whole system when an acquirer is failing badly. A circuit breaker watches the error rate for each acquirer, and when failures pass a threshold, for example 50 percent of requests failing in five minutes, it opens the circuit and stops sending traffic to that acquirer for a cooling off period, often five to fifteen minutes. During that period, all traffic goes to healthy acquirers. After the cooling off period, the breaker allows a small number of test requests through, and if they succeed, it closes the circuit and restores normal routing. Without a circuit breaker, a gateway would keep hammering a dead acquirer, delaying every customer and filling logs with timeouts.

A real outage shows why this matters. Suppose Acquirer A goes down at 7 in the evening during a festival sale, when a fashion merchant is processing 2,000 orders per hour. The gateway circuit breaker opens after 30 seconds of failures, and traffic shifts to Acquirer B within a minute. About 40 transactions fail during the switch, and the gateway retries the timeout cases automatically, so only 12 customers see an error and most of them succeed on a second attempt. The gateway dashboard records the incident, the number of transactions rerouted, and the approval rate by acquirer, so the merchant can claim service credits if the gateway contract includes an uptime guarantee. A merchant with no failover would have lost the full hour of sales instead.

Full lesson text (all scenes)

Completing a lesson updates your progress dashboard on the homepage.

Scene timestamps are estimated by allocating the narration text proportionally across the real audio length. The audio playback position is the source of truth: pause freezes the visual, seeking restores the correct scene, replay restarts the scene animation.