查询类¶
余额查询¶
请求参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
版本号 | version | 定长 2 位 String | 必须 | 目前固定为 10 |
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 302 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
用户客户号 | user_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
version+cmd_id+ mer_cust_id+user_cust_id
返回参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 302 |
返回码 | resp_code | 变长 String | 必须 | 302000–调用成功 |
结果描述 | resp_desc | 变长 String | 必须 | 返回码对应的中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
用户客户号 | user_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
可用余额 | balance | 变长 14 位 String | 可选 | 账户可以转账的余额 |
可取现余额 | cash_balance | 变长 14 位 String | 可选 | 账户可以取现的余额 |
账户余额 | acct_balance | 变长 14 位 String | 可选 | 账户户资金余额,该余额能真正反映账户的资金量 |
冻结余额 | freeze_balance | 变长 14 位 String | 可选 | 冻结余额 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
cmd_id+resp_code+mer_cust_id+user_cust_id+balance+cash_balance+acct_balance+freeze_balanace
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "302"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "302",
"resp_code": "302000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "302",
"resp_code": "302003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
302000 | 交易成功 |
302010 | 记录不存在 |
302099 | 系统异常 |
302100 | 请求参数非法 |
302101 | 商户无此接口权限 |
302102 | 验证签名失败 |
302103 | 商户状态异常 |
302106 | 商户签名未配置 |
交易状态查询¶
请求参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
版本号 | version | 定长 2 位 String | 必须 | 目前固定为 10 |
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 306 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
订单日期 | order_date | 定长 8 位的 String | 可选 | 格式为 YYYYMMDD,例如:20160307 |
订单号 | order_id | 变长 20 位的 String | 可选 | 由商户生成,必须保证唯一,20 位内的字母或数字组合 |
交易流水号 | biz_trans_id | 变长 20 位 String | 可选 | 订单号跟交易流水至少传一个。如果传此参数,则表示查询两段式交易(发短信阶段跟验短信阶段)结果 |
交易查询类型 | trans_type | 定长 8 位 String | 必须 | 05000100:充值/支付; 05000101:取现; 05000102:转账: 05000103:扫码支付; 05000104:退款; 05000105:微信公众号支付; 05000106:支付宝统一下单支付 |
交易查询子类型 | sub_trans_type | 定长 8 位 String | 可选 | 预留字段,可不传 |
签名 | check_value | 定长 256 位的 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
version+cmd_id+mer_cust_id+order_date+order_id+biz_trans_id+trans_type+sub_trans_type
返回参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 306 |
返回码 | resp_code | 变长 String | 可选 | 306000–调用成功 |
结果描述 | resp_desc | 变长 String | 可选 | 返回码对应的中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
商户客户号 | mer_cust_id | 定长 16 位的 String | 必须 | 由汇付生成,商户的唯一性标识 |
订单日期 | order_date | 定长 8 位的 String | 可选 | 格式为YYYYMMDD,例如:20160307 |
订单号 | order_id | 变长 20 位的 String | 可选 | 由商户生成,必须保证唯一,20 位内的字母或数字组合 |
交易流水号 | biz_trans_id | 变长 20 位 String | 可选 | 请求参数交易流水号 |
交易查询类型 | trans_type | 定长 8 位 String | 必须 | 请求参数交易查询类型 |
交易查询子类型 | sub_trans_type | 定长 8 位 String | 可选 | 请求参数交易查询子类型 |
两段式交易明细 | result_list | 变长 512 位 String | 可选 | [{trans_stat:”02000002”,platform_seq_id:”201712111111111111”,trans_amt:”1.00”,fee_amt:”0.01”,fee_acct_id:”1111”,trans_resp_code:”201000”,trans_resp_desc:”交易成功”}] |
交易状态 | trans_stat | 定长 8 位 String | 必须 | 交易状态 02000001:已受理; 02000002:成功; 02000003:失败;02000005:处理中; 02000006:部分成功(充值成功,支付失败) |
本平台交易唯一标识号 | platform_seq_id | 定长 18 位 String | 必须 | 组成规则:8 位本平台日期 +10 位系统流水号 |
交易金额 | trans_amt | 定长 14 位的 String | 必须 | 交易金额,格式为###.00 |
手续费 | fee_amt | 定长 14 位的 String | 可选 | 手续费金额,格式为###.00 |
手续费收取账户 | fee_acct_id | 变长 9 位 String | 可选 | 手续费收取子账户 |
交易返回码 | trans_resp_code | 定长 6 位 String | 可选 | 交易接口的返回码 |
交易返回描述 | trans_resp_desc | 变长 String | 可选 | 交易返回码对应的中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
签名 | check_value | 定长 256 位的 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
cmd_id+resp_code+mer_cust_id+order_date+order_id+biz_trans_id+trans_type+sub_trans_type
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "306"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "306",
"resp_code": "306000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "306",
"resp_code": "306003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
306000 | 交易成功 |
306010 | 记录不存在 |
306099 | 系统异常 |
306100 | 请求参数非法 |
306101 | 商户无此接口权限 |
306102 | 验证签名失败 |
306103 | 商户状态异常 |
306106 | 商户签名未配置 |
充值支付对账¶
请求参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
版本号 | version | 定长 2 位 String | 必须 | 目前固定为 10 |
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 303 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数,>0 且 <=1000 的整数 |
交易类型 | trans_type | 定长 8 位 String | 可选 | 02020100:充值 02020101:支付 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
version+cmd_id+mer_cust_id+begin_date+end_date+page_num+page_size+trans_type
返回参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 303 |
应答返回码 | resp_code | 定长 6 位 String | 必须 | 303000–调用成功 |
应答返回描述 | resp_desc | 变长 String | 必须 | 返回码的对应中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数,>0 且<=1000 的整数 |
记录总条数 | total_num | 变长 String | 可选 | 记录总条数 |
对账结果串 | result_list | 变长 String | 可选 | [{“order_date”:”20161129”,”order_id”:”201611292010001”,”platform_seq_id”:”2016112910000085”,”out_cust_id”:”6000010000000015”,”in_cust_id”:”6000010000000025”,”trans_type”:”02020101”,”recharge_type”:”02020002”,”bank_id”:”01030000”,”trans_amt”:”12.23”,”real_trans_amt”:”12.00”,”fee_amt”:”0.23”,”fee_cust_id”:”6000010000000001”,”fee_acct_id”:”888”,”trans_stat”:”02000002”}] |
商户订单日期 | order_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD |
商户订单号 | order_id | 变长 20 位 String | 必须 | 由商户生成,必须保证唯一,20 位内数字或字母的组合 |
本平台交易唯一标识号 | platform_seq_id | 定长 18 位 String | 必须 | 组成规则:8 位本平台日期 +10 位系统流水号 |
出账客户号 | out_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识,业务类型为充值时,出账客户是充值客户 |
入账客户号 | in_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识,业务类型为充值时,入账客户是充值客户 |
业务类型 | trans_type | 定长 8 位 String | 必须 | 02020100:充值; 02020101:支付 |
充值类型 | recharge_type | 定长 8 位 String | 必须 | 02020000:个人网银充值; 02020001:企业网银充值; 02020002:快捷充值; 02020003:代扣充值; 02020006:二段式快捷,交易类型为免注册网银支付时,充值类型仅支持个人网银和企业网银 |
充值银行代号 | bank_id | 变长 8 位 String | 必须 | 8 位银行代号 |
支付金额 | trans_amt | 变长 14 位 String | 必须 | 交易金额,格式为###.00 |
手续费金额 | fee_amt | 变长 14 位 String | 可选 | 手续费金额,格式为###.00 |
手续费扣款客户号 | fee_cust_id | 定长 16 位 String | 可选 | 手续费扣款客户号 |
手续费扣款账户号 | fee_acct_id | 变长 9 位 String | 可选 | 手续费扣款账户号 |
交易状态 | trans_stat | 定长 8 位 String | 必须 | 02000001:已受理; 02000002:成功;02000003:失败; 02000005:处理中 |
业务请求流水 | biz_trans_id | 变长 20 位 String | 可选 | 商户下判断唯一,只能是数字和字母 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
cmd_id+resp_code+mer_cust_id+begin_date+end_date+page_num+page_size+total_num
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "303"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "303",
"resp_code": "303000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "303",
"resp_code": "303003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
303000 | 交易成功 |
303010 | 记录不存在 |
303099 | 系统异常 |
303100 | 请求参数非法 |
303101 | 商户无此接口权限 |
303102 | 验证签名失败 |
303103 | 商户状态异常 |
303106 | 商户签名未配置 |
取现对账¶
请求参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
版本号 | version | 定长 2 位 String | 必须 | 目前固定为 10 |
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 304 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数 >0 且 <=1000 的整数 |
取现类型 | cash_type | 定长 8 位 String | 可选 | 02030000:T0 ; 02030010:T1 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
version+cmd_id+mer_cust_id+begin_date+end_date+page_num+page_size+cash_type
返回参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 304 |
应答返回码 | resp_code | 定长 6 位 String | 必须 | 304000–调用成功 |
应答返回描述 | resp_desc | 变长 String | 必须 | 返回码的对应中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数,>0 且<=1000 的整数 |
记录总条数 | total_num | 变长 String | 可选 | 记录总条数 |
对账结果串 | result_list | 变长 String | 可选 | [{“order_date”:”20161129”,”order_id”:”201611292010001”,”platform_seq_id”:”2016112910000085”,”user_cust_id”:”6000010000000015”,”cash_type”:”02020101”,”bank_id”:”01030000”,”card_no”:”62626468151546551”,”trans_amt”:”12.23”,”real_trans_amt”:”12.00”,”in_cust_id”:”6000010000000015”,”fee_amt”:”0.23”,”fee_cust_id”:”6000010000000001”,”fee_acct_id”:”888”,”trans_stat”:”02000002”}] |
商户订单日期 | order_date | 定长 8 位 String | 必须 | 格式为YYYYMMDD |
商户订单号 | order_id | 变长 20 位 String | 必须 | 由商户生成,必须保证唯一,20 位内数字或字母的组合 |
本平台交易唯一标识号 | platform_seq_id | 定长 18 位 String | 必须 | 组成规则:8 位本平台日期 +10 位系统流水号 |
取现客户号 | user_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
取现类型 | cash_type | 定长 8 位 String | 必须 | 02030000:T0; 02030010:T1 |
银行代号 | bank_id | 变长 8 位 String | 必须 | 8 位银行代号 |
银行卡号 | card_no | 变长 32 位 String | 必须 | 银行卡号 |
交易金额 | trans_amt | 变长 14 位 String | 必须 | 交易金额,格式为###.00 |
实际出账金额 | real_trans_amt | 变长 14 位 String | 可选 | 实际出账金额,交易成功时必须,格式为###.00 |
手续费金额 | fee_amt | 变长 14 位 String | 可选 | 手续费金额,格式为###.00 |
手续费扣款客户号 | fee_cust_id | 定长 16 位 String | 可选 | 手续费扣款客户号 |
手续费扣款账户号 | fee_acct_id | 变长 9 位 String | 可选 | 手续费扣款账户号 |
商户收取服务费金额 | serv_fee_amt | 变长 14 位 String | 可选 | 商户收取用户的服务费金额,格式为###.00 |
商户子账户号 | serv_fee_acct_id | 变长 9 位 String | 可选 | 服务费非空时为必填,商户用来收取服务费的子账户号 |
交易状态 | trans_stat | 定长 8 位 String | 必须 | 02000001:已受理; 02000002:成功; 02000003:失败 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
cmd_id+resp_code+mer_cust_id+begin_date+end_date+page_num+page_size+total_num
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "304"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "304",
"resp_code": "304000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "304",
"resp_code": "304003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
304000 | 交易成功 |
304010 | 记录不存在 |
304099 | 系统异常 |
304100 | 请求参数非法 |
304101 | 商户无此接口权限 |
304102 | 验证签名失败 |
304103 | 商户状态异常 |
304106 | 商户签名未配置 |
转账对账¶
请求参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
版本号 | version | 定长 2 位 String | 必须 | 目前固定为 10 |
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 305 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数,>0 且 <=1000 的整数 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
version+cmd_id+mer_cust_id+begin_date+end_date+page_num+page_size
返回参数列表¶
中文名 | 参数名 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
消息类型 | cmd_id | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 305 |
应答返回码 | resp_code | 定长 6 位 String | 必须 | 305000–调用成功 |
应答返回描述 | resp_desc | 变长 String | 必须 | 返回码的对应中文描述,中文为 UTF-8 字符集 URLEncode 编码后的字符串,商户应解码获取原文 |
商户客户号 | mer_cust_id | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
开始日期 | begin_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
结束日期 | end_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD,开始日期和结束日期跨度不能大于 90 天 |
当前页号 | page_num | 变长 String | 必须 | 查询数据的所在页号,>0 的整数 |
每页记录数 | page_size | 变长 4 位 String | 必须 | 每页记录数 >0 且<=1000 的整数 |
记录总条数 | total_num | 变长 String | 可选 | 记录总条数 |
对账结果串 | result_list | 变长 String | 可选 | [{“order_date”:”20161129”,”order_id”:”201611292010001”,”platform_seq_id”:”2016112910000085”,”out_cust_id”:”6000010000000015”,”out_acct_id”:”777”,”in_cust_id”:”6000010000000025”,”in_acct_id”:”888”,”trans_amt”:”12.23”,”trans_stat”:”02000002”}] |
商户订单日期 | order_date | 定长 8 位 String | 必须 | 格式为 YYYYMMDD |
商户订单号 | order_id | 变长 20 位 String | 必须 | 由商户生成,必须保证唯一,20 位内数字或字母的组合 |
本平台交易唯一标识号 | platform_seq_id | 定长 18 位 String | 必须 | 组成规则:8 位本平台日期 +10 位系统流水号 |
出账客户号 | out_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识,充值交易时,出账客户就是充值客户 |
出账账户号 | out_acct_id | 变长 9 位 String | 必须 | 出账账户号 |
入款客户号 | in_cust_id | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
入账账户号 | in_acct_id | 变长 9 位 String | 必须 | 入账账户号 |
交易金额 | trans_amt | 变长 14 位 String | 必须 | 交易金额,格式为###.00 |
交易状态 | trans_stat | 定长 8 位 String | 必须 | 02000002:成功; 02000003:失败 |
签名 | check_value | 变长 256 位 String | 必须 | 加签规则:MD5+RSA 将参数列表的值按从上到下的顺序进行字符串拼接,调用签名函数获得的值 |
本接口加签拼接顺序:
cmd_id+resp_code+mer_cust_id+begin_date+end_date+page_num+page_size+total_num
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "305"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "305",
"resp_code": "305000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "305",
"resp_code": "305003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
305000 | 交易成功 |
305010 | 记录不存在 |
305099 | 系统异常 |
305100 | 请求参数非法 |
305101 | 商户无此接口权限 |
305102 | 验证签名失败 |
305103 | 商户状态异常 |
305106 | 商户签名未配置 |
签约号查询接口¶
请求参数列表¶
字段名 | 参数中文名称 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
version | 版本号 | 定长 2 位 String | 必须 | 目前固定为 10 |
cmd_id | 消息类型 | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 315 |
mer_cust_id | 商户号 | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
user_cust_id | 用户号 | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
card_no | 银行卡号 | 变长 20 位的 String | 必须 | |
card_mobile | 手机号 | 定长 11 位 String | 必须 | |
cert_id | 身份证号 | 变长 18 位的 String | 必须 | |
mer_priv | 商户私有域 | 变长 120 位的 String | 可选 | 为商户的自定义字段,该字段在交易完成后由本平台原样返回 |
extension | 扩展域 | 变长 512 位的 String | 可选 | 用于扩展请求参数 |
本接口加签拼接顺序:
version+cmd_id+mer_cust_id+user_cust_id+card_no+card_mobile+mer_priv+extension
返回参数列表¶
参数中文名称 | 参数中文名称 | 数据格式 | 是否必须 | 说明 |
---|---|---|---|---|
cmd_id | 消息类型 | 定长 3 位 String | 必须 | 每一种消息类型代表一种交易,此处为 315 |
resp_code | 应答返回码 | 定长 6 位的 String | 必须 | 305000–调用成功 |
resp_desc | 应答描述 | 变长 String | 必须 | |
mer_cust_id | 商户号 | 定长 16 位 String | 必须 | 由汇付生成,商户的唯一性标识 |
user_cust_id | 用户号 | 定长 16 位 String | 必须 | 由汇付生成,用户的唯一性标识 |
mer_priv | 商户私有域 | 变长 120 位的 String | 可选 | 为商户的自定义字段,该字段在交易完成后由本平台原样返回 |
extension | 扩展域 | 变长 512 位的 String | 可选 | 用于扩展请求参数 |
本接口加签拼接顺序:
cmd_id+resp_code+resp_desc+mer_cust_id+user_cust_id+mer_priv+extension
代码示例¶
java
String result = new String();
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://mertest.chinapnr.com/asharp/merchantRequest");
try {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("version", "10"));
nvps.add(new BasicNameValuePair("cmd_id", "315"));
nvps.add(new BasicNameValuePair("mer_cust_id", "6666000000000001"));
nvps.add(new BasicNameValuePair("order_date", "20180327"));
nvps.add(new BasicNameValuePair("order_id", "10000000001"));
.......
post.setEntity(new UrlEncodedFormEntity(nvps));
HttpResponse httpResponse = client.execute(post);
int code = httpResponse.getStatusLine().getStatusCode();
String returnStr = EntityUtils.toString(httpResponse.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
成功响应
200
{
"cmd_id": "315",
"resp_code": "315000",
"resp_desc": "交易成功",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
失败响应
200
{
"cmd_id": "315",
"resp_code": "315003",
"resp_desc": "交易失败",
"mer_cust_id" : "6666000000000001",
"order_date": "20180327",
"order_id": "10000000001",
.......
}
接口返回码¶
返回参数 | 返回描述 |
315000 | 交易成功 |
315099 | 系统异常 |
315100 | 请求参数非法 |
315101 | 商户无此接口权限 |
315102 | 验证签名失败 |
315103 | 商户状态异常 |
315104 | 用户状态异常 |
315106 | 商户签名未配置 |
315107 | 消息类型与签名内容不一致 |
315108 | 商户状态异常 |
315302 | 查无协议号,须重新签约 |
315003 | 交易失败 |