回调通知商户
支付回调
通知方式
POST
请求
请求头
字段名 | 类型 | 必传 | 描述 |
---|---|---|---|
content-type | string | 是 | application/json |
x-api-key | string | 是 | Paydify 提供,跟appId 相同 |
x-api-timestamp | string | 是 | 时间戳,单位毫秒 |
x-api-signature | string | 是 | 签名,具体参看签名算法 |
请求体
字段名 | 类型 | 描述 |
---|---|---|
appId | string | Paydify 提供 |
txnId | string | Paydify 侧的支付订单 ID |
mchTxnId | string | 商户侧的订单 ID |
txnHash | string | 链上的交易 hash |
txnAmount | string | 支付订单金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT |
paidAmount | string | 实际支付金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT |
mchReceivedAmount | string | 商户应该收到的金额,假如币种 currency 是 USDT,则 1.23 表示 1.23USDT |
mchFee | string | Paydify 收取的手续费,假如币种 currency 是 USDT,则 0.23 表示 0.23USDT |
currency | string | 支付币种 |
state | string | 支付状态,枚举值参看支付状态 |
mchExtInfo | string | 商户扩展信息,JSON 字符串 |
errorMsg | string | 支付失败原因说明 |
fromAddress | string | 付款地址 |
paidTime | int | 支付成功的时间戳,单位毫秒,只有支付成功才有值 |
failedTime | int | 支付失败的时间戳,单位毫秒,只有支付失败/超时才有值 |
createdTime | int | 支付发起的时间戳,单位毫秒 |
返回值
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 重试。
请求序号 | 时间延迟 | 说明 |
---|---|---|
0 | 0 | 第 1 次正常回调,立即执行,无延迟 |
1 | 15 秒后 | 第 1 次重试 |
2 | 45 秒后 | 第 2 次重试 |
3 | 90 秒后 | 第 3 次重试 |
4 | 3 分钟后 | 第 4 次重试 |
5 | 10 分钟后 | 第 5 次重试 |
6 | 30 分钟后 | 第 6 次重试 |
7 | 60 分钟后 | 第 7 次重试 |
8 | 3 小时后 | 第 8 次重试 |
9 | 6 小时后 | 第 9 次重试 |
10 | 12 小时后 | 第 10 次重试 |