Documentation index for AI agents

GS2-Showcase 스크립트 트리거 레퍼런스

확장 스크립트를 호출하는 이벤트 트리거의 레퍼런스

트리거

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

-- 비동기 스크립트는 일반적으로 API 응답에 영향을 주지 않습니다.
-- 로그 출력이나 분석, 외부 알림 등에 사용됩니다.

result = {
}