GS2-Money Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
createWallet
ウォレット新規作成
同期実行スクリプト
ウォレット新規作成処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| wallet | Wallet | ウォレット |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ウォレットの作成を許可するか | ||
| initialAmount | int | ✓ | 0 ~ 2147483645 | ウォレットの初期残高 - 無償付与として加算されます |
実装例
-- Request
local namespace = args.namespace
local wallet = args.wallet
-- Business logic:
local permit = true
local initialAmount = 0
-- Result
result = {
permit=permit,
initialAmount=initialAmount
}非同期実行スクリプト
ウォレット新規作成処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| wallet | Wallet | ウォレット |
実装例
-- Request
local namespace = args.namespace
local wallet = args.wallet
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}deposit
ウォレット残高加算
同期実行スクリプト
ウォレット残高加算処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| oldWallet | Wallet | 加算前のウォレット |
| newWallet | Wallet | 加算後のウォレット |
| price | float | 購入価格 |
| depositCount | int | 付与する課金通貨の数量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ウォレット残高加算を許可するか |
実装例
-- Request
local namespace = args.namespace
local oldWallet = args.oldWallet
local newWallet = args.newWallet
local price = args.price
local depositCount = args.depositCount
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ウォレット残高加算処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| oldWallet | Wallet | 加算前のウォレット |
| newWallet | Wallet | 加算後のウォレット |
| price | float | 購入価格 |
| depositCount | int | 付与する課金通貨の数量 |
実装例
-- Request
local namespace = args.namespace
local oldWallet = args.oldWallet
local newWallet = args.newWallet
local price = args.price
local depositCount = args.depositCount
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}withdraw
ウォレット残高消費
同期実行スクリプト
ウォレット残高消費処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| oldWallet | Wallet | 消費前のウォレット |
| newWallet | Wallet | 消費後のウォレット |
| withdrawCount | int | 消費する課金通貨の数量 |
| paidOnly | bool | 有償通貨のみを対象とするか |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ウォレット残高消費を許可するか |
実装例
-- Request
local namespace = args.namespace
local oldWallet = args.oldWallet
local newWallet = args.newWallet
local withdrawCount = args.withdrawCount
local paidOnly = args.paidOnly
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ウォレット残高消費処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| oldWallet | Wallet | 消費前のウォレット |
| newWallet | Wallet | 消費後のウォレット |
| withdrawCount | int | 消費する課金通貨の数量 |
| paidOnly | bool | 有償通貨のみを対象とするか |
実装例
-- Request
local namespace = args.namespace
local oldWallet = args.oldWallet
local newWallet = args.newWallet
local withdrawCount = args.withdrawCount
local paidOnly = args.paidOnly
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}