Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: How do you test payment webhook edge cases?
1 point by jalalmanafi 4 hours ago | hide | past | favorite | 5 comments
I work at a PSP. We recently had a production bug where a payment succeeded but our system didn't update — the webhook was delayed 45 seconds. Stripe's test mode doesn't simulate delays, timeouts, or webhook failures. We ended up writing internal mocks, but it's tedious. Considering building a simple tool: configurable delays, webhook failure simulation, request timeline. Curious how others handle this. Do you just write custom mocks? Accept the risk? Use something I don't know about?




proxy that does all of the above rather than mocks. we had configurable one based on txid.

ex: tx uuid fe83dd01-aaaa-aaaa-aaaa-000000005373 if chunk1 is aaaa, then treat last bit as 'delay for 5373ms'


Clever approach — encoding the behavior in the txid itself.

Did you have a UI to configure scenarios, or was it all code-based? And did you simulate webhook failures/retries too, or just delays?


it was code base. first chunk would be git revision-sha . failure, retry, delay, multiple replay due to retry timeout (idempotence test)

Makes sense — idempotence testing is a great use case. We've hit bugs where retries created duplicate charges.

If this existed as a hosted tool with a UI to configure scenarios (instead of encoding in txids), would that have saved you time? Or was code-based actually preferred?


dont care would never have used hosted.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: