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
| Name | Type | Required | Description |
|---|---|---|---|
data | table | ✅ | A table containing transaction information (see details below). |
Expected Structure of data
| Key | Type | Required | Description |
|---|---|---|---|
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)