跳轉至

IAP v4 传输项目交付结果

項目交付結果傳輸API是一個API,通過Hive IAP v4將項目交付的結果發送給購買消耗品的用戶。通過實現此API,Hive IAP系統將代表市場退款和取消列表發送項目交付狀態,這對於制裁濫用退款的用戶至關重要。

請求 URL

商業網址 https://hiveiap.qpyou.cn/api_v4/item_result
沙盒網址 https://sandbox-hiveiap.qpyou.cn/api_v4/item_result
HTTP 方法 POST
內容類型 text/HTML;charset=utf-8
數據格式 JSON
字段 类型 描述 必需
hiveiap_transaction_id 字符串 发送从Hive IAP v4 收据验证返回的hiveiap_transaction_id值 Y
result_status 整数 项目是否成功授予
0: 授予失败
1: 授予成功
Y
user_id_type 字符串 Hive 用户类型(使用固定值player_id Y
user_id 字符串 Hive 用户ID(player_id Y
asset 数组 关于授予项目的信息
仅在授予成功时发送值,当授予失败时响应一个空数组([])
N
asset_id 字符串 项目ID N
asset_name 字符串 项目名称 N
quantity 整数 授予项目的数量 N
game_payload_info 对象 从游戏服务器接收的值,用于Hive 分析中的附加指标 N

範例代碼

呼叫

curl -L -v -d '{"hiveiap_transaction_id": "GO_22160", "result_status": 1, "user_id_type": "player_id", "user_id": 30000041527, "asset": [ {"asset_id":"item_1","asset_name":"item_1_name","quantity":1},{"asset_id":"item_2","asset_name":"item_2_name","quantity":1}], "game_payload_info": {"gifteeid":null,"chracter_type_id":0,"product_name":"Cooking Kingdom Alternative Store Pack 1"}}' -H "Content-Type: text/html" https://sandbox-hiveiap.qpyou.cn/api_v4/item_result

請求

> POST /api_v4/item_result HTTP/2
> Host: sandbox-hiveiap.qpyou.cn
> user-agent: curl/7.68.0
> accept: /
> content-type: text/html
> content-length: 235

回應

< HTTP/2 200
< server: nginx
< date: Wed, 23 Mar 2022 08:20:44 GMT
< content-type: text/html; charset=utf-8
{"result":0,"result_msg":"success"}