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