Tagged articles

payment callback

3 articles · Page 1 of 1
LuTiao Programming
LuTiao Programming
Sep 25, 2026 · Backend Development

How One SQL Statement Solves the Order Closure vs Payment Callback Race

This article demonstrates how to prevent race conditions between order timeout closure and payment callbacks using atomic conditional UPDATE statements and SELECT FOR UPDATE with a refund outbox pattern, ensuring either payment wins and order becomes PAID, or closure wins and late payments trigger automatic refund compensation.

InnoDBMySQLSpring Boot
0 likes · 11 min read
How One SQL Statement Solves the Order Closure vs Payment Callback Race
LuTiao Programming
LuTiao Programming
Sep 20, 2026 · Backend Development

How to Guarantee Single Order Processing When Payment Callbacks Fire 10 Times

The article explains how to handle duplicate payment callbacks in Spring Boot using database unique constraints, conditional state updates, an outbox pattern for reliable event publishing, and downstream idempotency, ensuring orders are processed exactly once even if the payment platform sends repeated notifications.

Database ConstraintsIdempotencyOutbox Pattern
0 likes · 17 min read
How to Guarantee Single Order Processing When Payment Callbacks Fire 10 Times
Test Development Learning Exchange
Test Development Learning Exchange
Jul 18, 2025 · Backend Development

Build a Flask Mock Payment Callback Service with Signature Verification

Learn how to create a local Flask-based mock payment callback server that validates signatures, returns standardized responses for platforms like WeChat and Alipay, includes a recommended project structure, detailed code examples, testing with pytest, and tips for extending functionality and exposing it via ngrok.

Flaskmock serverpayment callback
0 likes · 7 min read
Build a Flask Mock Payment Callback Service with Signature Verification