-
Notifications
You must be signed in to change notification settings - Fork 34
Lua
Stas Dmytryshyn edited this page Jul 4, 2025
·
3 revisions
Main scripting language in Go Money is Lua.
Go Money uses Lua Interpreter library Gopher-Lua All core LUA library features are supported (5.1).
Go Money also provides a set of additional methods to work with transactions and some debugging UI
Detailed information about available methods is available under the rules page in Go Money UI.
Example script that converts withdrawal to transfer.
if string.match(tx:title(), "CARD_PAYMENT.XTB")
and tx:sourceCurrency() == "USD" then
local destinationAccount = helpers:getAccountByID(116)
tx:transactionType(1) -- convert to transfer
tx:destinationAccountID(destinationAccount.ID)
tx:destinationCurrency(destinationAccount.Currency)
tx:destinationAmount(
math.abs(helpers:convertCurrency(
tx:sourceCurrency(),
destinationAccount.Currency,
tx:sourceAmount()
))
)
end