Opentomas-ruiz wants to merge 4 commits into main from tr/paystream-webhooks· opened 3 days ago
+117−0
tomas-ruiz commented 3 days agoAuthor
Why
We currently poll Paystream every 10 minutes to find out whether a payout landed. Support keeps getting
"where is my money" tickets in that window. Paystream can push status changes to us instead.
What
POST /webhooks/paystream verifies the X-Paystream-Signature HMAC (SHA-256 over timestamp.body,
as documented by Paystream) and parses the event.
apply_provider_event updates the payout status. On payout.failed the amount goes back into the
user's wallet so they can retry with different bank details.
The user gets an email/push about the new status via a background task so we answer Paystream fast.
Testing
Added a test for the payout.paid path. Also tried it against the Paystream sandbox with their CLI
forwarder.
The polling job stays on for now; I will remove it in a follow-up.
tomas-ruiz added 4 commits 3 days ago
Add Paystream event schemas23d1eb2
Add webhook endpoint with signature verification22d1e99
Apply payout status events and refund failed payouts25d1ee5
Why
We currently poll Paystream every 10 minutes to find out whether a payout landed. Support keeps getting "where is my money" tickets in that window. Paystream can push status changes to us instead.
What
POST /webhooks/paystreamverifies theX-Paystream-SignatureHMAC (SHA-256 overtimestamp.body, as documented by Paystream) and parses the event.apply_provider_eventupdates the payout status. Onpayout.failedthe amount goes back into the user's wallet so they can retry with different bank details.Testing
Added a test for the
payout.paidpath. Also tried it against the Paystream sandbox with their CLI forwarder.The polling job stays on for now; I will remove it in a follow-up.