Webhook Handlers
The file lib/webhooks/stripe-connect.js routes incoming events to dedicated handlers. Below is a summary of what each handler does.
| Event type | Handler | Purpose |
|---|---|---|
checkout.session.completed | handleCheckoutSessionCompleted | Updates the payment session after a Checkout session succeeds and confirms the order |
account.updated | handleAccountUpdated | Synchronises Stripe account status with company settings |
account.application.deauthorized | handleAccountApplicationDeauthorized | Removes the stored account and disables integration when a user disconnects the app |
charge.refunded | handleChargeRefunded | Processes a refund and sends notification emails |
payment_intent.succeeded | handlePaymentIntentSucceeded | Marks the order payment as completed or pre-authorized |
payment_intent.canceled | handlePaymentIntentCanceled | Sets the payment session status to canceled |
charge.succeeded | handleChargeSucceeded | Retrieves the charge information, updates order payments and schedules notifications |
payment_intent.requires_action | handlePaymentIntentRequiresAction | Marks the session as requiring additional user action and notifies admins |
charge.refund.updated | handleChargeRefundUpdated | Handles refund updates such as failed refunds |
charge.dispute.created | handleChargeDisputeCreated | Stores dispute details and notifies the company |
Unhandled events are logged and ignored. The switch statement begins around line 48 of the file.