订单回调通知
支付成功后平台向商户通知订单结果。
商户收到通知后请返回 OK,否则平台可能重试。
appid=Zu78qwe1
order_sn=Order202409291231
pay_usdt=10.00
pay_money=0.00
status=1
success_time=1767225600
attach=user001
signature=...
USDT 通知以表单 POST 发送;上面列出的是表单字段,不是 JSON。order_sn 对应下单的 merchantOrderNo,status=1 表示支付成功,pay_usdt 是实际到账数量,以此验单和入账。pay_money 是旧人民币折算兼容字段:新统一 API USDT 订单为 0.00(未折算),历史订单可能有人民币值,不能作为 USDT 支付金额。验签仍须包含收到的全部非空字段,包括 pay_money。
USDT notifications are form-encoded POSTs. order_sn is the merchant order number; status=1 means paid. Settle using the actual USDT received in pay_usdt. Legacy pay_money is 0.00 for new unconverted orders and may contain a fiat value for historical orders. Include all non-empty fields except signature when verifying the signature. Return plain text OK after idempotent processing.
处理建议
| 步骤 | 说明 |
|---|---|
| 1 | 先验签,再处理业务 |
| 2 | 按 merchantOrderNo 做幂等 |
| 3 | 成功后返回 OK |
| 4 | 若失败,平台会重试通知 |
OK
微信直连回调扩展
XPay 校验微信支付公钥签名、回调时间窗、商户号、AppID、平台订单号和金额,并使用 APIv3 密钥解密通知。确认成功后,平台将结果以表单方式 POST 到原订单 notifyUrl。
appId=Zu78qwe1
platformOrderNo=WXP20260814120000ABCDEF
merchantOrderNo=WX202608140001
payType=WECHAT
amount=0.01
status=PAID
payTime=1786670400
tradeNo=4200000000202608140000000001
attach=user-10001
signature=...
success、OK 或 {"code":0}。其他响应会由 wechat:notify-retry 补偿重试。支付宝直连回调扩展
XPay 验证支付宝 RSA2 签名、支付宝 AppID、平台订单号和金额后,将支付结果以 application/x-www-form-urlencoded POST 到下单时的 notifyUrl。
appId=Zu78qwe1
platformOrderNo=ALI20260807110917E2BF35
merchantOrderNo=ALI202608070001
payType=ALIPAY
amount=20.00
status=PAID
payTime=1786072157
tradeNo=2026080722000000000001
attach=user-10001
signature=...
signature 外的所有非空字段重新计算签名,并按 merchantOrderNo 做幂等处理。处理成功后请返回纯文本 success、OK,或 JSON {"code":0}。其他响应(包括正文不符合要求的 HTTP 200)均视为失败,平台最多尝试通知 10 次。
通知失败后平台按递增间隔自动重试;商户也应使用查单接口主动补偿。redirectUrl 只用于用户浏览器同步跳转,不能作为支付成功依据;入账必须以异步通知或查单结果为准。