Skip to main content

stripe_webhook_handler

Function stripe_webhook_handler 

Source
pub async fn stripe_webhook_handler<H: SubscriptionHandler, S: IdempotencyStore>(
    __arg0: State<Arc<StripeWebhookState<H, S>>>,
    headers: HeaderMap,
    body: Bytes,
) -> Response
Expand description

Main webhook handler

Processes incoming Stripe webhook requests:

  1. Extracts the stripe-signature header
  2. Verifies the signature using HMAC-SHA256
  3. Checks idempotency (have we seen this event?)
  4. Queues the event for async processing
  5. Returns 200 (new event) or 202 (already processed)