veza/docs
senke 3cd82ba5be fix(hyperswitch): idempotency-key on create-payment and create-refund — v1.0.7 item D
Every outbound POST /payments and POST /refunds from the Hyperswitch
client now carries an Idempotency-Key HTTP header. Key values are
explicit parameters at every call site — no context-carrier magic,
no auto-generation. An empty key is a loud error from the client
(not silent header omission) so a future new call site that forgets
to supply one fails immediately, not months later under an obscure
replay scenario.

Key choices, both stable across HTTP retries of the same logical
call:
  * CreatePayment → order.ID.String() (GORM BeforeCreate populates
    order.ID before the PSP call in ConfirmOrder).
  * CreateRefund → pendingRefund.ID.String() (populated by the
    Phase 1 tx.Create in RefundOrder, available for the Phase 2 PSP
    call).

Scope note (reproduced here for the next reader who grep-s the
commit log for "Idempotency-Key"):

  Idempotency-Key covers HTTP-transport retry (TLS reconnect,
  proxy retry, DNS flap) within a single CreatePayment /
  CreateRefund invocation. It does NOT cover application-level
  replay (user double-click, form double-submit, retry after crash
  before DB write). That class of bug requires state-machine
  preconditions on VEZA side — already addressed by the order
  state machine + the handler-level guards on POST
  /api/v1/payments (for payments) and the partial UNIQUE on
  `refunds.hyperswitch_refund_id` landed in v1.0.6.1 (for refunds).

  Hyperswitch TTL on Idempotency-Key: typically 24h-7d server-side
  (verify against current PSP docs). Beyond TTL, a retry with the
  same key is treated as a new request. Not a concern at current
  volumes; document if retry logic ever extends beyond 1 hour.

Explicitly out of scope: item D does NOT add application-level
retry logic. The current "try once, fail loudly" behavior on PSP
errors is preserved. Adding retries is a separate design exercise
(backoff, max attempts, circuit breaker) not part of this commit.

Interfaces changed:
  * hyperswitch.Client.CreatePayment(ctx, idempotencyKey, ...)
  * hyperswitch.Client.CreatePaymentSimple(...) convenience wrapper
  * hyperswitch.Client.CreateRefund(ctx, idempotencyKey, ...)
  * hyperswitch.Provider.CreatePayment threads through
  * hyperswitch.Provider.CreateRefund threads through
  * marketplace.PaymentProvider interface — first param after ctx
  * marketplace.refundProvider interface — first param after ctx

Removed:
  * hyperswitch.Provider.Refund (zero callers, superseded by
    CreateRefund which returns (refund_id, status, err) and is the
    only method marketplace's refundProvider cares about).

Tests:
  * Two new httptest.Server-backed tests (client_test.go) pin the
    Idempotency-Key header value for CreatePayment and CreateRefund.
  * Two new empty-key tests confirm the client errors rather than
    silently sending no header.
  * TestRefundOrder_OpensPendingRefund gains an assertion that
    f.provider.lastIdempotencyKey == refund.ID.String() — if a
    future refactor threads the key from somewhere else (paymentID,
    uuid.New() per call, etc.) the test fails loudly.
  * Four pre-existing test mocks updated for the new signature
    (mockRefundPaymentProvider in marketplace, mockPaymentProvider
    in tests/integration and tests/contract, mockRefundPayment
    Provider in tests/integration/refund_flow).

Subscription's CreateSubscriptionPayment interface declares its own
shape and has no live Hyperswitch-backed implementation today —
v1.0.6.2 noted this as the payment-gate bypass surface, v1.0.7
item G will ship the real provider. When that lands, item G's
implementation threads the idempotency key through in the same
pattern (documented in v107-plan.md item G acceptance).

CHANGELOG v1.0.7-rc1 entry updated with the full item D scope note
and the "out of scope: retries" caveat.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 02:30:02 +02:00
..
adr stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
archive chore(cleanup): J1 — purge 220MB debris, archive session docs (complete) 2026-04-14 17:12:03 +02:00
audit-2026-04 fix(hyperswitch): idempotency-key on create-payment and create-refund — v1.0.7 item D 2026-04-18 02:30:02 +02:00
audits batch 1 2025-12-22 22:00:50 +01:00
runbooks chore(release): v0.961 — Playbook (runbooks déploiement, rollback, incident) 2026-03-02 19:09:46 +01:00
API_REFERENCE.md docs: update API_REFERENCE, CHANGELOG, FEATURE_STATUS, PROJECT_STATE for v0.803 2026-03-03 09:25:20 +01:00
API_VERSIONING_POLICY.md chore(release): v0.971 — Phantom (gamification removal, WebRTC Beta, limits doc) 2026-03-02 19:25:37 +01:00
ASVS_CHECKLIST_v0.12.6.md feat(v0.12.6): update pentest deliverables with comprehensive 36-finding audit 2026-03-13 16:52:03 +01:00
BOOT_MODE_STATUS.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
BUDGETS.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
BUG_BASH_V0981.md fix(bugbash): document P1/P2 bug bash completion for v0.981 2026-03-03 19:49:53 +01:00
CHAT_FEATURE_PARITY.md test(chat): Sprint 5 -- unit tests, E2E tests, feature parity validation 2026-02-22 20:49:32 +01:00
DB_MIGRATIONS_AUDIT_V1.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
DB_MIGRATIONS_ORIGIN_DIFF.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
DB_MIGRATIONS_STRATEGY_FINAL.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
DB_MIGRATIONS_V1_VALIDATION.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
DB_TRANSACTION_PLAN.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
DISCOVERY_ALGORITHM.md feat(v1.0.0-rc1): release candidate — GO/NO-GO audit, dark pattern fix, docs 2026-03-13 16:23:18 +01:00
ENV_CONFIG.md fix(chat): ensure WebSocket auth token from query or cookie 2026-02-18 12:42:48 +01:00
ENV_VARIABLES.md feat(v0.10.6): Livestreaming basique F471-F476 2026-03-10 10:21:57 +01:00
ENVIRONMENT_REAL_SETUP.md report generation and future tasks selection 2025-12-08 19:57:54 +01:00
FEATURE_STATUS.md chore(release): v1.0.4 — cleanup sprint complete, CI green 2026-04-15 16:39:30 +02:00
FRONTEND_AUDIT_VISUAL.md small fixes : cors + login loop 2026-02-07 20:36:48 +01:00
FRONTEND_DEEP_DIVE_AUDIT.md docs(audit): TrackDetailPage refactorised 2026-02-05 2026-02-07 06:57:46 +01:00
FRONTEND_ROADMAP_SPOTIFY_DISCORD_QUALITY.md docs(frontend): update roadmap checklist and implementation log 2026-02-07 19:52:48 +01:00
FRONTEND_SETUP.md refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
FRUGALITY.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
GLOBAL_PROJECT_STATE_2026.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
GO_NO_GO_CHECKLIST_v1.0.0.md feat(v1.0.0-rc1): release candidate — GO/NO-GO audit, dark pattern fix, docs 2026-03-13 16:23:18 +01:00
MIGRATION_CONSOLIDATION.md fix(release): v1.0.1 — Conformité complète ROADMAP checklist 2026-03-03 20:17:54 +01:00
MIGRATIONS.md feat(v0.701): AdminTransfers page/route, MSW, stories, Deep Health, API ref, docs, scope v0.702 2026-02-23 23:42:02 +01:00
MINIMAL_WEB.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
MONITORING_SETUP.md chore: consolidate CI, E2E, backend and frontend updates 2026-02-17 16:43:21 +01:00
MONOREPO_ORCHESTRATION.md small fixes : cors + login loop 2026-02-07 20:36:48 +01:00
ONBOARDING.md chore(release): v0.962 — Onboard (API ref, onboarding <30min, ADRs) 2026-03-02 19:11:06 +01:00
PAYMENTS_SETUP.md docs: update PAYMENTS_SETUP for checkout complete URL 2026-02-22 14:42:44 +01:00
PAYOUT_MANUAL.md docs(payout): update PAYOUT_MANUAL for v0.603 auto transfer 2026-02-23 22:59:07 +01:00
PENTEST_REPORT_VEZA_v0.12.6.md feat(v0.12.6): update pentest deliverables with comprehensive 36-finding audit 2026-03-13 16:52:03 +01:00
PERFORMANCE_BASELINE.md fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
PR_READY_CHECKLIST.md STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
PRIVACY_POLICY.md feat(v1.0.0-rc1): release candidate — GO/NO-GO audit, dark pattern fix, docs 2026-03-13 16:23:18 +01:00
PRODUCTION_DEPLOYMENT.md config(template): add comprehensive .env.template 2026-01-29 23:32:18 +01:00
PROJECT_STATE.md chore(release): v1.0.4 — cleanup sprint complete, CI green 2026-04-15 16:39:30 +02:00
PWA_OFFLINE_VERIFICATION.md fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
README.md stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
REMEDIATION_MATRIX_v0.12.6.md feat(v0.12.6): update pentest deliverables with comprehensive 36-finding audit 2026-03-13 16:52:03 +01:00
REMOTE_DEV_R720.md stabilisation commit: while implementing v0.10.5 2026-03-09 19:36:33 +01:00
REPORT_FRONTEND_PHASE1.md refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
RGPD_CCPA_VERIFICATION.md fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
ROADMAP_V09XX_TO_V1.md feat(v0.923): API contract tests, OpenAPI generation, CI type sync check 2026-02-27 20:23:10 +01:00
SCOPE_CONTROL.md docs: retrospective v0.803, archive scope, update SCOPE_CONTROL 2026-03-03 09:25:34 +01:00
SECRET_ROTATION.md ci: add npm audit, govulncheck, cargo audit to CI 2026-02-11 21:33:27 +01:00
SECRETS_AUDIT.md v0.9.1 2026-03-05 19:22:31 +01:00
SECRETS_VERIFICATION.md Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy 2026-02-14 17:23:32 +01:00
SECURITY_SCAN_RC1.md fix(release): v1.0.1 — Conformité complète ROADMAP checklist 2026-03-03 20:17:54 +01:00
STAGING_DEPLOYMENT.md chore(release): v0.981 — Beta (staging deploy, bug bash, smoke test) 2026-03-02 19:33:42 +01:00
STORYBOOK_CONTRACT.md docs(storybook): final comparison 67%→0%, contract update, silent toasts in Storybook 2026-02-05 13:39:59 +01:00
STRATEGIE_COUVERTURE_ET_TMT_2025_02.md chore: playwright workflow, docs, rapports audit, visual-tests, tmt unit 2026-02-11 22:19:34 +01:00
TEST_PROTOCOL_BOOT.md feat: global update including storybook setup and backend fixes 2026-02-02 19:34:14 +01:00
TODO_TRIAGE_VEZA.md STABILISATION: phase 1 & phase 2 2025-12-06 14:45:07 +01:00
TRANSACTION_TESTS_PHASE3.md P0: stabilisation backend/chat/stream + nouvelle base migrations v1 2025-12-06 11:14:38 +01:00
TRIAGE_REPORT.md fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
UUID_DB_CARTOGRAPHY.md P0 UUID Phase A: migrations + backend Go UUID refactor 2025-12-04 02:15:48 +01:00
UUID_DB_MIGRATION_PLAN.md P0 UUID Phase A: migrations + backend Go UUID refactor 2025-12-04 02:15:48 +01:00
V1_LIMITATIONS.md chore(release): v0.971 — Phantom (gamification removal, WebRTC Beta, limits doc) 2026-03-02 19:25:37 +01:00
V1_MVP_SCOPE.md docs: add v1.0.0-mvp scope document 2026-04-05 17:53:26 +02:00
V1_SIGNOFF.md fix(release): v1.0.2 — Conformité complète V1_SIGNOFF (21 critères) 2026-03-03 21:18:53 +01:00
VEZA_PROJECT_DOCUMENTATION.md docs: add project documentation, logging config, status script 2026-03-18 11:36:36 +01:00
VISUAL_TESTING_STRATEGY.md feat(e2e): Playwright + pixelmatch stack for pixel-perfect visual regression 2026-02-07 20:01:30 +01:00

Documentation Veza

Index de la documentation principale du monorepo.

Démarrage

Architecture & Déploiement

Développement

Base de données & Migrations

Sécurité & Opérations

Remédiation & Progression

Archives

Les audits et rapports historiques sont dans docs/archive/.

Documentation par composant

  • Frontend : apps/web/docs/ (FULL_LAYOUT_PAGE, DESIGN_TOKENS, etc.)
  • Backend : veza-backend-api/docs/