Skip to content

v4: add payment lifecycle operations - #46

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

v4: add payment lifecycle operations#46
Phloraxx merged 1 commit into
mainfrom
v4/payment-lifecycle

Conversation

@Phloraxx

@Phloraxx Phloraxx commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Scope

Fourth stacked PayGate v4 implementation slice. Depends on PR #45.

Implements

  • read payment + reconstruct canonical UPI URI from immutable snapshot
  • idempotent payment cancellation
  • cancellation refuses already-paid/expired terminal payments
  • grace-aware expiry sweep: pending payments become expired only after grace_until
  • cancellation/expiry write immutable payment history and durable webhook outbox rows transactionally
  • webhook envelope uses the durable event ID and actual transition timestamp
  • cancelled/expired payments keep their amount reservation until the original reuse_after; status changes do not free decimals early

Tests

Covers get/not-found, cancellation idempotency, terminal-state protection, reservation retention, exact grace boundary, expiry history/webhooks, and cancellation webhook event identity/timestamp. Unit tests, race tests and vet pass locally.

Safety

No production HTTP/runtime wiring yet. Existing v3 behavior and PocketBase runtime are untouched.

@Phloraxx
Phloraxx force-pushed the v4/payment-lifecycle branch from e6803e5 to 3ab05a0 Compare September 1, 2026 04:24
@Phloraxx
Phloraxx changed the base branch from v4/payment-create to main September 1, 2026 05:26
@Phloraxx
Phloraxx marked this pull request as ready for review September 1, 2026 05:27
@Phloraxx
Phloraxx merged commit b6380c9 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