Stripe webhook handler template
A webhook handler receives signed event notifications and updates your application state. Preserve the raw request for signature verification, deduplicate event IDs and keep slow fulfillment outside the request path. Treat retries and out-of-order delivery as normal operating conditions.