Skip to content

Handle payout.created and payout.reconciliation_completed Stripe webhook events#1461

Merged
N2D4 merged 1 commit into
devfrom
devin/1779395518-handle-payout-webhooks
May 21, 2026
Merged

Handle payout.created and payout.reconciliation_completed Stripe webhook events#1461
N2D4 merged 1 commit into
devfrom
devin/1779395518-handle-payout-webhooks

Conversation

@N2D4
Copy link
Copy Markdown
Contributor

@N2D4 N2D4 commented May 21, 2026

Add payout.created and payout.reconciliation_completed to the ignoredEvents array in the Stripe webhook handler so they are acknowledged without throwing an error.

Link to Devin session: https://app.devin.ai/sessions/6bedec87599349d9804ca0fd52db55ae
Requested by: @N2D4

Summary by CodeRabbit

  • Bug Fixes
    • Improved Stripe webhook handling to properly process additional payment reconciliation event types, preventing unnecessary error logs.

Review Change Stack

…ook events

Add both payout event types to the ignoredEvents array so they are
acknowledged without error, consistent with other non-actionable events.

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-auth-hosted-components Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-auth-mcp Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-auth-skills Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-backend Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-dashboard Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-demo Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-docs Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-preview-backend Ready Ready Preview, Comment May 21, 2026 8:40pm
stack-preview-dashboard Ready Ready Preview, Comment May 21, 2026 8:40pm

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc227c67-9c73-4c8c-a05a-2de74a261afc

📥 Commits

Reviewing files that changed from the base of the PR and between 002692e and 6745538.

📒 Files selected for processing (1)
  • apps/backend/src/app/api/latest/integrations/stripe/webhooks/route.tsx

📝 Walkthrough

Walkthrough

The Stripe webhook handler route adds two event types (payout.created and payout.reconciliation_completed) to the ignoredEvents list, causing them to be early-returned without processing rather than triggering the unknown webhook type fallback handler.

Changes

Stripe webhook event handling

Layer / File(s) Summary
Ignored webhook events
apps/backend/src/app/api/latest/integrations/stripe/webhooks/route.tsx
ignoredEvents is expanded to include payout.created and payout.reconciliation_completed, preventing these webhook event types from reaching webhook processing logic and avoiding the "unknown stripe webhook type received" fallback.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Bouncing through payouts with glee,
Two more events we now set free,
Ignored with care, they skip the queue,
No more fallbacks—clean and true!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1779395518-handle-payout-webhooks

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR adds payout.created and payout.reconciliation_completed to the Stripe webhook handler's ignoredEvents list so these events are acknowledged with a 200 OK instead of triggering an "Unknown stripe webhook type" error.

  • Both event types are validated at compile time via satisfies Stripe.Event.Type[], ensuring they are legitimate Stripe event identifiers.
  • These are platform-level payout lifecycle events that carry no business logic for the application, so silently acknowledging them is the correct behavior.

Confidence Score: 5/5

This is a safe, minimal change — two Stripe event types are added to an ignore list with no side effects on existing business logic.

Both added event types are compile-time validated by the satisfies Stripe.Event.Type[] constraint, and the only consequence of listing them in ignoredEvents is a silent 200 OK acknowledgement. No processing logic is skipped, no data is dropped, and no other code paths are affected.

No files require special attention.

Important Files Changed

Filename Overview
apps/backend/src/app/api/latest/integrations/stripe/webhooks/route.tsx Adds payout.created and payout.reconciliation_completed to the ignoredEvents array; both are TypeScript-validated Stripe event types and require no application-level processing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Stripe POST /webhooks] --> B{Verify signature}
    B -- invalid --> C[400 Bad Request]
    B -- valid --> D{event.type?}
    D -- payment_intent.succeeded / ONE_TIME --> E[Record purchase + send receipt email]
    D -- payment_intent.payment_failed / ONE_TIME --> F[Send payment failed email]
    D -- charge.dispute.created --> G[Send Telegram chargeback alert]
    D -- subscriptionChangedEvents --> H[Sync subscriptions / upsert invoice]
    D -- ignoredEvents --> I[Return 200 - no-op]
    D -- unknown --> J[StackAssertionError]
Loading

Reviews (1): Last reviewed commit: "Handle payout.created and payout.reconci..." | Re-trigger Greptile

@N2D4 N2D4 merged commit 0df594a into dev May 21, 2026
35 of 36 checks passed
@N2D4 N2D4 deleted the devin/1779395518-handle-payout-webhooks branch May 21, 2026 21:11
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