Skip to content

feat(registry): add payout sync support with webhook events#198

Open
matingathani wants to merge 1 commit intostripe:mainfrom
matingathani:issue-151-payout
Open

feat(registry): add payout sync support with webhook events#198
matingathani wants to merge 1 commit intostripe:mainfrom
matingathani:issue-151-payout

Conversation

@matingathani
Copy link
Copy Markdown

Summary

The payouts table is created by migrations but never populated — payout was missing from RESOURCE_MAP, PREFIX_RESOURCE_MAP, and SUPPORTED_WEBHOOK_EVENTS.

Changes:

  • Added payout entry to RESOURCE_MAP (order 20, sync: true, isFinalState for paid/failed/canceled)
  • Added po_: prefix to PREFIX_RESOURCE_MAP for ID-based routing
  • Added payout webhook events to SUPPORTED_WEBHOOK_EVENTS:
    • payout.canceled
    • payout.created
    • payout.failed
    • payout.paid
    • payout.reconciliation_completed
    • payout.updated

This enables payment reconciliation use-cases: payment_intents → charges → payouts all sync correctly now.

Test plan

  • Run backfill sync and verify payouts table is populated
  • Trigger payout.paid webhook and verify the payout row is upserted
  • Verify getResourceFromPrefix("po_abc") resolves to payout
  • getSupportedEventTypes() includes the new payout events

Closes #151

Copilot AI review requested due to automatic review settings March 30, 2026 00:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 payout in the sync RESOURCE_MAP (list/retrieve, backfill order, final-state detection).
  • Add po_ to PREFIX_RESOURCE_MAP for ID-prefix routing to payout.
  • Expand SUPPORTED_WEBHOOK_EVENTS to include payout.* 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.

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.

Feature request: Add payout sync support to RESOURCE_MAP

2 participants