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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| wallet | Wallet | Wallet |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow wallet creation | ||
| initialAmount | int | ✓ | 0 ~ 2147483645 | Initial 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| wallet | Wallet | Wallet |
Result
| Type | Required | Default | Value Limits | Description |
|---|
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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| oldWallet | Wallet | Wallet before deposit |
| newWallet | Wallet | Wallet after deposit |
| price | float | Purchase Price |
| depositCount | int | Quantity of billable currency to be granted |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| oldWallet | Wallet | Wallet before deposit |
| newWallet | Wallet | Wallet after deposit |
| price | float | Purchase Price |
| depositCount | int | Quantity of billable currency to be granted |
Result
| Type | Required | Default | Value Limits | Description |
|---|
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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| oldWallet | Wallet | Wallet before withdraw |
| newWallet | Wallet | Wallet after withdraw |
| withdrawCount | int | Quantity of billable currency to be consumed |
| paidOnly | bool | Only for paid currency |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| oldWallet | Wallet | Wallet before withdraw |
| newWallet | Wallet | Wallet after withdraw |
| withdrawCount | int | Quantity of billable currency to be consumed |
| paidOnly | bool | Only for paid currency |
Result
| Type | Required | Default | Value Limits | Description |
|---|
Implementation Example
namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet
withdrawCount = args.withdrawCount
paidOnly = args.paidOnly
result = {
}