Skip to content

创建代收订单

API EndPoint

POST baseUrl + /api/payIn

请求参数

参数名必选类型字段说明示例
currencyYstring(32)货币代码BRL
payTypeYint代收PayType枚举代收PayType枚举
amountYdecimal(20,2)金额[5,100000]
reusableStatusYboolean是否多次支付目前只能是false
mchOrderNoYstring(32)商户订单号不允许重复
expireTimeYlong过期时间默认3600秒 不一定有效,部分通道支持
notifyUrlYstring(250)回调地址
nonceStrYstring(32)随机字符串
remarkYstring(32)备注请使用英文字符或不带重音的西语
realNameYstring(64)用户姓名限制最长64个字符
idTypeYstring(32)代收付款人证件类型只支持CPF代收付款人证件类型
idCardYstring(32)代收付款人CPF证件号
redirectUrlNstring(250)重定向地址支付成功后重定向地址
phoneNstring(32)手机号
emailNstring(64)邮箱

TIP

请注意:

  • 受巴西央行监管要求,从2024年10月15日起,idType idCard realName 调整为必传,并且我们会做基本的CPF格式校验。( 123.456.789-09 / 12345678909) 这两种格式均支持。
  • 受巴西央行监管要求,从2024年10月15日起,代收订单均会对付款人的CPF进行校验,请在创建订单时务必传递付款人真实的CPF证件号。

请求示例

bash
curl -L 'baseUrl/api/payIn' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"realName":"Reza Wijaya","amount":"20000.00","reusableStatus":false,"payType":"43","expireTime":3600,"mchOrderNo":"1386556787811426305","notifyUrl":"https://merchant.com/webhooks/payin","currency":"IDR","remark":"Electronic Cigarettes","nonceStr":"16a5a70f43384134bfae33acc77132e0"}'

响应参数

参数名类型说明
merchantIdlong商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
amountdecimal(20,0)金额
orderFeedecimal(20,0)手续费
payCodestring(32)付款QRCODE
payUrlstring(250)付款链接
payDeskUrlstring(250)收银台支付地址
json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556787811426305",
    "orderNo": "PAYIN8551844049125523456",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=20241202111212800110166154827",
    "payDeskUrl": "https://m.dana.id/link/pay?bizNo=20241202111212800110166154827",
    "amount": "20000",
    "orderFee": "1700"
  }
}
json
{
  "msg": "Payin_Order_Error",
  "code": 500
}

查询代收订单

API EndPoint

POST baseUrl + /api/payInQuery

请求参数

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

TIP

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

请求示例

bash
curl -L 'baseUrl/api/payInQuery' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"mchOrderNo":"1386556575370063873","nonceStr":"9459931608","orderNo":"PAYIN8551843837024997376"}'

响应参数

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

响应示例

json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "PAYING",
    "completionTime": null,
    "nonceStr": null
  }
}
json
{
  "msg": "SUCCESS",
  "code": 200,
  "data": {
    "merchantId": "1002001",
    "mchOrderNo": "1386556575370063873",
    "orderNo": "PAYIN8551843837024997376",
    "payType": "43",
    "payCode": "",
    "payUrl": "https://m.dana.id/link/pay?bizNo=202412021112128001101660361270",
    "payDeskUrl": "https://idpaydesk2.brcashypro.com/views/pay.html?PAYIN8551843837024997376",
    "amount": "20000",
    "fee": "1700",
    "orderStatus": "SUCCESS",
    "completionTime": "2024-12-02 15:40:50",
    "nonceStr": null
  }
}

代收订单结果通知

通知地址由商户提供

POST Merchant NotifyUrl

异步通知请求参数

参数名类型说明
merchantIdint商户Id
mchOrderNostring(32)商户订单号
orderNostring(32)平台订单号
channelOrderNostring(32)渠道订单号
payTypestring(32)代收PayType枚举
payCodestring(32)支付码
payUrlstring(250)付款二维码
amountdecimal(20,0)金额
feedecimal(20,4)手续费
orderStatusstring(32)代收订单状态枚举
completionTimedate完成时间

异步通知请求示例

bash
curl -L 'merchant.com/webhooks/payin' \
-H 'MerchantId: 1002001' \
-H 'Sign: A6FC73F7D22EC8B4A064C8FFCC592CBF' \
-H 'Content-Type: application/json' \
-d '{"amount":20000.00,"completionTime":"2024-12-02 12:07:06","fee":2500.0000,"mchOrderNo":"1386503284355244033","merchantId":"1002001","nonceStr":"1733116026894","orderNo":"PAYIN8551790545658687488","orderStatus":"SUCCESS","payCode":"OR.GPNQR..INOPROID_BS","payType":"41","payUrl":"https://payurl.com"}'
json
{
  "amount": 20000.0,
  "completionTime": "2024-12-02 12:07:06",
  "fee": 2500.0,
  "mchOrderNo": "1386503284355244033",
  "merchantId": "1002001",
  "nonceStr": "1733116026894",
  "orderNo": "PAYIN8551790545658687488",
  "orderStatus": "SUCCESS",
  "payCode": "OR.GPNQR..INOPROID_BS",
  "payType": "41",
  "payUrl": "https://payurl.com"
}
json
{
  "amount": 20000.0,
  "completionTime": "2024-12-02 12:07:06",
  "fee": 2500.0,
  "mchOrderNo": "1386503284355244033",
  "merchantId": "1002001",
  "nonceStr": "1733116026894",
  "orderNo": "PAYIN8551790545658687488",
  "orderStatus": "FAIL",
  "payCode": "OR.GPNQR..INOPROID_BS",
  "payType": "41",
  "payUrl": "https://payurl.com"
}

TIP

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

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

Released under the MIT License.