首页 › 技术规格与 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