Skip to content

feat(dedup): add generateIdempotencyKey and key registry (#612) - #811

Closed
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/generate-idempotency-key-612
Closed

ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/generate-idempotency-key-612

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Closes #612

What

Adds a canonical idempotency key generator and an in-memory key registry for payment deduplication.

Changes

  • generateIdempotencyKey(params) — deterministic SHA-256 hex digest of {invoiceId}:{payer}:{amount} (with optional :{nonce} suffix)
  • isKnownKey(key) / registerKey(key) / clearKeys() — in-memory Set-backed registry
  • All exported from src/index.ts alongside existing Deduplicator
  • 8 unit tests covering determinism, input sensitivity, nonce variation, and registry lifecycle

Verification

  • Unit tests included in test/dedup.test.ts

…it#612)

- generateIdempotencyKey: deterministic SHA-256 hex key from invoiceId, payer, amount
- isKnownKey / registerKey / clearKeys: in-memory Set-backed registry
- Exported from index.ts alongside existing Deduplicator
- Unit tests: determinism, input sensitivity, nonce variation, registry lifecycle

Closes Stellar-split#612
@Kingsman-99

Copy link
Copy Markdown
Contributor

Closing this PR — it was opened against an issue that wasn't assigned to you. To avoid duplicate work, please wait for an issue to be assigned before submitting a PR for it. Feel free to comment on the issue to request assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add generateIdempotencyKey for canonical payment deduplication

2 participants