Skip to content
Skills Library
Programming · Building & coding

payment-idempotency

/payment-idempotency

Make payment operations safe to retry so a network timeout never charges a customer twice. Use when calling a payment API, processing webhooks, or building any money-moving endpoint.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Make payment operations safe to retry so a network timeout never charges a customer twice. Use when calling a payment API, processing webhooks, or building any money-moving endpoint.

Original author description

Make payment operations safe to retry so a network timeout never charges a customer twice. Use when calling a payment API, processing webhooks, or building any money-moving endpoint.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 40 lines, 299 words
SKILL.md preview
---
name: payment-idempotency
description: Make payment operations safe to retry so a network timeout never charges a customer twice. Use when calling a payment API, processing webhooks, or building any money-moving endpoint.
---

# Payment idempotency

The dangerous case in payments is not failure but uncertainty: the
request timed out and you do not know whether the charge happened.
Retrying without idempotency doubles the charge; not retrying may lose
it. Idempotency is what makes the retry safe.

## Method

1. **Generate the idempotency key before the first attempt.** The key
   identifies the intent, so it must be created by the caller and reused
   across every retry of that same intent, not regenerated per attempt.
2. **Derive the key from the business action.** An order id or a
   deterministic hash of the intent, so an accidental double submit from
   the same user is caught as the same operation.
3. **Send it to the provider and honour it on your own endpoints.**
   Providers deduplicate on their side; your webhook and payment
   endpoints must deduplicate on yours (see webhooks-design).
4. **Store the result against the key.** A repeat request returns the
   original outcome rather than re-executing, which is what makes the
   guarantee real rather than best effort.
5. **Reconcile on ambiguity rather than guessing.** When a timeout
   leaves state unknown, query the provider for that key before deciding
   anything (see payment-reconciliation).
6. **Set key retention long enough to matter.** Deduplicating for a few
   seconds does not help a retry from a job that runs an hour later.
7. **Keep the whole path idempotent, not just the charge.** Emails,
   entitlement grants, and ledger writes triggered by a payment must
   each tolerate replay.

## Boundaries

- Idempotency prevents duplicate execution of the same intent; it does
  not prevent a user deliberately paying twice.
- Keys scoped too broadly can suppress a legitimate second purchase, so
  the key must identify the intent precisely.
- Provider semantics differ in retention and scope, so read their rules
  rather than assuming.

Versions

The database has no other skills named payment-idempotency.

Database snapshot: 13.11.2026 · package version dd737095efed (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100stripe-patterns
    Stripe payment integration patterns. Use when implementing payment flows, handling webhooks, or working with subscriptions. Routes to existing patterns and provides evidence templates for payment testing.
  • 100stripe-patterns
    Stripe payment integration patterns. Use when implementing payment flows, handling webhooks, or working with subscriptions. Routes to existing patterns and provides evidence templates for payment testing.
  • 100idempotency-handling
    Idempotent API operations with idempotency keys, Redis caching, DB constraints. Use for payment systems, webhook retries, safe retries, or encountering duplicate processing, race conditions, key expiry errors.
  • 100br-atomic-idempotency
    Configure better-route 1.1 AtomicIdempotencyMiddleware for side-effectful POST, PUT, PATCH, or DELETE routes where concurrent duplicate execution must be prevented. Use for WpdbAtomicIdempotencyStore, lease-aware reservations, reservation_token schema migration, Idempotency-Key…
  • 100bc-payments
    Integrate BigCommerce payments — Payment Processing API, stored payment instruments, payment methods, server-side payment processing for headless, and PCI considerations. Use when building custom payment flows or processing payments programmatically.
  • 90payment-integration
    Integrate a payment provider so charges are authorised, confirmed, and recorded correctly even when the customer closes the tab. Use when adding checkout or moving to a new payment provider.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.