Skip to content

发起支付

请求方式和路径

POST /payment/payin/v1/createPayment

请求头

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

请求体

字段名类型必传描述
appIdstring(20)Paydify提供
mchTxnIdstring(60)商户侧订单ID,最长64位
txnAmountstring(20)订单金额,如100.23
currencystring(8)支付币种,如USDT,具体参看支持的链和币种
checkoutModeint收银台模式,固定值1
payMethod1string(20)支付使用的钱包,枚举值参看支持的链和币种
payMethod2string(20)支付使用的链,枚举值参看支持的链和币种
notificationUrlstring(120)支付结果回调商户的地址,仅支持httphttps
successReturnUrlstring(120)支付成功后跳转的地址
failReturnUrlstring(120)支付失败后跳转的地址
pendingReturnUrlstring(120)支付中跳转的地址
sourcestring(20)订单来源标签
txnTitlestring(30)支付标题,默认使用商户入驻时提供的商户名称
txnDescstring(60)支付描述信息
accountInfoobject收款账号信息,如{"address":"0xttttttt22222"}
payerInfoobject付款人信息,如{"ip":"127.0.0.1","uid":123456}
mchExtInfostring(512)商户扩展信息,JSON字符串,该字段仅进行透传,将在回调中被带回
lifetimeint订单超时周期,单位毫秒,默认30分钟

响应头参数

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

返回值

字段名类型描述
statusint请求错误码,0表示成功,非0表示失败 ,枚举值参看错误码
msgstring请求错误描述信息
data.txnIdstringPaydify侧的订单ID
data.mchTxnIdstring商户侧的订单ID
data.statestring支付状态,枚举值参看支付状态
data.errorMsgstring支付失败原因说明
data.qrCodestring支付链接二维码base64数据
data.deeplinkstring原生支付链接
data.httplinkstringHTTP支付链接

示例

shell
# 请求

# 成功返回值
{
  "status": 0,
  "msg": "success",
  "data": {
    "txnId": "2209141130105863014",
    "mchTxnId": "220914xxx",
    "state": "pending",
    "errorMsg": "xxx",
    "qrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAACoCAYAAABe+//hGBxxxxxxxxxx",
    "deeplink": "deeplink://x/pay?txnId=xyz",
    "httplink": "https://x.x.com/pay.html?txnId=xyz"
  }
}

# 失败返回值
{
  "status": 9999,
  "msg": "system error",
  "data": null
}
# 请求

# 成功返回值
{
  "status": 0,
  "msg": "success",
  "data": {
    "txnId": "2209141130105863014",
    "mchTxnId": "220914xxx",
    "state": "pending",
    "errorMsg": "xxx",
    "qrCode":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAACoCAYAAABe+//hGBxxxxxxxxxx",
    "deeplink": "deeplink://x/pay?txnId=xyz",
    "httplink": "https://x.x.com/pay.html?txnId=xyz"
  }
}

# 失败返回值
{
  "status": 9999,
  "msg": "system error",
  "data": null
}