请求发放付费道具
可以设置为通过Webhook发送HTTP请求来发放付费或使用优惠券的道具。
为发放道具,设置通过Webhook发送HTTP请求的方法如下。
使用管理员账户登录仪表盘。
依次点击 项目设置 > 一般 菜单。
请参考以下指南,在 Webhook 区域的 付费道具(服务) 或 优惠券道具(服务) 输入栏输入HTTP/HTTPS URL。
支付后发放道具的情况,请参考支付后的请求及响应。
使用优惠券发放道具,请参考使用优惠券后的请求及响应。
发放道具给测试用户时,请在显示 (测试用户) 标识的输入栏输入请求。
点击 [修改] 按钮。
支付后的请求及响应
请参考以下表和代码设置HTTP请求及响应。
请求
https://{domain}? userId={uuid}&orderId={orderId}&projectId={projectId}&platform={platform}&productId={productId}&store={store}&payment={payment}&transactionId={transactionId}&gamepotOrderId={gamepotOrderId}&uniqueId={uniqueId}&tp={tp}属性
类型
最大长度
说明
userIdString128
用户ID
transactionIdString512
订购编号(GPA-xxxx-xxxx-)
storeString64
商店信息(
apple、google、one)projectIdString128
项目ID
productIdString256
Google/Apple/One Store中注册的产品ID
platformString128
运营Platform信息(
android、ios)paymentString64
支付方式
uniqueIdString512
Unique id(调用purchase api 时输入的
uniqueId)gamepotOrderIdString512
GAMEPOT Order ID
serverIdString-
serverId(调用purchase api时输入的
serverId)playerIdString-
playerId(调用purchase api时输入的
playerId)tpInteger-
1:测试付款 0:常规付款
etcString-
etcd(调用purchase api时输入的
etc)响应
{ "status": 1, "message" : "" }属性
类型
说明
statusInteger结果值
0:失败,1:成功messageString错误内容
赠送礼物与使用优惠券后的请求及响应
请参考以下表和代码设置HTTP请求及响应。
请求
https://{domain}? userId={userId}&projectId={projectId}&platform={platform}&store={store}&userData={userData}&itemId=[{itemData}, {itemData}, ...]属性
类型
最大长度
说明
userIdString128
用户ID(仪表盘中的 游戏 > 赠送礼物 > 对象 值为全部时
all)projectIdString128
项目ID
platformString128
运营Platform信息(
android、ios)storeString64
商店信息(
apple、google、one)titleString-
在 仪表盘 > 游戏 > 赠送礼物 > 标题 中输入的值
contentString-
在 仪表盘 > 游戏 > 赠送礼物 > 说明 中输入的值
targetString-
GAMEPOT仪表盘 > 游戏 > 赠送礼物 > 对象值 - 全部:all / 用户ID:user
expireMsString-
在 仪表盘 > 游戏 > 赠送礼物 > 有效期 中输入的Timestamp(GMT+9)
userDataString-
调取客户端SDK优惠券API时输入的第二个参数值或在 仪表盘 > 游戏 > 赠送礼物 > UserData 中输入的值
itemIdArray-
itemData Array -
itemData(JSON) {"item_id" : String, "store_item_id" : String, "count" : Number}item_id:在仪表盘 游戏 > 道具中创建的道具项目的固有IDstore_item_id:要发放的道具IDcount:要发放的道具数量响应
{ "status": 1, "message" : "" }
属性
类型
说明
status
Integer
结果值 0:失败,1:成功
message
String
错误内容
Last updated