feat(registry): add payout sync support with webhook events#198
Open
matingathani wants to merge 1 commit intostripe:mainfrom
Open
feat(registry): add payout sync support with webhook events#198matingathani wants to merge 1 commit intostripe:mainfrom
matingathani wants to merge 1 commit intostripe:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Stripe payout as a first-class syncable resource so the existing payouts table can be populated via backfill sync and webhook-driven upserts, completing the reconciliation chain (payment_intents → charges → payouts).
Changes:
- Register
payoutin the syncRESOURCE_MAP(list/retrieve, backfill order, final-state detection). - Add
po_toPREFIX_RESOURCE_MAPfor ID-prefix routing topayout. - Expand
SUPPORTED_WEBHOOK_EVENTSto includepayout.*event types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/sync-engine/src/types.ts | Adds payout.* webhook event types to the allowed/supported webhook event list. |
| packages/sync-engine/src/resourceRegistry.ts | Registers payout as a syncable resource and adds po_ prefix routing to resolve payout IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
The
payoutstable is created by migrations but never populated —payoutwas missing fromRESOURCE_MAP,PREFIX_RESOURCE_MAP, andSUPPORTED_WEBHOOK_EVENTS.Changes:
payoutentry toRESOURCE_MAP(order 20,sync: true,isFinalStateforpaid/failed/canceled)po_:prefix toPREFIX_RESOURCE_MAPfor ID-based routingSUPPORTED_WEBHOOK_EVENTS:payout.canceledpayout.createdpayout.failedpayout.paidpayout.reconciliation_completedpayout.updatedThis enables payment reconciliation use-cases:
payment_intents → charges → payoutsall sync correctly now.Test plan
payoutstable is populatedpayout.paidwebhook and verify the payout row is upsertedgetResourceFromPrefix("po_abc")resolves topayoutgetSupportedEventTypes()includes the new payout eventsCloses #151