Modeling payment rails, fee waivers, account balances, and internal wallet transfers as an auditable chain.
A virtual account deposit may arrive through several rails. Each rail can have a different fee: a percentage, a flat charge, a cap, a threshold waiver, or no fee at all. Monthly account maintenance may depend on the previous month's volume.
If the system stores only the net amount credited to the customer, neither the customer nor operations can reconstruct what happened.
Persist the components separately:
gross received payment rail transaction fee maintenance fee, if applicable net virtual-account credit rate used for any conversion wallet amount credited later The provider webhook supplies evidence such as the rail and external amount. The platform applies the fee policy that was effective at the transaction time. Save a snapshot of that policy result instead of recalculating historical transactions from today's configuration.
Distinguish account balance from wallet balance
A virtual account balance represents funds held in that account product. An application wallet is a separate financial container. Moving money between them should create a linked transfer, not directly overwrite both balances.
The transfer needs a source debit, destination credit, exchange-rate snapshot when currencies differ, fees, before-and-after balances, and a shared reference. Both sides of the product should show the same transfer history from their perspective.
Apply waivers predictably
A transaction threshold waiver evaluates the incoming transaction amount. A monthly maintenance waiver evaluates qualifying volume over a defined calendar period and affects a later fee period.
Store the period, qualifying volume, threshold, decision, and policy version. This avoids disputes when staff change the threshold after the customer qualified.
The user interface should state the rule concisely. If a fee is zero and irrelevant to the selected rail, omit it. If a normal fee became free, showing the original fee struck through can communicate the benefit without a long paragraph.
Reconcile the displayed balance
Staff adjustments should use explicit debit or credit reconciliation entries with actor, reason, evidence, and balances before and after. A link between a virtual account and its owning wallet should be stable; receiving a new deposit must not silently remove that relationship.
Use row locks when applying deposits, fees, transfers, and adjustments. Give each provider event and internal transfer a unique reference so retries cannot credit the same funds twice.
Preserve the rail
The payment rail affects cost and settlement behavior. Store it on the deposit and expose it to staff alongside gross amount, fee, net amount, and provider reference. An unknown rail should follow a conservative configured rule or enter review; it should not silently assume the cheapest fee.
Customers trust fee explanations when every displayed number maps to an immutable transaction component. Operations trust the system when those components reconcile from provider evidence through the virtual account and into the final wallet.
Implementation checklist
Version every fee policy and snapshot the applied rule on the transaction. Test percentage, flat, capped, threshold-free, and unknown-rail cases at currency precision boundaries. Ensure gross = fee + net in the account currency, and that conversion happens from the intended component.
For account-to-wallet transfers, use one command identity across the source debit and destination credit. If a worker stops between stages, reconciliation should find the incomplete linked transfer and resume it without repeating the completed side. Display the shared reference and status on both histories.