Expand description
Loop Agent SDK - Webhook Handler
Unified handler for Fidel, Square, and Stripe webhooks.
§Security
- Signature verification BEFORE any processing
- Privacy layer hashing BEFORE any logging
- Reject spoofed webhooks at the door
§Flow
Webhook arrives
↓
Verify signature (reject if invalid)
↓
Extract card_id
↓
IMMEDIATELY hash to loop_fp_* (purge raw card_id)
↓
Lookup user by fingerprint
↓
Execute captureStructs§
- Fidel
Secrets - Fidel
Transaction - Fidel
Webhook Payload - Fidel webhook payload (transaction.clearing event)
- Normalized
Transaction - Normalized transaction data from any webhook source
- Square
Card - Square
Card Details - Square
Event Data - Square
Money - Square
Payment - Square
Payment Object - Square
Webhook Payload - Square webhook payload (payment.completed event)
- Webhook
Context - Additional context for webhook processing
- Webhook
Handler - Unified webhook handler
- Webhook
Secrets - Webhook secrets for signature verification
Enums§
- Transaction
Type - Webhook
Error - Webhook
Source - Detected webhook source
Functions§
- parse_
fidel_ webhook - Parse Fidel webhook and normalize
- parse_
square_ webhook - Parse Square webhook and normalize
- verify_
fidel_ signature - Verify Fidel webhook signature
- verify_
square_ signature - Verify Square webhook signature
- verify_
stripe_ signature - Verify Stripe webhook signature