Trigger Reference of GS2-Money Script

Reference of event triggers that call extended scripts

Trigger

createWallet

wallet creation

Synchronous Execution Script

Script and wallet creation are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
walletWalletWallet
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet creation
initialAmountint
0 ~ 2147483645Initial Wallet balance - will be credited as a free grant
Implementation Example
namespace = args.namespace
wallet = args.wallet

result = {
  permit=permit,
  initialAmount=initialAmount
}

Asynchronous Execution Script

The script executes asynchronously after the wallet creation.

Request
TypeDescription
namespaceNamespaceNamespace
walletWalletWallet
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
wallet = args.wallet

result = {
}

deposit

Wallet balance addition

Synchronous Execution Script

Script and Wallet balance addition are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
pricefloatPurchase Price
depositCountintQuantity of billable currency to be granted
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet balance addition
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
price = args.price
depositCount = args.depositCount

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Wallet balance addition.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit
pricefloatPurchase Price
depositCountintQuantity of billable currency to be granted
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
price = args.price
depositCount = args.depositCount

result = {
}

withdraw

Wallet balance consumption

Synchronous Execution Script

Script and Wallet balance consumption are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
withdrawCountintQuantity of billable currency to be consumed
paidOnlyboolOnly for paid currency
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow wallet balance consumption
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
withdrawCount = args.withdrawCount
paidOnly = args.paidOnly

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Wallet balance consumption.

Request
TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before withdraw
newWalletWalletWallet after withdraw
withdrawCountintQuantity of billable currency to be consumed
paidOnlyboolOnly for paid currency
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
withdrawCount = args.withdrawCount
paidOnly = args.paidOnly

result = {
}