ホーム › 技術仕様 & 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