跳转到主要内容
WEBHOOK
gatePaymentNotify
{
  "bizType": "PAY",
  "bizId": "79553572569350157",
  "bizStatus": "PAY_SUCCESS",
  "data": "{\"channelId\":\"\",\"createTime\":1780037371613,\"currency\":\"USDT\",\"doneAmountOnChain\":\"0\",\"goodsName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"merchantTradeNo\":\"6a1936fb6ac6f72b7a817576\",\"orderAmount\":\"21.88\",\"payerId\":16839589,\"productName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"productType\":\"\",\"terminalType\":\"WEB\",\"tradeType\":\"WEB\",\"waitAmountOnChain\":\"0\"}"
}
{
  "returnCode": "SUCCESS",
  "returnMessage": ""
}

Documentation Index

Fetch the complete documentation index at: https://docs.gate.com/llms.txt

Use this file to discover all available pages before exploring further.

概述

本页说明 webhook gatePaymentNotify。完整的参数、响应结构与示例由上方关联的 OpenAPI 或 webhook 定义渲染。 Gate 支付订单状态变更时,GatePay 向商户配置的 callback URL 发送异步通知(bizTypePAY)。

说明

  • 建议基于 merchantTradeNobizId 做幂等处理。
  • 验签、重试、data 解析与成功应答见 通知概览;签名规则见 安全与签名

触发情形

  • 订单状态发生改变时(如支付成功、超出支付时间、订单取消或关闭等),GatePay 向商户注册时配置的 callback URL 发送通知
  • 若通知投递失败,重试规则见 通知概览
适用范围:通过托管收银台、Web/客户端拉起等方式下单,用户通过 Gate 支付账户 完成付款的场景(bizTypePAY)。接入说明见 支付

消息结构

字段名类型说明
bizTypestring固定为 PAY
bizIdstring预付单 ID(订单 ID)
bizStatusstring订单状态,见下表
client_idstring创建订单的商户 client_id(部分回调可能不返回,以实际为准)
datastring订单数据 JSON 字符串

消息结构示例

{
  "bizType": "PAY",
  "bizId": "79553572569350157",
  "bizStatus": "PAY_SUCCESS",
  "data": "{\"channelId\":\"\",\"createTime\":1780037371613,\"currency\":\"USDT\",\"doneAmountOnChain\":\"0\",\"goodsName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"merchantTradeNo\":\"6a1936fb6ac6f72b7a817576\",\"orderAmount\":\"21.88\",\"payerId\":16839589,\"productName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"productType\":\"\",\"terminalType\":\"WEB\",\"tradeType\":\"WEB\",\"waitAmountOnChain\":\"0\"}"
}

bizStatus 枚举值

说明
PAY_SUCCESS订单支付成功
PAY_ERROR订单支付遇到错误
PAY_CLOSE订单被商户关闭或订单超时

data 字段说明

字段名类型说明
merchantTradeNostring商户交易号
productTypestring创建订单时的 goodsType
productNamestring创建订单时的 goodsName
tradeTypestring创建订单时的 terminalType
goodsNamestring商品名称
terminalTypestring终端类型
currencystring订单币种
orderAmountstring订单金额(Gate 支付成功时为支付金额)
totalFeestring订单金额(部分回调中与 orderAmount 同时返回)
expectCurrencystring商户指定营收币种
actualCurrencystring平台向商户结算的实际币种
actualAmountstring对应 actualCurrency 的金额
payerIdint64支付用户 UID
createTimeint64订单创建时间(毫秒)
transactionIdstring平台交易 ID(部分回调可能不返回)
channelIdstring客户名称 / 渠道标识
doneAmountOnChainstring链上已确认金额
waitAmountOnChainstring链上待确认金额

回调示例

支付成功(bizStatus=PAY_SUCCESS

{
  "bizType": "PAY",
  "bizId": "79553572569350157",
  "bizStatus": "PAY_SUCCESS",
  "data": "{\"channelId\":\"\",\"createTime\":1780037371613,\"currency\":\"USDT\",\"doneAmountOnChain\":\"0\",\"goodsName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"merchantTradeNo\":\"6a1936fb6ac6f72b7a817576\",\"orderAmount\":\"21.88\",\"payerId\":16839589,\"productName\":\"KM/ORDER-63FDE37F - PUBG Mobile UC Global ( Special Offer ) - PUBG 1800 UC x 1\",\"productType\":\"\",\"terminalType\":\"WEB\",\"tradeType\":\"WEB\",\"waitAmountOnChain\":\"0\"}"
}

订单关闭(bizStatus=PAY_CLOSE

{
  "bizType": "PAY",
  "bizId": "79553572569350157",
  "bizStatus": "PAY_CLOSE",
  "data": "{\"channelId\":\"\",\"createTime\":1780037371613,\"currency\":\"USDT\",\"doneAmountOnChain\":\"0\",\"goodsName\":\"KM/ORDER-63FDE37F\",\"merchantTradeNo\":\"6a1936fb6ac6f72b7a817576\",\"orderAmount\":\"21.88\",\"payerId\":0,\"productName\":\"KM/ORDER-63FDE37F\",\"productType\":\"\",\"terminalType\":\"WEB\",\"tradeType\":\"WEB\",\"waitAmountOnChain\":\"0\"}"
}

支付异常(bizStatus=PAY_ERROR

{
  "bizType": "PAY",
  "bizId": "79553572569350157",
  "bizStatus": "PAY_ERROR",
  "data": "{\"channelId\":\"\",\"createTime\":1780037371613,\"currency\":\"USDT\",\"doneAmountOnChain\":\"0\",\"goodsName\":\"KM/ORDER-63FDE37F\",\"merchantTradeNo\":\"6a1936fb6ac6f72b7a817576\",\"orderAmount\":\"21.88\",\"payerId\":16839589,\"productName\":\"KM/ORDER-63FDE37F\",\"productType\":\"\",\"terminalType\":\"WEB\",\"tradeType\":\"WEB\",\"waitAmountOnChain\":\"0\"}"
}

请求体

application/json
bizType
enum<string>
必填

业务类型,固定为 PAY(非地址支付订单状态变更)。

可用选项:
PAY
bizId
string
必填

预付单 ID(订单 ID)。

bizStatus
enum<string>
必填

订单状态:PAY_SUCCESS 支付成功;PAY_CLOSE 订单超时或商户关闭;PAY_ERROR 支付错误。

可用选项:
PAY_SUCCESS,
PAY_ERROR,
PAY_CLOSE
data
string
必填

订单数据 JSON 字符串,解析后结构见 gatePaymentData

client_id
string

创建订单的商户 client_id

gatePaymentData
object

data 解析后的订单明细。非地址支付场景请使用 orderAmount 判断支付金额。

description
any

响应

200 - application/json

返回 HTTP 200 表示商户已成功接收通知。

商户接收通知后的响应体。

returnCode
string
必填

返回状态码,SUCCESS 表示成功。

returnMessage
string | null

返回说明,成功时可为空。