---
title: "Verify repeated checkout submission cannot charge twice"
description: "Exercise a supported delayed-payment fixture and repeated user submission, then reconcile order identifiers and successful charges for the same checkout intent."
canonical_url: "https://vostride.com/agent-library/checkout-payments/submit-twice-idempotency.md"
md_url: "https://vostride.com/agent-library/checkout-payments/submit-twice-idempotency.md"
content_kind: "recipe"
topic: "checkout-payments"
---

# Verify repeated checkout submission cannot charge twice

Exercise a supported delayed-payment fixture and repeated user submission, then reconcile order identifiers and successful charges for the same checkout intent.

## Risk

Customers can double-click or retry when a payment takes time. The interface may disable submission, but durable protection also depends on the application preserving one purchase intent across repeated requests.

## Fixtures

- A test-owned cart with a unique run marker and a fixed expected total.
- A supported sandbox fixture delaying payment completion long enough to observe the submit state.
- Hooks reporting checkout intent, order identities, payment attempt outcomes, and inventory reservations.

## Steps

1. Open the final checkout review and verify the cart identity, quantity, currency, and total.
2. Submit payment and immediately attempt the same visible submit control again while the delay fixture keeps the first attempt pending.
3. Verify the interface communicates processing and prevents or safely handles repeated activation without resetting the checkout contents.
4. Allow the fixture payment to complete and verify one stable order confirmation; reload the confirmation once.
5. Inspect checkout, order, and payment hooks and verify one completed order and one successful charge for the purchase intent, with inventory reserved only once.

## Expected results

- Repeated user submission does not create a second completed purchase.
- All accepted attempts resolve consistently to the intended checkout outcome.
- The stored payment and inventory effects occur once for the order.

## False-pass traps

- A disabled button is helpful evidence but cannot establish server-side idempotency by itself.
- Two failed or pending attempt records are not equivalent to two successful captures; count settled effects separately.

## Cleanup

- Refund or cancel the sandbox order, release inventory, and disable the delay fixture.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)
- [agent-qa auth state](/docs/agent-qa/guides/auth-state.md)

- [Checkout and payment QA recipes](/agent-library/checkout-payments.md)
- [Software factory QA library](/agent-library.md)
