๐—ฆ๐—ผ๐—น๐˜ƒ๐—ถ๐—ป๐—ด ๐—ฃ๐—ฎ๐˜†๐—บ๐—ฒ๐—ป๐˜ ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฐ๐—ถ๐—น๐—ถ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—˜๐—ฟ๐—ฟ๐—ผ๐—ฟ๐˜€

A client lost 2,000 dollars. Their finance lead spent four nights searching for the gap.

The problem was a retry job. The system processed 120 payments twice. It did not charge customers again. It only added double records to the ledger.

We fixed this with an idempotency layer. This makes sure a payment processes only once.

Here is how we did it:

We also fixed exchange rates. The system used live rates. Rates change fast. This created gaps.

Now we lock the rate when the order starts. The customer sees one price. The finance team sees the same price.

We also built a daily report. It compares bank CSV files to our records. Monthly work dropped from 15 hours to 2 hours.

Stop relying on Excel and late nights. Payment errors are design problems.

Start with a database index. Add Redis locks as you grow. Never assume a payment notification arrives only once.

Source: https://dev.to/yanmoheluo/daigou-code-how-we-solved-payment-reconciliation-nightmares-in-cross-border-order-management-3df7