Practice challengeIdempotency and paymentsIntermediate

Duplicate Payment Prevention

Examine how an agent should recover when a payment call times out and the previous attempt may already have succeeded.

Original scenario-based practice challenge for Agentic Architect Lab. This is not an official certification question.

Scenario

A payment request timed out, but the processor may already have charged the customer. What should happen before any retry?

A checkout agent sent a payment request to a processor and then hit a timeout before it received a response. The customer clicks “Pay now” again, and the agent can either retry the call or create a fresh charge. The business requirement is to charge the customer at most once for the same order, even if the network or provider response is delayed.

Which design best avoids duplicate charges while still allowing recovery from uncertain outcomes?

Select the best design option
Back to practiceNext challenge: Shared Agent State