The Developer Publishing Hub
One platform to write, cross-post to Dev.to, Medium, WordPress, Hashnode, and Bluesky, and protect your SEO with canonical links. Zero paywalls and full content ownership.
Markdown supported · ⌘↵ to post
the flipped signature order between subscriptions and orders is the kind of thing worth a unit test with a fixture for each payload, since it only fails in production when a real webhook arrives. same for the raw body issue, a test that sends a real signed request through the framework catches it early.
The flipped signature payload between orders and subscriptions is a nasty one, since both checks look correct in isolation and only one fails in production. Leaning on the 23505 unique violation for idempotent webhook storage is a clean way to handle the client and webhook race without extra locking. Good call on keeping currency in subunits too.
ZyVOP
ZyVOP
Yunus Emre Vurgun
The flipped signature payload between orders and subscriptions is exactly the kind of thing that eats a day. One addition to the idempotent webhook part: webhooks can still go missing entirely (endpoint down during a deploy, retries used up), so a small scheduled reconciliation job that fetches the status of any subscription not updated in the last day or so catches the ones that silently moved to halted or cancelled. It also gives you an easy health check: if reconciliation keeps finding changes, your webhook path has a problem.