Skip to content

Handle 'Cannot create payouts' Stripe error as CANNOT_PAY failure reason#4253

Open
gumclaw wants to merge 1 commit intomainfrom
fix/handle-cannot-create-payouts-error
Open

Handle 'Cannot create payouts' Stripe error as CANNOT_PAY failure reason#4253
gumclaw wants to merge 1 commit intomainfrom
fix/handle-cannot-create-payouts-error

Conversation

@gumclaw
Copy link
Copy Markdown
Contributor

@gumclaw gumclaw commented Apr 1, 2026

What

Add "Cannot create payouts" to the existing CANNOT_PAY error matching in StripePayoutProcessor#perform_payment.

Stripe can return either "Cannot create live transfers" or "Cannot create payouts; please contact us..." when a connected account is restricted. We only matched the former, so the latter fell through to the generic ErrorNotifier.notify path with a nil failure_reason.

Why

Without the CANNOT_PAY failure reason:

  • The send_cannot_pay_email callback never fires, so the creator is never notified
  • The payout keeps being retried on subsequent runs instead of being marked as permanently failed

This was causing ~10 occurrences per day in Sentry (#7379701188).

Test results

Added parallel test blocks for the new error message in both test contexts (standard and instant payout), mirroring the existing "Cannot create live transfers" tests.

Note: The spec file has pre-existing environment-dependent failures (Stripe test account setup) that affect all tests in the file, not just these changes.


AI disclosure: Claude Opus 4.6, prompted to fix the Sentry issue by adding the new Stripe error message to the CANNOT_PAY condition.

@github-actions github-actions bot added the stale Inactive PR — will be closed soon label Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This PR has been inactive for 7 days and has been marked as stale. It will be closed in 24 hours if there is no new activity.

@gumclaw gumclaw force-pushed the fix/handle-cannot-create-payouts-error branch from 12d5712 to e908bc9 Compare April 8, 2026 14:18
@github-actions github-actions bot removed the stale Inactive PR — will be closed soon label Apr 8, 2026
Stripe can return 'Cannot create payouts; please contact us...' when a
connected account is restricted, but we only matched 'Cannot create live
transfers'. This caused the payment to be marked failed without the
CANNOT_PAY failure reason, so creators were never notified and the
payout kept being retried.

Add the new error message to the existing CANNOT_PAY condition.

Fixes https://gumroad-to.sentry.io/issues/7379701188/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gumclaw gumclaw force-pushed the fix/handle-cannot-create-payouts-error branch from e908bc9 to 1ac7a39 Compare April 8, 2026 19:26
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