What does Acquirer Risk Steps and Reserve Survival conclude, in numbers, about “Hot Failover: Common-Cause Failure, Timeout Budgets and Idempotency”?

Answer: Chapter 5 computes the availability ceiling of two acquiring channels with a common-cause share, and uses same-key retries, status queries and a one-success order ledger to bring 1,640 double charges per hundred thousand payments down to none left open at the end of the day.

Scope of the numbers: Parameters are illustrative; all calculations come from the book's programs. This is general risk analysis, not legal, financing or investment advice, and promises no income.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 1640

per 100,000 payments, timeout 4 s
policydouble chargesopen at end of day
A naive1,6401,640
B retry-key483483
C query4646
D C + ledger460
Show the full program
# Chapter 5. p53: double charges after failover, with and without keys.
# 100,000 payments; client timeout 4 s, so from p52 a timeout happens
# with probability 0.02763 and a timed-out call has still charged the
# card with probability 0.6. The backup gateway charges with
# probability 0.97. Four policies (same seed for each):
#   A naive     : on timeout, charge the backup at once;
#   B retry-key : retry the primary once with the same idempotency key
#                 (answers with probability 0.7, never double charges),
#                 then fail over as in A;
#   C query     : B, then ask the primary for the order's status (the
#                 status call answers with probability 0.9); fail over
#                 only when the answer is "not charged" or no answer;
#   D C + ledger: C, and the order ledger accepts one success per order
#                 key; a second success is voided the same day, and the
#                 end-of-day reconciliation refunds what is left.
# Reported: double charges made, and double charges still open at the
# end of the day. All numbers illustrative.
import random

N = 100000
P_TO, P_LATE_OK, P_BACKUP = 0.02763, 0.6, 0.97
P_RETRY_ANS, P_STATUS = 0.7, 0.9


def run(policy):
    rng = random.Random(39753)
    made = open_end = 0
    for _ in range(N):
        if rng.random() >= P_TO:
            continue
        charged_primary = rng.random() < P_LATE_OK
        if policy in "BCD" and rng.random() < P_RETRY_ANS:
            continue
        if policy in "CD" and rng.random() < P_STATUS:
            if charged_primary:
                continue
        if rng.random() < P_BACKUP and charged_primary:
            made += 1
            if policy != "D":
                open_end += 1
    return made, open_end


def main():
    names = {"A": "naive", "B": "retry-key", "C": "query", "D": "C + ledger"}
    print("per {:,} payments, timeout 4 s".format(N))
    print("policy        double charges   open at end of day")
    for p in "ABCD":
        made, left = run(p)
        print("{} {:<11} {:>10,}       {:>10,}".format(p, names[p], made,
                                                   left))


if __name__ == "__main__":
    main()

Single source and citation

Fan, Y. (2026). Payment-Acquirer Risk Step-Functions, Multi-Gateway Hot Failover and Rolling-Reserve Survival for Digital Fleets (Version 1.0.0), Chapter 5: Hot Failover: Common-Cause Failure, Timeout Budgets and Idempotency. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-397 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026397,
  author    = {Fan, Yafu},
  title     = {Payment-Acquirer Risk Step-Functions, Multi-Gateway Hot Failover and Rolling-Reserve Survival for Digital Fleets},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book