Skip to content

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 typeHandlerPurpose
checkout.session.completedhandleCheckoutSessionCompletedUpdates the payment session after a Checkout session succeeds and confirms the order
account.updatedhandleAccountUpdatedSynchronises Stripe account status with company settings
account.application.deauthorizedhandleAccountApplicationDeauthorizedRemoves the stored account and disables integration when a user disconnects the app
charge.refundedhandleChargeRefundedProcesses a refund and sends notification emails
payment_intent.succeededhandlePaymentIntentSucceededMarks the order payment as completed or pre-authorized
payment_intent.canceledhandlePaymentIntentCanceledSets the payment session status to canceled
charge.succeededhandleChargeSucceededRetrieves the charge information, updates order payments and schedules notifications
payment_intent.requires_actionhandlePaymentIntentRequiresActionMarks the session as requiring additional user action and notifies admins
charge.refund.updatedhandleChargeRefundUpdatedHandles refund updates such as failed refunds
charge.dispute.createdhandleChargeDisputeCreatedStores dispute details and notifies the company

Unhandled events are logged and ignored. The switch statement begins around line 48 of the file.