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"
    }
})

  • GetAccountDataByAccountNumber(accountNumber)

Last updated