Repository navigation
merge queue: merged #7613, #7529: feat(billing): Paddle webhooks + applyBillingEvent (L3) (+1 more) - #7650
Closed
mergify[bot] wants to merge 10 commits into
Closed
merge queue: merged #7613, #7529: feat(billing): Paddle webhooks + applyBillingEvent (L3) (+1 more)#7650mergify[bot] wants to merge 10 commits into
mergify[bot] wants to merge 10 commits into
Conversation
/api/webhooks/paddle verifies Paddle-Signature (HMAC-SHA256 over ts:body, constant-time, 5-minute window, any h1 during rotation; fails closed without config), normalizes subscription/transaction/adjustment events into the provider-neutral seam types, and applies each exactly once through the shared (provider, event_id) ledger. applyBillingEvent writes organization_billing under an occurred_at watermark (no regression from out-of-order or replayed events, no revival of a canceled subscription, one subscription per slot, never over a live Stripe one), keeps the paddle_transaction mirror, grants credit packs once and reverses them on a full refund or chargeback, and alerts the operator on chargebacks, partial refunds and org mismatches. custom_data is untrusted: the row holding the subscription decides the org; custom_data only names one that exists. A Paddle past_due subscription keeps its plan for a 7-day grace (entitlementStatus), wired into the entitlement readers; Stripe rows are unchanged. The Paddle adapter is registered in the seam with parseWebhook; purchase/plan/usage methods throw until L4/L5.
The recorded-waivers log rode inside the evidence roll-up behind `.limit(100)` and was paged in the browser with a client `.slice`, so waiver 101 and later were unreachable on a compliance record. - `queryEvidenceWaiversPage` (lib/queries/evidence.ts): a keyset builder on the shared codec, ordered by the ms-truncated recorded time then the job id, reading limit + 1, no cap. New read procedure `evidence.waivers`. - The in-force verdict is decided in SQL (`waiverInForce`, a CASE over `pg_input_is_valid`, so an unparseable expiry reads as expired, not as an error). The roll-up now reads only the in-force waivers, uncapped, which is all the posture needs (the waived facet, drawer, counter). - evidence-waivers.tsx: `useKeysetList` + `ListFooter`; no CountPill, no "Showing the 100 most recent", no page numbers; region error, refresh notice and empty state. - evidence-client.tsx: the Environments heading loses its count; the skeleton loses the pill placeholder. - Ledger: evidence-waivers.json deleted; evidence.json is the `bounded` decision for the one-row-per-environment roll-up. - Tests: builder unit test (limit + 1, cursor of the last kept row under ties, later-page predicate, universeEmpty), panel walk to row 130 with ties across boundaries, footer failure/retry, empty and first-page error, a real-Postgres integration test, and a tenancy fixture for the new procedure. Closes #7488
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is a merge queue draft opened by Mergify. Its pull requests have merged, and nobody needs to act on it.
Mergify opened it for batch ethnic-selgris-nx55mk of the
devqueue, to test #7613 and #7529 before they merged intodev.🎉 What landed
Mergify merged each pull request into
devon its own, then closed this draft:ed1af8247e55d9This draft's code was built in this order:
devatc421688Bisected from a failed batch:
Metadata for CI tooling, read by
mergify ciRequired conditions of queue rule
devfor merge#review-threads-unresolved = 0[🛡 GitHub repository ruleset ruleprotect-dev]check-success=CI requiredcheck-success=contribution-legalgithub-review-approved[🛡 GitHub repository ruleset ruleprotect-dev]dev required CI]:check-success=CI requiredcheck-success=contribution-legalprotect-dev]:check-success = contribution-legalcheck-neutral = contribution-legalcheck-skipped = contribution-legalprotect-dev]:check-success = CI requiredcheck-neutral = CI requiredcheck-skipped = CI requiredRequired conditions to stay in the queue
#review-threads-unresolved = 0#review-threads-unresolved = 0[🛡 GitHub repository ruleset ruleprotect-dev]-draftbase = devgithub-review-approved[🛡 GitHub repository ruleset ruleprotect-dev]dev required CI]:check-success=CI requiredcheck-success=contribution-legalprotect-dev]:check-success = contribution-legalcheck-neutral = contribution-legalcheck-skipped = contribution-legalprotect-dev]:check-success = CI requiredcheck-neutral = CI requiredcheck-skipped = CI required