Log Bank Transaction
exports['kartik-banking']:LogBankTransaction(data)
๐น Description
Records a banking transaction (deposit, withdraw, paycheck, or transfer) for an account. It stores the transaction in the database, updates relevant stats, and optionally sends webhook logs for audit and monitoring.
๐งพ Parameters
data
table
โ
A table containing transaction information (see details below).
Expected Structure of data
account_number
string
โ
Account number involved in the transaction.
type
string
โ
Type of transaction: "deposit"
, "withdraw"
, "paycheck"
, or "transfer"
.
amount
number
โ
The transaction amount.
memo
string
โ
A short description or note for the transaction.
bankType
string
โ
(Optional) The bank type. If not provided, it is fetched using the account number.
extra_info
table
โ
(For transfers) Additional data like transfer_to
and transfer_from
account numbers.
๐ง Example Usage
exports['kartik-banking']:LogBankTransaction({
account_number = "SWISS12345",
type = "deposit",
amount = 1000,
memo = "Salary Deposit",
bankType = "swiss"
})
For a transfer:
exports['kartik-banking']:LogBankTransaction({
account_number = "FLEECA123",
type = "transfer",
amount = 500,
memo = "Rent Payment",
extra_info = {
transfer_to = "SWISS456",
transfer_from = "FLEECA123"
}
})
๐ฆ Related Exports / Functions
GetAccountDataByAccountNumber(accountNumber)
Last updated