FreezeAccount

exports['kartik-banking']:FreezeAccount(accountNumber, freeze)

πŸ”Ή Description

Freezes or unfreezes a bank account by updating its status in the database to either "frozen" or "active". This is useful for administrative actions such as fraud prevention or enforcing penalties.


πŸ”§ Parameters

Name
Type
Required
Description

accountNumber

string

βœ…

The unique account number of the bank account to update.

freeze

boolean

βœ…

If true, freezes the account; if false, unfreezes it.


πŸ“€ Returns

Type
Description

true

If the account was successfully updated.

false

If no rows were updated.


🧠 Example Usage

-- Freeze the account
local success = exports['kartik-banking']:FreezeAccount("ACC-XYZ123", true)
if success then
    print("Account has been frozen.")
else
    print("Failed to freeze account.")
end

-- Unfreeze the account
local success = exports['kartik-banking']:FreezeAccount("ACC-XYZ123", false)
if success then
    print("Account has been unfrozen.")
end

Last updated