Handle
Overview
The handle method processes raw webhook payloads from payment processors. It verifies webhook signatures and returns a normalized response.
Business Use Case: When Stripe sends a webhook that a payment succeeded, verify it's authentic and update your order status.
Purpose
Signature verification
Automatic verification
Multiple formats
Normalized responses
Security
Validates secrets
Request Fields
merchant_event_id
str
Yes
Your unique event reference
payload
str/dict
Yes
Raw webhook body
headers
dict
Yes
HTTP headers
webhook_secret
str
Yes
Webhook signing secret
Response Fields
event_type
str
Type: payment.captured, refund.succeeded, etc.
event_response
dict
Payment/refund/dispute details
source_verified
bool
Whether signature verified
event_status
str
COMPLETE, INCOMPLETE
Example
SDK Setup
Flask Webhook Handler
Response
Event Types
payment.authorized
Payment authorized
payment.captured
Payment completed
payment.failed
Payment declined
refund.succeeded
Refund processed
dispute.created
New chargeback
Next Steps
Payment Service - Process payment events
Refund Service - Process refund events
Last updated
Was this helpful?

