Back to all posts
    FinTech
    2 min read

    Building FinTech Products: Payments, Ledgers and Compliance by Design

    Financial software has little room for error. These are the engineering decisions that keep money correct, auditable and compliant as a fintech product grows.

    Rootlex Technologies

    Written by the engineers at Rootlex Technologies who design, build and run AI, cloud, fintech and embedded systems for our clients.

    First published

    Most software can tolerate an occasional wrong answer. Software that moves money cannot. A duplicated payment or a balance that is off by a small amount is a customer complaint, a reconciliation problem and possibly a regulatory one. The good news is that the techniques for getting this right are well understood.

    Make every money movement idempotent

    Networks fail halfway through requests, and clients retry. If a retry can charge a customer twice, it eventually will. Give every operation a unique key supplied by the caller, store the result against that key, and return the stored result when the same key arrives again. This one habit removes a whole class of incidents.

    Keep a double-entry ledger as the source of truth

    Storing a balance as a single number that gets updated is fragile. A ledger records every movement as a pair of entries, a debit from one account and a credit to another, and never edits or deletes them. Balances are calculated from the entries. You gain a complete audit trail, the ability to rebuild any balance at any point in time, and a simple invariant to test: the entries must always sum to zero.

    Reconcile continuously

    Your records and your bank's or payment provider's records will disagree at some point. Compare them automatically every day, flag differences, and treat an unexplained difference as a defect. Teams that reconcile monthly find problems after they have multiplied.

    Treat external providers as unreliable

    Payment gateways, banks and brokers send webhooks late, twice, or out of order. Verify signatures, process events idempotently, and poll for the final status when a notification does not arrive. When you integrate several providers, put a common interface in front of them so the rest of the product does not need to know which one handled a request.

    We took that approach with TwigTrade, where one trading experience sits on top of four brokerage platforms: Upstox, Rupeezy, Moneysukh and Tiqs.

    Build compliance into the design

    • Identity checks: KYC and anti-money-laundering screening belong in the onboarding and transaction flows, not in a later project.
    • Audit trails: record who did what and when, in storage that cannot be altered.
    • Data residency: know which rules apply to where data is stored. In India, for example, payment data must be stored in the country, and personal data falls under the Digital Personal Data Protection Act.
    • Card data: use tokenisation from a certified provider so raw card numbers never touch your systems, which keeps most of your platform out of PCI DSS scope.

    Design for failure and for scrutiny

    Use explicit state machines for payments so every transaction is always in a known state. Alert on stuck transactions, not only on errors. Keep enough detail in logs to answer a regulator's or a customer's question about a single payment months later.

    These are the foundations of our FinTech engineering practice and our work for the finance and banking sector. If you are building or re-platforming a financial product, we would be glad to help.