Vritti August 2020 | Page 18

18 vritti August 2020 Technically Speaking The processing of a payment transaction results in money movements to and from accounts. The zero-sum principle also originates from the double-entry bookkeeping and zero- proof bookkeeping, and in this context it means that sum of amounts (+ vs -) in each transaction has to be zero. For instance, a typical payment transaction will involve the collection of the money from a customer for a service (e.g., bill payment), paying (disbursement) of a partner (e.g., recharge operator), as well as obtaining a service charge for business. These three entries will constitute a transaction, and the amount of money collected from the customer has to equal the amount of money obtained by partners and businesses. The zero-sum principle is a simple error detection mechanism, especially useful it in a loosely coupled distributed systems at scale. Processing of the transaction will results in several transactions, each potentially involving integration with different payment service providers and banks. As delays, network, and other failures will unavoidably happen, zero-sum principle provides a solid method to detect if any errors happened. These principal are achieved with below three main data objects used for payment processing. Transaction - captures the payments for encapsulating all money movements among the involved parties (customers, partners, and businesses) Entry - describes a single instance of a money movement to or from an entry (a customer, partner or business) Account represents the entity in payments, capturing all entries of that entity. The sum of money amounts in the account entries represents its balance Data Model-orders, accounts,and entries Account #1 Balance 100 $ Account #2 Balance 100 $ Account #3 Balance 100 $ ORDER Entry (#1, -10 $) Entry (#2, -9 $) Entry (#3, +1 $) Payment Order Processor Account #1 Balance 90 $ Account #2 Balance 109 $ Account #3 Balance 101 $ An order processor. The processor changes the state of account based on the entries in the order according to the zero-sum principle.