홈 › 기술 사양 & API
시퀀스 다이어그램
📝 본 페이지는 참고용 번역(한국어)입니다. 일본어 원본과 차이가 있는 경우 일본어판을 우선합니다.
이 페이지에서는 앱 외부 결제의 시퀀스를 그림으로 정리했습니다.
게임 내 아이템 구매
다이어그램 소스 (mermaid)
sequenceDiagram
autonumber
actor user as 사용자
participant S8 as Game8 Store
participant pub as 게임(퍼블리셔 API)
participant pay as 결제 시스템
%% 게임 내 ID 입력・플레이어 확인
user->>S8: 게임 내 사용자 ID 입력
S8->>+pub: 플레이어 정보 조회(GET /user_info)
pub->>-S8: 플레이어 정보 반환
note left of pub: user_name, user_level
S8->>user: 플레이어명・레벨 표시
%% 상품 구매
user->>S8: 게임 내 과금 아이템 구매
note right of user: 아이템, 결제 정보, 포인트・쿠폰
opt 포인트・쿠폰을 사용하는 경우
note over S8: 결제 금액(billing_amount) 계산
end
%% 구매 가능 여부 확인
note over S8: transaction_id 발급
S8->>+pub: 구매 가능 여부 확인(GET /check)
note right of S8: transaction_id, item, billing_amount
note over pub: 연령 구분・구매 한도・재고를 확인하고 아이템 확보
pub->>-S8: 확인 결과 반환
note left of pub: result_code, purchasable
alt result_code 가 PUB0000 이외
S8->>user: 구매 불가 표시(result_code 에 따른 메시지)
else result_code 가 PUB0000
note over S8: 주문 생성(status: pending)
opt billing_amount 가 1엔 이상인 경우
S8->>+pay: 결제 실행
note right of S8: 결제 정보, 결제 금액
pay->>-S8: 결제 결과 반환
note left of pay: 결제 상태
end
note over S8: status: payment_confirmed
%% 결제 성공 후 즉시 통지
S8->>+pub: 구매 실적 등록(POST /register)
note right of S8: transaction_id, item, contents
opt 퍼블리셔가 주문 상태를 확인하는 경우
pub->>+S8: 주문 조회(GET /orders/verify)
note left of pub: paid_transaction_id
S8->>-pub: 주문 상태 반환
note right of S8: status(이 시점에서는 payment_confirmed)
end
note over pub: 아이템 지급
pub->>-S8: 등록 결과 반환
note left of pub: result_code, item_granted
alt result_code 가 PUB0000
note over S8: 구매 결과 등록(status: completed)
S8->>user: 구매 완료 화면 표시
S8->>user: 구매 알림 메일 발송
else result_code 가 PUB0000 이외
S8->>pay: 결제 취소(환불) ※결제한 경우
note over S8: 포인트・쿠폰 반환・주문 취소(status: cancelled)
S8->>user: 구매 실패 표시
end
end