Appearance
Bookkeeping
While payments keep track if a payment was successful or not, a payment object does not contain enough information necessary for bookkeeping purposes. For example, a payment object does not actually represent a transfer of money from one account to another. Instead, it represents the current meaning behind a sum of transfers.
For bookkeeping purposes, the Payment Processor keeps "Transactions" and "Settlements".
Transactions
The payment processor commands the payment provider to perform certain actions, such as creating a payment or issuing a refund. The payment provider then executes these commands and deducts or adds money to the balance of the merchants account on the payment provider.
Each of these actions affecting the balance of the merchants account is represented by a "Transaction" object in the Payment Processor. Importantly, a transaction does include the fees charged by the payment provider (and underlaying sub-processors) for executing the action. For example, if a payment of 10.00 EUR is created and the payment provider charges a fee of 0.35 EUR, the transaction will represent a net amount of 9.65 EUR being added to the merchants account. Transactions have the following important attributes:
type: The type of transaction, e.g. "payment", "refund", "chargeback", etc.transaction_amount: The net amount of money added or deducted from the merchants account, after feesinitial_amount: The gross amount of money before feesdeductions: The amount of fees and further deductions charged by the payment providerstatus: The current status of the transaction. (Usually completed).payment_id: The ID of the payment associated with the transaction (also included, if it is a refund, capture or chargeback)
Settlements
While transactions represent individual actions affecting the merchants account, settlements represent the actual transfer of money from the payment provider to the merchants bank account. Settlements are usually performed in batches, meaning that multiple transactions are grouped together and transferred in a single transfer. Settlements have the following important attributes:
settlement_amount: The total amount of money transferred to the merchants bank accounttransactions: The list of transactions included in the settlementstatus: The current status of the settlement (e.g. pending, completed, failed)settlement_date: The date when the settlement was initiatedreference: The reference number of the settlement provided by the payment provider (also included in the bank statement)
Once a settlement is completed, the included transactions are marked as settled.
Tracking of unknown payments
The TiruPay Payment Provider can only create transactions for payments that were created through itself. If a settlement includes payments that were created outside of the Payment Processor (e.g. directly through the payment provider), these payments will not be tracked by the Payment Processor and will not have corresponding transaction objects. This can lead to discrepancies between the merchants account balance on the payment provider and the sum of transactions tracked by the Payment Processor.