DEV Community

Cover image for Your Payment Provider Is Down—Now What? Architecting FinTech for Third-Party Failure
Vaibhav Shakya
Vaibhav Shakya

Posted on

Your Payment Provider Is Down—Now What? Architecting FinTech for Third-Party Failure

Your primary payment provider stops responding. Your backend detects the outage and redirects the transaction to a secondary provider.

Problem solved, right?

Not necessarily. You may have just charged your customer twice.

Building resilient FinTech systems requires more than provider redundancy. It requires preserving financial correctness when external dependencies behave unpredictably.

The Problem: API Failure Is Not Payment Failure

Consider a payment authorization request:

  1. Provider A receives the payment request.
  2. The provider successfully authorizes the transaction.
  3. Your backend experiences a timeout.
  4. Your orchestration layer retries through Provider B.
  5. Provider B independently authorizes the payment.

Both providers may have correctly implemented idempotency, yet the customer may experience duplicate authorizations.

Provider-level idempotency does not automatically establish cross-provider transaction uniqueness.

The absence of a successful API response does not establish the absence of a successful financial operation.

Where It Gets Difficult

1. Unknown Transaction Outcomes

Payment systems must distinguish between confirmed success, confirmed failure, pending confirmation, and unknown outcomes.

A network timeout should not automatically mark a transaction as failed or make it eligible for another payment attempt.

2. Idempotency and Provider Failover

Idempotency guarantees depend on provider-specific contracts, operation scopes, request parameters, and retention periods.

An unresolved transaction should not automatically receive a new idempotency key or be redirected to another provider.

3. Circuit Breakers and Retry Policies

Circuit breakers help protect infrastructure from unhealthy dependencies, but they cannot establish whether an earlier financial operation succeeded.

Retries must be transaction-aware, bounded, and explicitly eligible.

4. Mobile Payment Recovery

Android and iOS applications may experience network interruptions, process termination, and background execution restrictions.

Mobile applications should preserve payment intent identifiers and recover authoritative transaction states from the backend rather than independently initiating another charge.

Architectural Direction

A resilient payment platform should incorporate:

  • Backend-controlled payment orchestration and provider selection.
  • Separate payment intent and execution attempt identities.
  • Explicit pending and unknown transaction states.
  • Provider-specific idempotency and controlled failover.
  • Authenticated webhook processing and durable financial reconciliation.

Provider selection should consider both dependency health and existing transaction state.

New payments may be routed to an eligible secondary provider during an outage. Previously submitted payments with unresolved outcomes require appropriate recovery before another conflicting financial operation is initiated.

Financial reconciliation remains essential because synchronous responses and asynchronous webhooks may not resolve every discrepancy.

The Takeaway

A circuit breaker can tell you that a payment provider is unhealthy. It cannot tell you whether your customer's previous payment succeeded.

The goal is not uninterrupted payment execution at any cost. It is financially correct, observable, and recoverable payment execution.


Want the deeper architectural breakdown, Kotlin recovery policy, Android and iOS implementation considerations, webhook processing, failure scenarios, and production-level trade-offs?

Read the full article on Medium


Follow my work

I write about software architecture, FinTech, AI, cybersecurity, distributed systems, mobile engineering, and production engineering.

Connect with me on LinkedIn

Explore more at vaibhavshakya.com

#FinTech #PaymentArchitecture #SoftwareArchitecture #DistributedSystems #SystemDesign

Top comments (0)