传输方式:采用HTTP传输(生产环境建议HTTPS)
提交方式:采用POST/GET方式提交
内容类型:application/x-www-form-urlencoded
字符编码:UTF-8
签名算法:MD5
交易金额:单位为分,参数值不能带小数。
签名生成的通用步骤如下
第一步:
设所有发送或者接收到的数据为集合M,将集合M内非空参数值的参数按照参数名ASCII码从小到大排序(字典序),使用URL键值对的格式(即key1=value1&key2=value2…)拼接成字符串stringA。
特别注意以下重要规则:
◆ 参数名ASCII码从小到大排序(字典序);
◆ 如果参数的值为空不参与签名;
◆ 参数名区分大小写;
◆ 验证调用返回或支付中心主动通知签名时,传送的sign参数不参与签名,将生成的签名与该sign值作校验。
◆ 支付中心接口可能增加字段,验证签名时必须支持增加的扩展字段
第二步: 在stringA最后拼接上key[即 StringA + "&key=" + 私钥 ]
得到stringSignTemp字符串,并对stringSignTemp进行MD5运算,再将得到的字符串所有字符转换为大写,得到sign值signValue。
如请求支付系统参数如下(以下只是举例,真实签名时除了sign字段都参与加签):
Map signMap = new HashMap<>();
signMap.put("userId", "test01");
signMap.put("type", "wechat");
signMap.put("money", Double.valueOf(2));
signMap.put("remark", "");
signMap.put("outTradeNo", "P12312321123");
待签名值:money=2.0&outTradeNo=P12312321123&type=wechat&userId=test01&key=EWEFD123RGSRETYDFNGFGFGSHDFGH
签名结果:5E0AA05DD4BB4FE5AB65608123EBA591
最终请求支付系统参数:money=2.0&outTradeNo=P12312321123&type=wechat&userId=test01&sign=5E0AA05DD4BB4FE5AB65608123EBA591
> 商户登录商户系统后,通过安全中心查看或修改私钥key。
> 接口描述
业务通过统一下单接口可以发起任意三方支付渠道的支付订单。业务系统不必关心该如何调用三方支付,统一下单接口会根据业务系统选择的支付渠道ID,选择对应支付渠道的支付产品,发起下单请求,然后响应给业务系统支付请求所需参数。
> 接口链接
URL地址:{payUrl}/pay/create_order
> 请求参数
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 商户ID | mchId | 是 | String(30) | 20001222 | 支付中心分配的商户号 |
| 应用ID | appId | 否 | String(30) | cbsgB1T0SL6tfflFYoBX | 商户应用ID |
| 支付产品ID | productId | 是 | String(24) | 8001 | |
| 商户订单号 | mchOrderNo | 是 | String(30) | 20160427210604000490 | 商户生成的订单号 |
| 支付金额 | amount | 是 | int | 100 | 支付金额,单位分 |
| 币种 | currency | 是 | String(3) | VND | 三位货币代码VND |
| 客户端IP | clientIp | 否 | String(32) | 210.73.10.148 | 客户端IP地址 |
| 设备 | device | 否 | String(64) | ios10.3.1 | 客户端设备 |
| 异步回调地址 | notifyUrl | 是 | String(128) | http://shop.xx.com/notify.htm | 支付结果异步回调URL |
| 同步请求地址 | returnUrl | 否 | String(128) | http://shop.xx.com/return.htm | 支付结果同步请求URL |
| 商品主题 | subject | 是 | String(64) | MaxPay测试商品1 | 商品主题 |
| 商品描述信息 | body | 是 | String(256) | MaxPay测试商品描述 | 商品描述信息 |
| 支付通道子账户ID | payPassAccountId | 否 | String(256) | 指定通道子账号ID | 指定通道子账号ID |
| 附加参数 | extra | 否 | String(512) | {“openId”:”o2RvowBf7sOVJf8kJksUEMceaDqo”} | 特定渠道发起时额外参数 |
| 扩展参数1 | param1 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 扩展参数2 | param2 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 请求时间 | reqTime | 是 | String(30) | 20190723141000 | 请求接口时间, yyyyMMddHHmmss格式 |
| 接口版本 | version | 是 | String(3) | 1.0 | 接口版本号,固定:1.0 |
| 签名 | sign | 是 | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,详见签名算法 |
> 响应结果
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 返回状态码 | retCode | 是 | String(16) | 0 | 0-处理成功,其他-处理有误,详见错误码 |
| 返回信息 | retMsg | 否 | String(128) | 签名失败 | 具体错误原因,例如:签名失败、参数格式校验错误 |
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 支付订单号 | payOrderId | 是 | String(30) | P01201907231119090520000 | 返回支付系统订单号 |
| 支付方式 | payMethod | 是 | String(16) | formJump | 支付方式,目前包含两种: formJump-表单跳转,codeImg-二维码图片,wxApp-微信app支付,alipayApp-支付宝app支付,wxJSApi-微信公众号支付 |
| 支付表单地址 | payUrl | 否 | text | `` ...... | payMethod=formJump时存在该参数; 一般为支付表单内容 |
| 支付跳转地址 | payJumpUrl | 否 | text | 支付跳转地址,可直接重定向的URL | |
| 表单提交方式 | payAction | 否 | String(16) | GET | 指定表单提交方式: POST/GET |
| 二维码地址 | codeUrl | 否 | String(16) | https://qr.alipay.com/bax08687odiyi06c | payMethod=codeImg时存在该参数; 二维码内容地址 |
| 二维码图片地址 | codeImgUrl | 否 | String(16) | http://pay.MaxPay.org/api/qrcode_img_get?url=https://qr.alipay.com/bax08687z006c&width=200&height=200 | payMethod=codeImg时存在该参数; 二维码图片地址 |
| 支付自定义参数 | payParams | 否 | String(16) | 支付自定义参数,当payMethod为支付宝app、微信app或微信公众号支付时,该参数有值,取appStr字段 | |
| 是否需要查单 | needQuery | 否 | Boolean | true | 如果返回true则表示商户需要主动发起订单查询 |
| 当前订单状态 | orderStatus | 否 | String(16) | 2 | 当前订单状态: -2:订单已关闭,0-订单生成,1-支付中,2-支付成功,3-业务处理完成,4-已退款(2和3都表示支付成功,3表示支付平台回调商户且返回成功后的状态) |
| 签名信息 | sign | 是 | String(128) | CCD9083A6DAD9A2DA9F668C3D4517A84 | 签名信息 |
> 响应数据示例
URL方式响应数据:
json
{
"payJumpUrl":
"http://170.33.8.116:8182/payurl?mchOrderId=Pnull202011171714049724732&amount=686.00",
"payMethod": "formJump",
"payUrl": "<script>window.location.href =
http://170.33.8.116:8182/payurl?mchOrderId=Pnull202011171714049724732&amount=686.00</script>",
"retCode": "0",
"sign": "3251661E4B84AAB6BAA1A6A025F40036"
}
APP支付时响应数据:
{
"payMethod": "alipayApp",
"payParams": {
"appStr": "trade_no=2020111704200341411064884895&biz_sub_type=peerpay_trade&presessionid=&app=tb&channel=&type2=gulupay&bizcontext={\"biz_type\":\"share_pp_pay\",\"type\":\"qogirpay\"}"
},
"retCode": "0",
"sign": "6734227C78A110D7F9BF94BB9A217D3E"
}
> 接口描述
业务系统通过查询支付订单接口获取最新的支付订单状态,并根据状态结果进一步处理业务逻辑。
> 接口链接
URL地址:{payUrl}/pay/query_order
> 请求参数
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 商户ID | mchId | 是 | String(30) | 1000000010 | 支付中心分配的商户号 |
| 支付订单号 | payOrderId | 是 | String(30) | P20160427210604000490 | 支付中心生成的订单号,与mchOrderNo二者传一即可 |
| 商户订单号 | mchOrderNo | 是 | String(30) | 20160427210604000490 | 商户生成的订单号,与payOrderId二者传一即可 |
| 是否执行回调 | executeNotify | 否 | Boolean | true | 是否执行回调,如果为true,则支付中心会再次向商户发起一次回调,如果为false则不发起 |
| 请求时间 | reqTime | 是 | String(30) | 20190723141000 | 请求接口时间, yyyyMMddHHmmss格式 |
| 接口版本 | version | 是 | String(3) | 1.0 | 接口版本号,固定:1.0 |
| 签名 | sign | 是 | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,详见签名算法 |
> 响应结果
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 返回状态码 | retCode | 是 | String(16) | 0 | 0-处理成功,其他-处理有误,详见错误码 |
| 返回信息 | retMsg | 否 | String(128) | 签名失败 | 具体错误原因,例如:签名失败、参数格式校验错误 |
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 商户ID | mchId | 是 | String(30) | 20001222 | 支付中心分配的商户号 |
| 应用ID | appId | 否 | String(30) | cbsgB1T0SL6tfflFYoBX | 商户应用ID |
| 支付产品ID | productId | 是 | String(24) | 8001 | |
| 支付订单号 | payOrderId | 是 | String(30) | P01201907231119090520000 | 返回支付系统订单号 |
| 商户订单号 | mchOrderNo | 是 | String(30) | 20160427210604000490 | 商户生成的订单号 |
| 支付金额 | amount | 是 | int | 100 | 支付金额,单位分 |
| 币种 | currency | 是 | String(3) | VND | 三位货币代码,VND |
| 订单状态 | status | 是 | String(3) | 2 | 当前订单状态: -2:订单已关闭,0-订单生成,1-支付中,2-支付成功,3-业务处理完成,4-已退款(2和3都表示支付成功,3表示支付平台回调商户且返回成功后的状态) |
| 渠道用户 | channelUser | 否 | String | 渠道用户 | |
| 渠道订单号 | channelOrderNo | 否 | String wx20170910211043fb206e92260071822007 | 对应的第三方支付订单号 | |
| 渠道数据包 | channelAttach | 否 | String | 渠道数据包 | |
| 支付成功时间 | paySuccTime | 否 | Long | 1505049094262 | 支付成功时间,精确到毫秒 |
| 签名 | sign | 是 | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,详见签名算法 |
> 接口描述
当订单支付成功时,支付中心会向商户的notifyUrl地址发起回调,通知订单状态。
> 接口链接
该链接是通过统一下单接口提交的参数notifyUrl设置,如果无法访问链接,业务系统将无法接收到支付中心的通知。
> 通知参数
> 通知示例
POST:https://baidu.com/notifyUrl?income=10000000&payOrderId=P01202506170702572280020&amount=10000000&mchId=20000000&productId=8033&mchOrderNo=R571455762354668632&paySuccTime=1750143794000&sign=1EF29AF878ED5C163AFB0372773A00C7&channelOrderNo=&backType=2&reqTime=20250617070314¶m1=¶m2=&appId=7ca36fb15e8943b79d098ce8a36aec0a&status=2
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 支付订单号 | payOrderId | 是 | String(30) | P20160427210604000490 | 支付中心生成的订单号 |
| 商户ID | mchId | 是 | String(30) | 20001222 | 支付中心分配的商户号 |
| 应用ID | appId | 否 | String(30) | cbsgB1T0SL6tfflFYoBX | 商户应用ID |
| 支付产品ID | productId | 是 | String(24) | 8001 | |
| 商户订单号 | mchOrderNo | 是 | String(30) | 20160427210604000490 | 商户生成的订单号 |
| 支付金额 | amount | 是 | int | 100 | 支付金额,单位分 |
| 入账金额 | income | 是 | int | 100 | 入账金额,单位分 |
| 状态 | status | 是 | int | 1 | 支付状态,-2:订单已关闭,0-订单生成,1-支付中,2-支付成功,3-业务处理完成,4-已退款(2和3都表示支付成功,3表示支付平台回调商户且返回成功后的状态) |
| 渠道订单号 | channelOrderNo | 否 | String(64) | wx2016081611532915ae15beab0167893571 | 三方支付渠道订单号 |
| 扩展参数1 | param1 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 扩展参数2 | param2 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 支付成功时间 | paySuccTime | 是 | long | 精确到毫秒 | |
| 通知类型 | backType | 是 | int | 1 | 通知类型,1-前台通知,2-后台通知 |
| 通知请求时间 | reqTime | 是 | String(30) | 20190723141000 | 通知请求时间,yyyyMMddHHmmss格式 |
| 签名 | sign | 是 | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,详见签名算法 |
> 返回结果
业务系统处理后同步返回给支付中心,返回字符串 success 则表示成功,返回非success则表示处理失败,支付中心会再次通知业务系统。(通知频率为60/120/180/240/300,单位:秒)
注意:返回的字符串必须是小写,且前后不能有空格。
| 产品ID | 产品名称 |
|---|---|
| 8033 | 越南-MOMO |
| 8035 | 越南-ZALO |
| 8036 | 越南-VN_BANK |
| RetCode | 描述 |
|---|---|
| 0 | 成功 |
| 9999 | 业务异常,具体错误详见RetMsg字段 |
| 0100 | 商户签名异常 |
| 0010 | 系统错误 |
| 0011 | 请使用post方法 |
| 0012 | post数据为空 |
| 0013 | 签名错误 |
| 0014 | 参数错误 |
| 0015 | 商户不存在 |
| 0110 | 第三方超时 |
| 0111 | 第三方异常 |
| 0112 | 订单不存在 |
| 0113 | 订单已支付 |
| 0114 | 商品不存在 |
| 0115 | 价格不对 |
| 0116 | 物品数量不对 |
| 0117 | 过程返回255 |
| 0118 | DB错误 |
| 0119 | 支付中心没有对应的渠道 |
| 0120 | 修改订单状态失败 |
Transmission Method: Use HTTP transmission (HTTPS recommended for production environments)
Submission Method: Use POST/GET submission
Content Type: application/x-www-form-urlencoded
Character Encoding: UTF-8
Signature Algorithm: MD5
Transaction Amount: Unit is cents, parameter value cannot contain decimals.
General steps for signature generation are as follows
Step 1:
Set all sent or received data as set M, sort the non-empty parameter values in set M by parameter name in ascending ASCII order (dictionary order), and concatenate them into stringA using URL key-value pair format (i.e., key1=value1&key2=value2…).
Pay special attention to the following important rules:
◆ Sort parameter names by ascending ASCII code (dictionary order);
◆ If the parameter value is empty, it does not participate in the signature;
◆ Parameter names are case-sensitive;
◆ When verifying the signature of the call return or payment center active notification, the transmitted sign parameter does not participate in the signature, and the generated signature is compared with this sign value for verification.
◆ The payment center interface may add fields, and signature verification must support added extension fields
Step 2: Append the key to the end of stringA[i.e., StringA + "&key=" + private key]
to obtain the stringSignTemp string, perform MD5 operation on stringSignTemp, and convert all characters in the obtained string to uppercase to obtain the sign value signValue.
For example, the request payment system parameters are as follows (the following is just an example, in real signature, all fields except sign participate in signing):
Map signMap = new HashMap<>();
signMap.put("userId", "test01");
signMap.put("type", "wechat");
signMap.put("money", Double.valueOf(2));
signMap.put("remark", "");
signMap.put("outTradeNo", "P12312321123");
Value to be signed: money=2.0&outTradeNo=P12312321123&type=wechat&userId=test01&key=EWEFD123RGSRETYDFNGFGFGSHDFGH
Signature result: 5E0AA05DD4BB4FE5AB65608123EBA591
Final request payment system parameters: money=2.0&outTradeNo=P12312321123&type=wechat&userId=test01&sign=5E0AA05DD4BB4FE5AB65608123EBA591
> After logging into the merchant system, merchants can view or modify the private key through the security center.
> Interface Description
Business can initiate payment orders for any third-party payment channels through the unified order placement interface. The business system does not need to worry about how to call third-party payments. The unified order placement interface will select the corresponding payment product based on the payment channel ID selected by the business system, initiate the order request, and then respond to the business system with the parameters required for the payment request.
> Interface Link
URL Address: {payUrl}/pay/create_order
> Request Parameters
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Merchant ID | mchId | Yes | String(30) | 20001222 | Merchant number assigned by the payment center |
| App ID | appId | No | String(30) | cbsgB1T0SL6tfflFYoBX | Merchant app ID |
| Payment Product ID | productId | Yes | String(24) | 8001 | |
| Merchant Order Number | mchOrderNo | Yes | String(30) | 20160427210604000490 | Order number generated by the merchant |
| Payment Amount | amount | Yes | int | 100 | Payment amount, unit in cents |
| Currency | currency | Yes | String(3) | VND | Three-digit currency code VND |
| Client IP | clientIp | No | String(32) | 210.73.10.148 | Client IP address |
| Device | device | No | String(64) | ios10.3.1 | Client device |
| Asynchronous Callback URL | notifyUrl | Yes | String(128) | http://shop.xx.com/notify.htm | Payment result asynchronous callback URL |
| Synchronous Return URL | returnUrl | No | String(128) | http://shop.xx.com/return.htm | Payment result synchronous return URL |
| Product Subject | subject | Yes | String(64) | MaxPay test product 1 | Product subject |
| Product Description | body | Yes | String(256) | MaxPay test product description | Product description information |
| Payment Channel Sub-Account ID | payPassAccountId | No | String(256) | Specify channel sub-account ID | Specify channel sub-account ID |
| Additional Parameters | extra | No | String(512) | {“openId”:”o2RvowBf7sOVJf8kJksUEMceaDqo”} | Additional parameters for specific channels |
| Extension Parameter 1 | param1 | No | String(64) | Returned as is during payment center callback | |
| Extension Parameter 2 | param2 | No | String(64) | Returned as is during payment center callback | |
| Request Time | reqTime | Yes | String(30) | 20190723141000 | Request interface time, yyyyMMddHHmmss format |
| Interface Version | version | Yes | String(3) | 1.0 | Interface version number, fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm |
> Response Result
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Return Status Code | retCode | Yes | String(16) | 0 | 0-Processed successfully, others-Processing error, see error code |
| Return Message | retMsg | No | String(128) | Signature failed | Specific error reason, e.g., signature failed, parameter format validation error |
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Payment Order Number | payOrderId | Yes | String(30) | P01201907231119090520000 | Returned payment system order number |
| Payment Method | payMethod | Yes | String(16) | formJump | Payment method, currently includes: formJump-form jump, codeImg-QR code image, wxApp-WeChat app payment, alipayApp-Alipay app payment, wxJSApi-WeChat official account payment |
| Payment Form URL | payUrl | No | text | `` ...... | Exists when payMethod=formJump; generally payment form content |
| Payment Jump URL | payJumpUrl | No | text | Payment jump URL, can be directly redirected | |
| Form Submission Method | payAction | No | String(16) | GET | Specify form submission method: POST/GET |
| QR Code URL | codeUrl | No | String(16) | https://qr.alipay.com/bax08687odiyi06c | Exists when payMethod=codeImg; QR code content URL |
| QR Code Image URL | codeImgUrl | No | String(16) | http://pay.MaxPay.org/api/qrcode_img_get?url=https://qr.alipay.com/bax08687z006c&width=200&height=200 | Exists when payMethod=codeImg; QR code image URL |
| Payment Custom Parameters | payParams | No | String(16) | Payment custom parameters, when payMethod is Alipay app, WeChat app or WeChat official account payment, this parameter has value, take appStr field | |
| Need Query | needQuery | No | Boolean | true | If returned true, it means the merchant needs to actively initiate order query |
| Current Order Status | orderStatus | No | String(16) | 2 | Current order status: -2: Order closed, 0-Order generated, 1-Payment in progress, 2-Payment successful, 3-Business processing completed, 4-Refunded (2 and 3 both indicate payment success, 3 indicates the state after the payment platform callbacks the merchant and returns success) |
| Signature Information | sign | Yes | String(128) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Signature information |
> Response Data Example
URL method response data:
json
{
"payJumpUrl":
"http://170.33.8.116:8182/payurl?mchOrderId=Pnull202011171714049724732&amount=686.00",
"payMethod": "formJump",
"payUrl": "<script>window.location.href =
http://170.33.8.116:8182/payurl?mchOrderId=Pnull202011171714049724732&amount=686.00</script>",
"retCode": "0",
"sign": "3251661E4B84AAB6BAA1A6A025F40036"
}
APP payment response data:
{
"payMethod": "alipayApp",
"payParams": {
"appStr": "trade_no=2020111704200341411064884895&biz_sub_type=peerpay_trade&presessionid=&app=tb&channel=&type2=gulupay&bizcontext={\"biz_type\":\"share_pp_pay\",\"type\":\"qogirpay\"}"
},
"retCode": "0",
"sign": "6734227C78A110D7F9BF94BB9A217D3E"
}
> Interface Description
The business system obtains the latest payment order status through the query payment order interface and further processes the business logic based on the status result.
> Interface Link
URL Address: {payUrl}/pay/query_order
> Request Parameters
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Merchant ID | mchId | Yes | String(30) | 1000000010 | Merchant number assigned by the payment center |
| Payment Order Number | payOrderId | Yes | String(30) | P20160427210604000490 | Payment center generated order number, pass one of payOrderId or mchOrderNo |
| Merchant Order Number | mchOrderNo | Yes | String(30) | 20160427210604000490 | Merchant generated order number, pass one of payOrderId or mchOrderNo |
| Execute Notify | executeNotify | No | Boolean | true | Whether to execute callback, if true, the payment center will initiate another callback to the merchant, if false, no |
| Request Time | reqTime | Yes | String(30) | 20190723141000 | Request interface time, yyyyMMddHHmmss format |
| Interface Version | version | Yes | String(3) | 1.0 | Interface version number, fixed: 1.0 |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm |
> Response Result
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Return Status Code | retCode | Yes | String(16) | 0 | 0-Processed successfully, others-Processing error, see error code |
| Return Message | retMsg | No | String(128) | Signature failed | Specific error reason, e.g., signature failed, parameter format validation error |
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Merchant ID | mchId | Yes | String(30) | 20001222 | Merchant number assigned by the payment center |
| App ID | appId | No | String(30) | cbsgB1T0SL6tfflFYoBX | Merchant app ID |
| Payment Product ID | productId | Yes | String(24) | 8001 | |
| Payment Order Number | payOrderId | Yes | String(30) | P01201907231119090520000 | Returned payment system order number |
| Merchant Order Number | mchOrderNo | Yes | String(30) | 20160427210604000490 | Merchant generated order number |
| Payment Amount | amount | Yes | int | 100 | Payment amount, unit in cents |
| Currency | currency | Yes | String(3) | VND | Three-digit currency code, VND |
| Order Status | status | Yes | String(3) | 2 | Current order status: -2: Order closed, 0-Order generated, 1-Payment in progress, 2-Payment successful, 3-Business processing completed, 4-Refunded (2 and 3 both indicate payment success, 3 indicates the state after the payment platform callbacks the merchant and returns success) |
| Channel User | channelUser | No | String | Channel user | |
| Channel Order Number | channelOrderNo | No | String wx20170910211043fb206e92260071822007 | Corresponding third-party payment order number | |
| Channel Data Package | channelAttach | No | String | Channel data package | |
| Payment Success Time | paySuccTime | No | Long | 1505049094262 | Payment success time, accurate to milliseconds |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm |
> Interface Description
When the order payment is successful, the payment center will initiate a callback to the merchant's notifyUrl address to notify the order status.
> Interface Link
This link is set by the notifyUrl parameter submitted through the unified order placement interface. If the link cannot be accessed, the business system will not be able to receive notifications from the payment center.
> Notification Parameters
> Notification Example
POST: https://baidu.com/notifyUrl?income=10000000&payOrderId=P01202506170702572280020&amount=10000000&mchId=20000000&productId=8033&mchOrderNo=R571455762354668632&paySuccTime=1750143794000&sign=1EF29AF878ED5C163AFB0372773A00C7&channelOrderNo=&backType=2&reqTime=20250617070314¶m1=¶m2=&appId=7ca36fb15e8943b79d098ce8a36aec0a&status=2
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Payment Order Number | payOrderId | Yes | String(30) | P20160427210604000490 | Payment center generated order number |
| Merchant ID | mchId | Yes | String(30) | 20001222 | Merchant number assigned by the payment center |
| App ID | appId | No | String(30) | cbsgB1T0SL6tfflFYoBX | Merchant app ID |
| Payment Product ID | productId | Yes | String(24) | 8001 | |
| Merchant Order Number | mchOrderNo | Yes | String(30) | 20160427210604000490 | Merchant generated order number |
| Payment Amount | amount | Yes | int | 100 | Payment amount, unit in cents |
| Income Amount | income | Yes | int | 100 | Income amount, unit in cents |
| Status | status | Yes | int | 1 | Payment status, -2: Order closed, 0-Order generated, 1-Payment in progress, 2-Payment successful, 3-Business processing completed, 4-Refunded (2 and 3 both indicate payment success, 3 indicates the state after the payment platform callbacks the merchant and returns success) |
| Channel Order Number | channelOrderNo | No | String(64) | wx2016081611532915ae15beab0167893571 | Third-party payment channel order number |
| Extension Parameter 1 | param1 | No | String(64) | Returned as is during payment center callback | |
| Extension Parameter 2 | param2 | No | String(64) | Returned as is during payment center callback | |
| Payment Success Time | paySuccTime | Yes | long | Accurate to milliseconds | |
| Notification Type | backType | Yes | int | 1 | Notification type, 1-Frontend notification, 2-Backend notification |
| Notification Request Time | reqTime | Yes | String(30) | 20190723141000 | Notification request time, yyyyMMddHHmmss format |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm |
> Return Result
After the business system processes, it synchronously returns to the payment center. Returning the string "success" indicates success. Returning non-success indicates processing failure, and the payment center will notify the business system again. (Notification frequency is 60/120/180/240/300, unit: seconds)
Note: The returned string must be lowercase and cannot have spaces before or after.
| Product ID | Product Name |
|---|---|
| 8033 | Vietnam-MOMO |
| 8035 | Vietnam-ZALO |
| 8036 | Vietnam-VN_BANK |
| RetCode | Description |
|---|---|
| 0 | Success |
| 9999 | Business exception, specific error see RetMsg field |
| 0100 | Merchant signature exception |
| 0010 | System error |
| 0011 | Please use POST method |
| 0012 | POST data is empty |
| 0013 | Signature error |
| 0014 | Parameter error |
| 0015 | Merchant does not exist |
| 0110 | Third-party timeout |
| 0111 | Third-party exception |
| 0112 | Order does not exist |
| 0113 | Order already paid |
| 0114 | Product does not exist |
| 0115 | Price incorrect |
| 0116 | Item quantity incorrect |
| 0117 | Process returns 255 |
| 0118 | DB error |
| 0119 | Payment center has no corresponding channel |
| 0120 | Failed to update order status |