Trigger Reference of GS2-Money Script
createWallet
Event trigger to call GS2-Script before creating a new wallet.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
wallet | Wallet | Wallet |
Result
Type | Require | Default | Limitation | Description | |
---|
permit | bool | ✓ | | | Allow wallet creation |
initialAmount | int | ✓ | | ~ 2147483645 | Initial Wallet balance - will be credited as a free grant |
Implementation Example
namespace = args.namespace
wallet = args.wallet
result = {
permit=permit,
initialAmount=initialAmount
}
createWalletDone
GS2-Script called after creating a new wallet.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
wallet | Wallet | Wallet |
Result
Type | Require | Default | Limitation | Description | |
---|
Implementation Example
namespace = args.namespace
wallet = args.wallet
result = {
}
deposit
Event trigger to call GS2-Script before wallet balance is added.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
wallet | Wallet | Wallet |
Result
Type | Require | Default | Limitation | Description | |
---|
permit | bool | ✓ | | | Allow wallet balance addition |
overrideCount | int | ✓ | | ~ 2147483645 | Actual amount of addition to be applied |
Implementation Example
namespace = args.namespace
wallet = args.wallet
result = {
permit=permit,
overrideCount=overrideCount
}
depositDone
GS2-Script called after wallet balance is added.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
oldWallet | Wallet | Wallet before deposit |
newWallet | Wallet | Wallet after deposit |
Result
Type | Require | Default | Limitation | Description | |
---|
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
result = {
}
withdraw
Event trigger to call GS2-Script before wallet balance is consumed.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
wallet | Wallet | Wallet |
Result
Type | Require | Default | Limitation | Description | |
---|
permit | bool | ✓ | | | Allow wallet balance consumption |
overrideCount | int | ✓ | | ~ 2147483645 | Actual consumption to be applied |
Implementation Example
namespace = args.namespace
wallet = args.wallet
result = {
permit=permit,
overrideCount=overrideCount
}
withdrawDone
GS2-Script called after wallet balance is consumed.
Request
Type | Description | |
---|
namespace | Namespace | Namespace |
oldWallet | Wallet | Pre-withdraw Wallet |
newWallet | Wallet | Post-withdraw Wallet |
Result
Type | Require | Default | Limitation | Description | |
---|
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
result = {
}