Opend-okafor wants to merge 2 commits into main from fix/processor-webhooks· opened 3 days ago
+58−0
d-okafor commented 3 days agoAuthor
Why
We poll the processor every 5 minutes to learn that a payment succeeded. Customers see "pending" for too
long and support gets tickets. The processor can push events to us instead.
What
New ProcessorEvent model that records every event we receive
POST /api/webhooks/processor: verifies the HMAC signature, skips events we already stored, then marks the
payment captured or failed and sends the receipt email
The router is deliberately unauthenticated (auth=None) because the processor cannot hold one of our tokens;
the HMAC is the authentication.
Testing
Replayed three sandbox events with curl, including one duplicate.
Why
We poll the processor every 5 minutes to learn that a payment succeeded. Customers see "pending" for too long and support gets tickets. The processor can push events to us instead.
What
ProcessorEventmodel that records every event we receivePOST /api/webhooks/processor: verifies the HMAC signature, skips events we already stored, then marks the payment captured or failed and sends the receipt emailThe router is deliberately unauthenticated (
auth=None) because the processor cannot hold one of our tokens; the HMAC is the authentication.Testing
Replayed three sandbox events with curl, including one duplicate.