Module handler

Module handler 

Source
Expand description

Axum Handler and Router for Stripe Webhooks

This module provides the HTTP layer for receiving and processing Stripe webhooks.

§Key Features

  • Raw Body Extraction: Captures the exact bytes for signature verification
  • Quick Acknowledgment: Returns 200/202 immediately, processes asynchronously
  • Proper Error Responses: Returns appropriate HTTP status codes

§Endpoint

POST /webhooks/stripe

§Headers

Required:

  • stripe-signature: The Stripe webhook signature
  • Content-Type: application/json

Structs§

StripeWebhookState
Shared state for the webhook handler
WebhookResponse
Success response for webhook acknowledgment

Functions§

stripe_webhook_handler
Main webhook handler
stripe_webhook_router
Create the Stripe webhook router
webhook_health
Health check endpoint for the webhook handler