Skip to content

t/ledger_lines

Ledger Lines: top posts

The most useful posts in this topic, by likes from the community.

Posts

  1. Article

    Idempotency keys in Go: the version that survives a double tap and a dead inverter

    Customer taps Pay. The request goes out on a 3G connection in Onitsha, reaches our API, the charge succeeds, and the response dies somewhere on the way back. The app sees a timeout and retries. Without protection, that is two charges and one very angry customer calling the merchant, who calls us. Same thing happens when NEPA takes light in the middle of a request and the client's inverter takes three seconds to kick…

    Emeka Nwosu26likes9comments

  2. Article

    Daraja STK Push from Android: 10 things the docs will not tell you (with Kotlin)

    Sasa wasee. I wire up M-Pesa for a logistics startup in Nairobi, from Eldoret. Safaricom's Daraja API works, but the docs leave a lot for you to discover at 2am. Here is my list. Maze, read it before you start. 1. Never call Daraja from the app A consumer key and secret inside an APK is a gift to every bored teenager with apktool. App calls your backend, backend calls Daraja. No exceptions, not even "just for the…

    Brian Kiprono24likes11comments

  3. Article

    Idempotent payment endpoints in Go and Postgres: the pattern that stopped our double charges

    For six months we refunded somebody almost every Monday. Same story every time: customer on a bad connection taps Pay, the request reaches us, the PSP charges them, our response never reaches the phone, the app retries, we charge again. This is the pattern we use now. Zero double charges since February. The rules Every POST that moves money requires an Idempotency-Key header. No key, 400. The client generates it…

    Emeka Nwosu22likes14comments

  4. Experience

    Our reconciliation job was wrong every day for a week because London changed its clocks

    Story from March that I promised a few people. Clocks go back again on the 25th, so this is the right week. I work from Enugu for a London fintech. Nigeria is UTC+1 all year, no daylight saving. London is UTC+0 in winter and UTC+1 in summer. Our partner bank sends a settlement file per "London business day", midnight to midnight London time. Our reconciliation job builds the same window on our side and matches…

    Emeka Nwosu21likes8comments

  5. Question

    Engineers who have worked on UPI: why do failed transactions take days to reverse when the rule says T+1?

    Working on a data story about failed UPI transactions. Readers sent us about 1,800 complaints (voluntarily, everything anonymised) where money left their account but never reached the merchant or the person they were paying. The RBI's 2019 circular on turnaround times says, as I read it, that a failed UPI transaction should be auto-reversed by T+1, and after that the bank owes the customer ₹100 for every day of…

    Ira Saxena11likes12comments

  6. Experience

    accepted USDC for my side project for 6 months, from lisbon. ahah. here is what actually happened

    ok so. my side project is a small webhook relay api (you send your webhooks to me, i retry them properly, you sleep). about 4% of customers asked to pay in crypto, mostly from argentina, nigeria, and one guy in dubai who asks everything in crypto. i said why not pá, i'm in crypto since 2017. here is the honest report. the setup usdc only, on a cheap L2, so fees were cents one address per customer and a small script…

    Tiago Ferreira10likes13comments

  7. Article

    Idempotency keys for payment APIs: what we got wrong the first time

    Last year we had a customer charged twice for the same EMI. Not a big amount, but the customer was right to be angry and our support team spent one full day itself on it. The root cause was not the bank, not the gateway. It was us, and the way we did idempotency keys. Sharing what we got wrong, because since then I have seen the same mistakes in two other codebases. What an idempotency key is supposed to do The…

    Arjun Mehta10likes9comments

  8. Article

    5 stripe webhook bugs i shipped so you dont have to

    my app takes payments through stripe billing, and stripe tells my app what happened (paid, failed, cancelled) through webhooks. webhooks look simple. a POST request arrives, you update a row. i have now shipped five different bugs in roughly 80 lines of code, so here they are, in the order they hurt me. 1. parsing the body before verifying the signature stripe signs every webhook and you should check that signature,…

    Chloe Barnes8likes8comments

  9. Article

    Payment webhooks arrive twice, out of order, and sometimes never. Design for all three

    Every payment gateway webhook doc says some version of "we may send the same event more than once". What they say less loudly: events can arrive out of order, and sometimes they dont arrive at all. Our first webhook handler assumed none of this. Here is the version that survived. 1. Twice: store the event id Every event has an id. Insert it into a processed_events table with a unique constraint before doing anything…

    Arjun Mehta8likes5comments

  10. Article

    Reconciliation without losing your mind: matching ledger, gateway and bank

    If you move money, at some point finance will ask "does our ledger match the bank". The honest answer at most startups is "mostly". This post is how we went from "mostly" to a daily report that finance actually trusts. It took us around 4 months, so dont feel bad if yours is still a spreadsheet. Three sources, not two For card and UPI payments you have three views of the same money: Your ledger: what you think…

    Arjun Mehta7likes4comments

  11. Article

    A double-entry ledger in Postgres, the boring way that works

    Every fintech I have worked at started with a balance column on the users table. And every one of them later spent months moving away from it. If you are building anything where money moves between parties, wallets, marketplaces, lending, start with a ledger. It is less work than it sounds and Postgres gives you almost everything you need. This is the design we run in production now. Nothing fancy. Boring is the…

    Arjun Mehta4likes4comments

  12. Experience

    Our settlement was off by ₹410 and it took three days to find why

    Partner bank sends us a settlement file every morning. We compare it with our ledger and the totals should match to the paisa. One Monday it was off by ₹410.37. Not a lot of money. But a mismatch is a mismatch and finance will not close the day with it. First day we checked the obvious things. Missing transactions, duplicates, refunds settled on a different day. Everything matched row by row on the transaction…

    Arjun Mehta3likes3comments

  13. Article

    Threat modelling a payment flow in 45 minutes with STRIDE and a whiteboard

    Threat modelling has a reputation for being a heavy process with special tools and a 40 page document nobody reads. It does not have to be. For most features, a 45 minute session with the people who built it finds the important problems. This is the format I use with product teams at the bank. Before the session (10 minutes, one person) Draw the data flow on one page. Boxes for components, arrows for data, and…

    Fatima Al-Sayed3likes3comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.