GS2-Showcase Script トリガー リファレンス

拡張スクリプトを呼び出す イベントトリガー のリファレンス

トリガー

buy

購入

同期実行スクリプト

購入処理の前に、スクリプトが同期実行されます。

Request
説明
namespaceNamespaceネームスペース
showcaseShowcase陳列棚モデル
displayItemDisplayItem陳列商品モデル
userIdstring購入を実行しているユーザーID
quantityint購入量
configConfig[]トランザクションの変数に適用する設定値
Result
必須デフォルト値の制限説明
permitbool
購入を許可するか
実装例
-- Request
local namespace = args.namespace
local showcase = args.showcase
local displayItem = args.displayItem
local userId = args.userId
local quantity = args.quantity
local config = args.config

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

非同期実行スクリプト

購入処理の後に、スクリプトが非同期実行されます。

Request
説明
namespaceNamespaceネームスペース
showcaseShowcase陳列棚モデル
displayItemDisplayItem陳列商品モデル
userIdstring購入を実行しているユーザーID
quantityint購入量
configConfig[]トランザクションの変数に適用する設定値
実装例
-- Request
local namespace = args.namespace
local showcase = args.showcase
local displayItem = args.displayItem
local userId = args.userId
local quantity = args.quantity
local config = args.config

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}