Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
The Payments Service: A Fake Payment Provider, Idempotent Charges and Webhook Callbacks
Payments sends charges to the payment provider with an Idempotency-Key derived from the order, does not repeat POSTs in the HTTP layer and treats a timeout as an unknown result, not a failure; a signed, replay-protected webhook or a reconciliation job settles the outcome. The provider's model stays in an anti-corruption layer, and a late payment for a cancelled order turns into a refund end to end.
Idempotent Outbound Calls: Sending an Idempotency-Key, Unknown Outcomes and Reconciliation
After a timeout you cannot know whether the card was charged; the fix is to create one Idempotency-Key per payment intent, store it before the first request, resend the same key on every retry, and let a reconciliation job ask the provider about open attempts. In Bookstore we watch timeouts, 409s and replayed responses in real runs.