Trigger Reference of GS2-Money2 Script

Reference for event triggers that call extended scripts, as defined in GS2-Money2

deposit

Event trigger to call GS2-Script before Deposit wallet balance.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
transactionsDepositTransaction[]List of occurred transactions
countintAmount of balance to be added

Result

TypeRequireDefaultLimitationDescription
permitboolAllow wallet balance addition

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
transactions = args.transactions
count = args.count

result = {
  permit=permit
}

depositDone

GS2-Script called after Deposit wallet balance.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
transactionsDepositTransaction[]List of occurred transactions
countintAmount of balance to be added

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
transactions = args.transactions
count = args.count

result = {
}

withdraw

Event trigger to call GS2-Script before Withdraw wallet balance.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
transactionsDepositTransaction[]List of occurred transactions
countintAmount of balance to be consumed

Result

TypeRequireDefaultLimitationDescription
permitboolAllow wallet balance addition

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
transactions = args.transactions
count = args.count

result = {
  permit=permit
}

withdrawDone

GS2-Script called after Withdraw wallet balance.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
transactionsDepositTransaction[]List of occurred transactions
countintAmount of balance to be consumed

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
transactions = args.transactions
count = args.count

result = {
}