Skip to content

创建收银台订单

API EndPoint

POST baseUrl + /api/payDesk

请求参数

参数名必选类型示例值字段说明
currencyYstring(32)COP货币代码(COP)
amountYdecimal(20,2)10000金额10000-5000000
reusableStatusNboolean不传默认 false(false=不允许 true=允许)目前只能是false
mchOrderNoYstring(32)1386556787811426305商户订单号(不允许重复)
expireTimeNlong3600过期时间(单位:秒)不传则默认7天
notifyUrlYstring(250)https://merchant.com/webhooks回调地址
nonceStrYstring(32)1863484722378907648随机字符串
realNameYstring(32)Jeck用户姓名 不能有特殊字符、限制最长64个字符
phoneYstring(32)52xxxxxxx手机号 格式要正确,尽量传真实的手机号
emailYstring(64)example@maildomain.com邮箱 格式要正确,尽量传真实的邮箱
idTypeYstring(32)请参考付款人证件类型付款人证件类型
idCardYstring(32)我们不校验真实性和合法性,错误的证件号可能导致部分交易失败付款人证件号
returnUrlNstring(250)https://merchant.com/jump支付成功后 同步跳转地址
remarkNstring(32)不传默认 remark备注 (请使用英文字符或不带重音的西语)

TIP

用户信息将传送给银行校验,需填写真实且有效信息

请求示例

bash
curl -L 'baseUrl/api/payDesk' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":10000,"idType":1,"mchOrderNo":"paydesk0000000001","idCard":"10351512345","remark":"payment","nonceStr":"17345xxxxxxx","realName":"jeson","reusableStatus":false,"expireTime":899,"phone":"57319312345","notifyUrl":"http://xxxxxx.com/cocashy/payin-notify","currency":"COP","email":"test@gmail.com"}'

响应参数

参数名类型参数说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,2)金额
payUrlstring(250)收银台Url
expireTimedate过期时间

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "paydesk0000000001",
    "orderNo": "PAYDESK000000001",
    "payUrl": "https://paydeskco.brcashypro.com/index.html?PAYDESK000000001",
    "amount": "10000",
    "expireTime": "2024-12-19 01:46:17"
  }
}

查询收银台订单

查询收银台订单

API EndPoint

POST baseUrl + /api/payDeskQuery

请求参数

参数名必选类型示例值字段说明
mchOrderNoNstring(32)1386556787811426305商户订单号
orderNoNstring(32)PAYIN8551844049125523456平台订单号
nonceStrYstring(32)1863484722378907648随机字符串

TIP

我们建议优先使用orderNo(平台订单号),平台订单号和商户订单号至少需要传递一个。

请求示例

bash
curl -L 'baseUrl/api/payDeskQuery' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d ' {"mchOrderNo":"202411301909131862936942783582208","nonceStr":"1138688daof9gnay3dt9j4wktxt1z99ww"}'

响应参数

参数名类型字段说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
payUrlstring(250)付款二维码,有些方式有二维码QRIS
amountdecimal(20,0)金额
feedecimal(20,4)手续费
orderStatusstring(32)代收订单状态枚举
completionTimedate完成时间

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "3002112",
    "mchOrderNo": "202411301909131862936942783582208",
    "orderNo": "PAYDESK39568551277959484616704",
    "payUrl": "https://idpaydesk2.brcashypro.com/index.html?PAYDESK39568551277959484616704",
    "amount": "1000000",
    "fee": "0",
    "orderStatus": "PAYING",
    "completionTime": null,
    "nonceStr": null
  }
}

收银台订单结果通知

通知地址由商户提供

POST Merchant NotifyUrl

异步通知请求参数

参数名类型说明
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,2)金额
feedecimal(20,4)手续费
payUrlstring(32)收银台Url
orderStatusstring(32)收银台代收订单状态枚举
completionTimedate完成时间
nonceStrstring(32)随机字符串

异步通知请求示例

bash
curl -L 'merchant.com/webhooks/paydesk' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":358320.00,"completionTime":"2024-12-02 12:07:06","fee":2500.0000,"mchOrderNo":"1313068703462109184","merchantId":"1002001","nonceStr":"1733116026894","orderNo":"PAYDESK27618551850988355260416","orderStatus":"SUCCESS","payCode":"OR.GPNQR..INOPROID_BS","payType":"41","payUrl":"https://payurl.com"}'
json
{
  "amount": 358320.0,
  "completionTime": "2024-12-02 16:08:32",
  "fee": 9083.0,
  "mchOrderNo": "1313068703462109184",
  "merchantId": "1002001",
  "nonceStr": "1733130512894",
  "orderNo": "PAYDESK27618551850988355260416",
  "orderStatus": "SUCCESS",
  "payUrl": "https://idpaydesk2.brcashypro.com/index.html?PAYDESK27618551850988355260416"
}
json
{
  "amount": 358320.0,
  "completionTime": "2024-12-02 16:08:32",
  "fee": 9083.0,
  "mchOrderNo": "1313068703462109184",
  "merchantId": "1002001",
  "nonceStr": "1733130512894",
  "orderNo": "PAYDESK27618551850988355260416",
  "orderStatus": "FAIL",
  "payUrl": "https://idpaydesk2.brcashypro.com/index.html?PAYDESK27618551850988355260416"
}

TIP

当回调响应HTTP状态码为200、301或302时,我们认为商户已经成功接收并处理回调, 其它状态我们会认为商户处理回调失败。

回调失败后会在1,2,4,8,16,32,64,128,256,512分钟重试,一共重试回调10次

Released under the MIT License.