Skip to content

回调通知商户

支付回调

通知方式

POST 请求

请求头

字段名类型必传描述
content-typestringapplication/json
x-api-keystringPaydify提供,跟appId相同
x-api-timestampstring时间戳,单位毫秒
x-api-signaturestring签名,具体参看签名算法

请求体

字段名类型描述
appIdstringPaydify提供
txnIdstringPaydify侧的支付订单 ID
mchTxnIdstring商户侧的订单 ID
txnHashstring链上的交易 hash
txnAmountstring支付订单金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT
paidAmountstring实际支付金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT
mchReceivedAmountstring商户应该收到的金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT
mchFeestringPaydify收取的手续费,假如币种 currency 是 USDT,则 0.23 表示 0.23USDT
currencystring支付币种
statestring支付状态,枚举值参看支付状态
mchExtInfostring商户扩展信息,JSON 字符串
errorMsgstring支付失败原因说明
fromAddressstring付款地址
paidTimeint支付成功的时间戳,单位毫秒,只有支付成功才有值
failedTimeint支付失败的时间戳,单位毫秒,只有支付失败/超时才有值
createdTimeint支付发起的时间戳,单位毫秒

返回值

Paydify只能识别以下两种纯文本的返回值

  • success
  • fail

    如果返回其他值,则会发起最多 10 次重试

请求示例

shell
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A4156085xx",
    "createdTime": 1744698314883,
    "currency": "USDT",
    "errorMsg": "Timeout",
    "failedTime": 1744700130191,
    "fromAddress": "0xab5fB1426f20bAxx",
    "mchExtInfo": "{"JSON":"string"}",
    "mchTxnId": "17446983142083792",
    "paidAmount": "0.00",
    "paidTime": 0,
    "state": "failed",
    "txnAmount": "121.31",
    "mchReceivedAmount": "121.30",
    "mchFee": "0.01",
    "payMethod1": "BGW",
    "payMethod2": "bnb",
    "txnHash": "",
    "txnId": "P20250415142514"
}'
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A4156085xx",
    "createdTime": 1744698314883,
    "currency": "USDT",
    "errorMsg": "Timeout",
    "failedTime": 1744700130191,
    "fromAddress": "0xab5fB1426f20bAxx",
    "mchExtInfo": "{"JSON":"string"}",
    "mchTxnId": "17446983142083792",
    "paidAmount": "0.00",
    "paidTime": 0,
    "state": "failed",
    "txnAmount": "121.31",
    "mchReceivedAmount": "121.30",
    "mchFee": "0.01",
    "payMethod1": "BGW",
    "payMethod2": "bnb",
    "txnHash": "",
    "txnId": "P20250415142514"
}'

退款回调

暂无

回调重试机制

回调如果拿不到预期的返回值success,则会按照以下策略进行最多 10 重试。

请求序号时间延迟说明
00第 1 次正常回调,立即执行,无延迟
115 秒后第 1 次重试
245 秒后第 2 次重试
390 秒后第 3 次重试
43 分钟后第 4 次重试
510 分钟后第 5 次重试
630 分钟后第 6 次重试
760 分钟后第 7 次重试
83 小时后第 8 次重试
96 小时后第 9 次重试
1012 小时后第 10 次重试