Skip to content

fix(cloud): persist Connect payouts_enabled from webhook — unblock every fiat payout (#11172) - #11187

Closed
NubsCarson wants to merge 1 commit into
developfrom
fix/11172-persist-connect-payouts-enabled
Closed

NubsCarson wants to merge 1 commit into
developfrom
fix/11172-persist-connect-payouts-enabled

Conversation

@NubsCarson

Copy link
Copy Markdown
Member

What

Persists charges_enabled / payouts_enabled from the Stripe Connect account.updated webhook, closing the launch-blocker #11172 (every fiat payout permanently rejected).

Why

mapConnectWebhookEvent derived status from the capability booleans but dropped them; the webhook handler persisted only status. The payout transfer gate (transfer/route.ts:73) checks account.payouts_enabled directly, and that column defaults false (migration 0150) with no production writer — so a fully-onboarded creator (status='active') still fails !account.payouts_enabled and can never withdraw via the fiat rail.

Change (2 files, minimal)

  • stripe-connect-payout.ts: ConnectWebhookOutcome carries charges_enabled? / payouts_enabled?; the account.updated case returns them (computed once, still feeds connectStatusFromCapabilities).
  • webhook/route.ts: persist those flags via updateByAccountId (the repository setter already accepts them).

Chosen the "keep the column truthful" fix (option a from #11172) over dropping the gate's column check (option b) — it doesn't alter the gate's security posture, just makes payouts_enabled reflect real Stripe state. No new migration; no behavior change for the status enum.

Verification

  • The gate status === 'active' && payouts_enabled now passes for an onboarded account, because account.updated (both caps true) writes status='active' and payouts_enabled=true.
  • Capability loss (payouts_enabled=false) now writes both status (→ non-active via connectStatusFromCapabilities) and the column, so the gate closes correctly.
  • Existing tests stripe-connect-webhook-route.test.ts / stripe-connect-transfer-route.test.ts cover the surface; recommend a case asserting the column is written on account.updated.

Money-path — not self-merged. @lalalune, this is the top launch-blocker if fiat payout is in scope. [cloud-audit]

Closes #11172.

…ook (#11172)

The account.updated webhook derived status from the capability booleans but
dropped them, persisting only status. The payout transfer gate checks
account.payouts_enabled directly, which defaults false (migration 0150) and
had no production writer — so every Stripe Connect fiat payout was rejected
even for a fully onboarded account. Persist charges_enabled/payouts_enabled
alongside status (the repository setter already accepts them) so the gate
reflects real Stripe state. Keeps the explicit gate check intact.

Closes #11172.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 262cd691-1320-4308-b084-b3dca9738d0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/11172-persist-connect-payouts-enabled

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@lalalune

lalalune commented Jul 2, 2026

Copy link
Copy Markdown
Member

Closing as duplicate of #11190, which ships the same webhook persistence fix with tests (including updating the existing route test this branch would have broken) and camelCase outcome fields consistent with ConnectWebhookOutcome.

@lalalune lalalune closed this Jul 2, 2026
@lalalune
lalalune deleted the fix/11172-persist-connect-payouts-enabled branch July 2, 2026 05:46
@claude

claude Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

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.

security/money: Stripe Connect payouts_enabled never persisted → every fiat payout permanently rejected (HIGH, launch)

2 participants