5. 线下充值

5.1 支付回调

  • action: payNotify
  • 通知游戏发货

请求data

参数类型描述
appIdint游戏ID
channelIdString渠道ID 补单时为补单渠道号
userIdString平台用户ID
orderIdString平台订单号
priceString商品单价,单位
buyNumint购买数量
currencyString货币类型,默认 CNY(ISO4217)。
moneyString订单金额(商品单价 * 购买数量 = 订单金额),单位
roleIdString角色ID
serverIdString游戏服务器ID
businessTypeint业务来源,默认 官网商城
1-官网商城2-抖店3-渠道店铺
versionString接口版本号
title (可选)String邮件标题(未设置邮件信息时,游戏道具将直接发放,无需通过邮件发送。)
content (可选)String邮件标题(未设置邮件信息时,游戏道具将直接发放,无需通过邮件发送。)
itemsJSONArray道具列表。注:在批量购买的场景中,道具数量也会是最终发货数量,研发无需再次将其与购买数量进行相乘。
isTestint是否为测试订单。0:否,1:是。仅在测试环境下生效:测试订单默认不发货,仅当 userId 加入研发白名单时才会发货。

示例:

{
  "appId": 13,
  "channelId": "13003",
  "userId": "25833270",
  "orderId": "202502180181891674322112614400",
  "price": "6800",
  "buyNum": 1,
  "currency": "CNY",
  "money": "6800",
  "roleId": "7b86ae6e906b23027534e074",
  "serverId": "31622",
  "businessType": 1,
  "version": "v2",
  "items": [
    {
      "id": "65030",
      "number": 10
    },
    {
      "id": "67036",
      "number": 50
    }
  ],
  "title": "官网充值已到账",
  "content": "感谢您的购买!你购买的积分礼包已到账。"
}

该请求表示用户购买了一个道具商品,订单金额为 6800 分。其中包含 10 个 道具id 为 65030 的道具和 50 个 道具id 为 67036 的道具。

对应items
参数类型描述
idString道具ID
numberint道具数量
{"data":"{\"appId\":13,\"channelId\":\"13010\",\"userId\":\"18003403\",\"orderId\":\"202303290161640971641766846464\",\"price\":\"6800\",\"buyNum\":1,\"currency\":\"CNY\",\"money\":\"6800\",\"serverId\":\"501\",\"roleId\":\"01f555310072128a83cda549\",\"businessType\":1,\"title\":\"邮件标题\",\"content\":\"邮件内容\",\"version\":\"v2\",\"items\":[{\"number\":\"5\",\"id\":\"1\"},{\"number\":\"30\",\"id\":\"2\"}]}","sign":"this is sign string","action":"payNotify","ts":1234567890}

响应data

{"msg":"success","code":1000}

5.2 支付回调(旧版本)

  • action: payNotify
  • 通知游戏发货
  • 13-新不良人/23-不良人破局使用

请求data

参数类型描述
appIdint游戏ID
channelIdString渠道ID 补单时为补单渠道号
userIdString平台用户ID
orderIdString平台订单号
productIdString商品ID
productTypeint商品类型:
1-内购商品2-道具商品3-游戏代币
只有在 productType=2 或 productType=3 时,attributesitems 字段是可选的。
buyNumint购买数量
rewardNum(可选)int返利数量
默认为 0。仅 在productType=1 时可选。
返利数量不和购买数量挂钩,直接根据订单走返利发放即可。
currencyString货币类型,默认 CNY(ISO4217)。
moneyString订单金额,单位
roleIdString角色ID
serverIdString游戏服务器ID
businessTypeint业务来源,默认 官网商城
1-官网商城2-抖店3-渠道店铺
versionString接口版本号,固定值 v2
title (可选)String邮件标题(未设置邮件信息时,游戏道具将直接发放,无需通过邮件发送。)
content (可选)String邮件内容(未设置邮件信息时,游戏道具将直接发放,无需通过邮件发送。)
attributes (可选)JSONArray属性列表,仅在 productType=2 或 productType=3 时可选。
items (可选)JSONArray道具列表,仅在 productType=2 或 productType=3 时可选,注:在批量购买的场景中,道具数量也会是最终发货数量,研发无需再次将其与购买数量进行相乘。
isTestint是否为测试订单。0:否,1:是。仅在测试环境下生效:测试订单默认不发货,仅当 userId 加入研发白名单时才会发货。
参数说明 productType
描述
1内购商品:需要与研发团队约定固定的商品档位 ID。
productType=1 时,需要根据商品ID对应的价格、货币,并计算订单总价格(单价 * 数量)进行验证。同时,根据订单携带的返利数量【rewardNum】进行返利。
2道具商品:根据 attributesitems 中的 道具与属性数量 * 购买数量,将物品直接发放到玩家背包,无需额外约定和验证商品ID信息。productType=2 只关注道具发放。
3游戏代币: 根据 items 中的 道具ID道具数量 * 购买数量,将物品直接发放到玩家背包,无需额外约定和验证商品ID信息。productType=3 只关注道具发放。

处理逻辑:

1. 内购商品(productType=1
  • 根据 productId 查询商品价格和货币类型并验证。
  • 校验订单金额(money)与商品价格*数量的匹配情况。
  • 根据 rewardNum 进行返利。
  • 注意: 邮件标题title 和 邮件内容 content 有值时使用自定义的邮件标题和内容,没有时用游戏内自定义默认邮件标题和内容
2. 道具商品(productType=2
  • 根据 attributesitems 列表中的道具和属性数量*购买数量 发放道具。
  • 注意rewardNum 字段在 productType=2 时不会使用,仅考虑 items 中的道具ID数量和购买数量buyNum的关系。
3. 游戏代币(productType=3
  • 根据 items 列表中的游戏代币-道具ID游戏代币-道具数量发放道具。
  • 游戏代币在游戏侧以道具ID表示,因此游戏端仍统一按照 items 发放。items 中可以同时包含普通道具和游戏代币道具。
  • 注意rewardNum 字段在 productType=3 时不会使用,如有返利会累加到items.number中。

示例:

内购商品(productType=1):

请求data

{
  "appId": 13,
  "channelId": "13003",
  "userId": "25833270",
  "orderId": "202502180181891676215874420736",
  "productId": "fake_money_448",
  "productType": 1,
  "buyNum": 1,
  "rewardNum": 2,
  "currency": "CNY",
  "money": "44800",
  "roleId": "7b86ae6e906b23027534e074",
  "serverId": "31622",
  "businessType": 1,
  "version": "v2"
}

该请求表示用户购买了一个448【游戏代币】商品,订单金额为 44800 分,并且用户将获得 2 个返利【游戏代币】。

道具商品(productType=2):

请求data

{
  "appId": 13,
  "channelId": "13003",
  "userId": "25833270",
  "orderId": "202502180181891674322112614400",
  "productId": "fake_score_gift",
  "productType": 2,
  "buyNum": 1,
  "currency": "CNY",
  "money": "6800",
  "roleId": "7b86ae6e906b23027534e074",
  "serverId": "31622",
  "businessType": 1,
  "version": "v2",
  "items": [
    {
      "id": "65030",
      "number": 10
    },
    {
      "id": "67036",
      "number": 50
    }
  ],
  "title": "官网充值已到账",
  "content": "感谢您的购买!你购买的积分礼包已到账。"
}

该请求表示用户购买了一个道具商品,订单金额为 6800 分。其中包含 10 个 道具id 为 65030 的道具和 50 个 道具id 为 67036 的道具。

游戏代币(productType=3):

请求data

{
  "appId": 13,
  "channelId": "13003",
  "userId": "25833270",
  "orderId": "202502180181891674322112614400",
  "productId": "fake_voucher_xxx",
  "productType": 3,
  "buyNum": 1,
  "currency": "CNY",
  "money": "6800",
  "roleId": "7b86ae6e906b23027534e074",
  "serverId": "31622",
  "businessType": 1,
  "version": "v2",
  "items": [
    {
      "id": "90001",
      "number": 70
    }
  ],
  "title": "官网充值已到账",
  "content": "感谢您的购买!你购买的积分礼包已到账。"
}

该请求表示用户购买了一个68【游戏代币】商品,订单金额为 6800 分,并且用户将获得 2 个返利【游戏代币】,发放时【游戏代币】数量为70。

对应attributes
参数类型描述
idString属性ID
valueint属性值
对应items
参数类型描述
idString道具ID
numberint道具数量
{ "data":"{\"appId\":13,\"channelId\":\"13010\",\"userId\":\"18003403\",\"orderId\":\"202303290161640971641766846464\",\"productId\":\"activity-gift-1004\",\"productType\":2,\"buyNum\":1,\"currency\":\"CNY\",\"money\":\"6800\",\"serverId\":\"501\",\"roleId\":\"01f555310072128a83cda549\",\"businessType\":1,\"title\":\"邮件标题\",\"content\":\"邮件内容\",\"version\":\"v2\",\"items\":[{\"number\":\"5\",\"id\":\"1\"},{\"number\":\"30\",\"id\":\"2\"}]}", "sign":"this is sign string", "action":"payNotify", "ts":1234567890 }

响应data

{"msg":"success","code":1000}