Skip to content

v4: create payments transactionally - #45

Merged
Phloraxx merged 1 commit into
mainfrom
v4/payment-create
Sep 1, 2026
Merged

v4: create payments transactionally#45
Phloraxx merged 1 commit into
mainfrom
v4/payment-create

Conversation

@Phloraxx

Copy link
Copy Markdown
Owner

Scope

Third stacked PayGate v4 implementation slice. Depends on PR #44.

Implements

  • server-owned active collection profile resolution
  • ordered-random payable amount reservation
  • 5m active + 5m grace + 5m quarantine timestamps
  • immutable profile/UPI destination snapshot on each payment
  • merchant name as person/payee identifier and non-unique event external_id
  • canonical UPI URI generation; no QR image generation
  • scoped idempotency with semantic metadata canonicalization
  • atomic payment + reservation + history + webhook-outbox + idempotency write
  • exact replay returns the original payment/UPI URI
  • changed request under same idempotency key fails closed
  • random 128-bit prefixed PayGate IDs

Tests

Covers active-profile ownership, exact UPI URI, lifecycle timing, idempotent replay/conflict, metadata key-order canonicalization, duplicate names/event IDs, profile switching, profile-scoped same exact amount, overflow only after base-bucket exhaustion, no-active-profile failure, full transaction rollback after a synthetic late failure, webhook event-ID durability, and invalid/trailing metadata. Race tests and vet pass locally.

Safety

Still not registered into the production v3 HTTP/runtime. Existing PocketBase behavior is untouched.

@Phloraxx
Phloraxx changed the base branch from v4/amount-allocator to main September 1, 2026 05:17
@Phloraxx
Phloraxx marked this pull request as ready for review September 1, 2026 05:26
@Phloraxx
Phloraxx merged commit 1debead into main Sep 1, 2026
1 check passed
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.

1 participant