Handle 'Cannot create payouts' Stripe error as CANNOT_PAY failure reason#4253
Open
Handle 'Cannot create payouts' Stripe error as CANNOT_PAY failure reason#4253
Conversation
|
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. |
12d5712 to
e908bc9
Compare
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>
e908bc9 to
1ac7a39
Compare
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.
What
Add
"Cannot create payouts"to the existing CANNOT_PAY error matching inStripePayoutProcessor#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 genericErrorNotifier.notifypath with a nilfailure_reason.Why
Without the CANNOT_PAY failure reason:
send_cannot_pay_emailcallback never fires, so the creator is never notifiedThis 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.