AntifrogACADEMYExplore Antifrog ↗
Theory Lesson 11
PAYMENTS / 5 MIN

One intention. One payment.

Treat a timeout as uncertainty, not permission to charge again.

01

The missing response

A network timeout tells the caller that a response did not arrive in time. It does not establish whether the remote operation ran. A payment may have been accepted just before the connection failed, leaving the caller uncertain about the outcome.

02

Identity for an intention

Idempotency means repeated execution has the same intended effect as a single execution. Payment APIs may provide application-level keys for this purpose; their exact scope, retention and conflict behaviour must be checked. HTTP POST alone does not supply a general duplicate-payment guarantee.

03

A careful retry

Imagine a €40 purchase submitted with a stable operation key. The response is lost. Follow the provider’s documented status-query and retry contract using that same intention, rather than inventing a new key for every network attempt. A genuinely new purchase needs its own identity.

04

Test the uncomfortable paths

Exercise timeouts after acceptance, concurrent attempts, expired keys and reuse with changed amounts. Keep request identity separate from tracing identifiers, which may change on each attempt. Review how long your own system remembers completed intentions before relying on a retry mechanism during an outage.

Check your understanding

A charge request times out after submission. Which statement is sound?