Merge branch 'test6.9.8' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.8
Showing
3 changed files
with
61 additions
and
67 deletions
@@ -17,18 +17,18 @@ import java.util.regex.Pattern; | @@ -17,18 +17,18 @@ import java.util.regex.Pattern; | ||
17 | public class AcpService { | 17 | public class AcpService { |
18 | 18 | ||
19 | /** | 19 | /** |
20 | - * 请求报文签名(使用配置文件中配置的私钥证书加密)<br> | ||
21 | - * 功能:对请求报文进行签名,并计算赋值certid,signature字段并返回<br> | ||
22 | - * @param reqData 请求报文map<br> | ||
23 | - * @param encoding 上送请求报文域encoding字段的值<br> | ||
24 | - * @return 签名后的map对象<br> | ||
25 | - */ | ||
26 | - public static Map<String, String> sign(Map<String, String> reqData,String encoding) { | ||
27 | - Map<String, String> submitData = SDKUtil.filterBlank(reqData); | ||
28 | - SDKUtil.sign(submitData, encoding); | ||
29 | - return submitData; | ||
30 | - } | ||
31 | - | 20 | +// * 请求报文签名(使用配置文件中配置的私钥证书加密)<br> |
21 | +// * 功能:对请求报文进行签名,并计算赋值certid,signature字段并返回<br> | ||
22 | +// * @param reqData 请求报文map<br> | ||
23 | +// * @param encoding 上送请求报文域encoding字段的值<br> | ||
24 | +// * @return 签名后的map对象<br> | ||
25 | +// */ | ||
26 | +// public static Map<String, String> sign(Map<String, String> reqData,String encoding) { | ||
27 | +// Map<String, String> submitData = SDKUtil.filterBlank(reqData); | ||
28 | +// SDKUtil.sign(submitData, encoding); | ||
29 | +// return submitData; | ||
30 | +// } | ||
31 | +// | ||
32 | /** | 32 | /** |
33 | * 多证书签名(通过传入私钥证书路径和密码加密)<br> | 33 | * 多证书签名(通过传入私钥证书路径和密码加密)<br> |
34 | * 功能:如果有多个商户号接入银联,每个商户号对应不同的证书可以使用此方法:传入私钥证书和密码(并且在acp_sdk.properties中 配置 acpsdk.singleMode=false)<br> | 34 | * 功能:如果有多个商户号接入银联,每个商户号对应不同的证书可以使用此方法:传入私钥证书和密码(并且在acp_sdk.properties中 配置 acpsdk.singleMode=false)<br> |
@@ -126,13 +126,11 @@ public class AcpService { | @@ -126,13 +126,11 @@ public class AcpService { | ||
126 | /** | 126 | /** |
127 | * 功能:后台交易提交请求报文并接收同步应答报文<br> | 127 | * 功能:后台交易提交请求报文并接收同步应答报文<br> |
128 | * @param reqData 请求报文<br> | 128 | * @param reqData 请求报文<br> |
129 | - * @param rspData 应答报文<br> | ||
130 | * @param reqUrl 请求地址<br> | 129 | * @param reqUrl 请求地址<br> |
131 | * @param encoding<br> | 130 | * @param encoding<br> |
132 | * @return 应答http 200返回true ,其他false<br> | 131 | * @return 应答http 200返回true ,其他false<br> |
133 | */ | 132 | */ |
134 | - public static Map<String,String> post( | ||
135 | - Map<String, String> reqData,String reqUrl,String encoding) { | 133 | + public static Map<String,String> post(Map<String, String> reqData,String reqUrl,String encoding) { |
136 | Map<String, String> rspData = new HashMap<String,String>(); | 134 | Map<String, String> rspData = new HashMap<String,String>(); |
137 | LogUtil.writeLog("请求银联地址:" + reqUrl); | 135 | LogUtil.writeLog("请求银联地址:" + reqUrl); |
138 | //发送后台请求数据 | 136 | //发送后台请求数据 |
@@ -156,31 +154,31 @@ public class AcpService { | @@ -156,31 +154,31 @@ public class AcpService { | ||
156 | } | 154 | } |
157 | 155 | ||
158 | /** | 156 | /** |
159 | - * 功能:http Get方法 便民缴费产品中使用<br> | ||
160 | - * @param reqUrl | ||
161 | - * @param encoding | ||
162 | - * @return | ||
163 | - */ | ||
164 | - public static String get(String reqUrl,String encoding) { | ||
165 | - | ||
166 | - LogUtil.writeLog("请求银联地址:" + reqUrl); | ||
167 | - //发送后台请求数据 | ||
168 | - HttpClient hc = new HttpClient(reqUrl, 30000, 30000); | ||
169 | - try { | ||
170 | - int status = hc.sendGet(encoding); | ||
171 | - if (200 == status) { | ||
172 | - String resultString = hc.getResult(); | ||
173 | - if (null != resultString && !"".equals(resultString)) { | ||
174 | - return resultString; | ||
175 | - } | ||
176 | - }else{ | ||
177 | - LogUtil.writeLog("返回http状态码["+status+"],请检查请求报文或者请求地址是否正确"); | ||
178 | - } | ||
179 | - } catch (Exception e) { | ||
180 | - LogUtil.writeErrorLog(e.getMessage(), e); | ||
181 | - } | ||
182 | - return null; | ||
183 | - } | 157 | +// * 功能:http Get方法 便民缴费产品中使用<br> |
158 | +// * @param reqUrl | ||
159 | +// * @param encoding | ||
160 | +// * @return | ||
161 | +// */ | ||
162 | +// public static String get(String reqUrl,String encoding) { | ||
163 | +// | ||
164 | +// LogUtil.writeLog("请求银联地址:" + reqUrl); | ||
165 | +// //发送后台请求数据 | ||
166 | +// HttpClient hc = new HttpClient(reqUrl, 30000, 30000); | ||
167 | +// try { | ||
168 | +// int status = hc.sendGet(encoding); | ||
169 | +// if (200 == status) { | ||
170 | +// String resultString = hc.getResult(); | ||
171 | +// if (null != resultString && !"".equals(resultString)) { | ||
172 | +// return resultString; | ||
173 | +// } | ||
174 | +// }else{ | ||
175 | +// LogUtil.writeLog("返回http状态码["+status+"],请检查请求报文或者请求地址是否正确"); | ||
176 | +// } | ||
177 | +// } catch (Exception e) { | ||
178 | +// LogUtil.writeErrorLog(e.getMessage(), e); | ||
179 | +// } | ||
180 | +// return null; | ||
181 | +// } | ||
184 | 182 | ||
185 | 183 | ||
186 | /** | 184 | /** |
1 | -######SDK config (product env) cert, addr##### | ||
2 | - | ||
3 | - | ||
4 | -######(PM env:for testing)####### | ||
5 | -## | ||
6 | -#acpsdk.frontTransUrl=https://101.231.204.80:5000/gateway/api/frontTransReq.do | ||
7 | -## | ||
8 | -#acpsdk.backTransUrl=https://101.231.204.80:5000/gateway/api/backTransReq.do | ||
9 | -## with card | ||
10 | -#acpsdk.backTransUrl=https://101.231.204.80:5000/gateway/api/cardTransReq.do | ||
11 | -## | ||
12 | -#acpsdk.singleQueryUrl=https://101.231.204.80:5000/gateway/api/queryTrans.do | ||
13 | -## | ||
14 | -#acpsdk.batchTransUrl=https://101.231.204.80:5000/gateway/api/batchTransReq.do | ||
15 | -## | ||
16 | -#acpsdk.fileTransUrl=https://101.231.204.80:9080/ | ||
17 | -## app trans | ||
18 | -#acpsdk.appTransUrl=https://101.231.204.80:5000/gateway/api/appTransReq.do | ||
19 | -#acpsdk.appTransUrl=${acpsdk.appTransUrl} | ||
20 | - | ||
21 | -########################## product ############################# | 1 | +######SDK配置文件 (生产环境) 证书,请求地址配置##### |
22 | 2 | ||
3 | +##########################生产环境交易发送地址############################# | ||
23 | 4 | ||
5 | +##前台交易请求地址 | ||
24 | #acpsdk.frontTransUrl=https://gateway.95516.com/gateway/api/frontTransReq.do | 6 | #acpsdk.frontTransUrl=https://gateway.95516.com/gateway/api/frontTransReq.do |
7 | +##后台交易请求地址 | ||
25 | #acpsdk.backTransUrl=https://gateway.95516.com/gateway/api/backTransReq.do | 8 | #acpsdk.backTransUrl=https://gateway.95516.com/gateway/api/backTransReq.do |
26 | -#acpsdk.singleQueryUrl=https://gateway.95516.com/gateway/api/queryTrans.do | 9 | +##交易状态查询请求地址 |
10 | +acpsdk.singleQueryUrl=https://gateway.95516.com/gateway/api/queryTrans.do | ||
11 | +##批量交易请求地址 | ||
27 | #acpsdk.batchTransUrl=https://gateway.95516.com/gateway/api/batchTransReq.do | 12 | #acpsdk.batchTransUrl=https://gateway.95516.com/gateway/api/batchTransReq.do |
13 | +##文件传输类交易地址(对账文件下载接口) | ||
28 | #acpsdk.fileTransUrl=https://filedownload.95516.com/ | 14 | #acpsdk.fileTransUrl=https://filedownload.95516.com/ |
15 | + | ||
29 | acpsdk.appTransUrl=https://gateway.95516.com/gateway/api/appTransReq.do | 16 | acpsdk.appTransUrl=https://gateway.95516.com/gateway/api/appTransReq.do |
30 | 17 | ||
31 | 18 | ||
32 | -######################### certs ################################ | 19 | +#########################生产测试环境签名证书配置 ################################ |
20 | + | ||
21 | + | ||
33 | 22 | ||
23 | +##签名证书路径,必须使用绝对路径,如果不想使用绝对路径,可以自行实现相对路径获取证书的方法 | ||
24 | +#私钥证书是从入网通知邮件中获取两码,并从cfca官网下载到浏览器中然后导出来的,请配置到acpsdk.signCert.path指定的值下,不要忘记了将私钥传到merchant.unionpay.com并启用。 | ||
34 | acpsdk.signCert.path= | 25 | acpsdk.signCert.path= |
35 | #acpsdk.signCert.path=/var/lib/tomcat/webapps/payment/WEB-INF/classes/certs/PM_700000000000001_acp.pfx | 26 | #acpsdk.signCert.path=/var/lib/tomcat/webapps/payment/WEB-INF/classes/certs/PM_700000000000001_acp.pfx |
36 | #acpsdk.signCert.path=/Users/ming/source/certs/pc_online_banking.pfx | 27 | #acpsdk.signCert.path=/Users/ming/source/certs/pc_online_banking.pfx |
37 | #acpsdk.signCert.path=/Users/ming/source/certs/PM_700000000000001_acp.pfx | 28 | #acpsdk.signCert.path=/Users/ming/source/certs/PM_700000000000001_acp.pfx |
38 | 29 | ||
30 | +#linux下(注意:在linux下读取证书需要保证证书有被应用读的权限) | ||
39 | #acpsdk.signCert.path=/SERVICE01/usr/ac_frnas/conf/ACPtest/\u4ececfca\u4e0b\u8f7d\u7684\u6b63\u5f0f\u8bc1\u4e66.pfx | 31 | #acpsdk.signCert.path=/SERVICE01/usr/ac_frnas/conf/ACPtest/\u4ececfca\u4e0b\u8f7d\u7684\u6b63\u5f0f\u8bc1\u4e66.pfx |
40 | 32 | ||
33 | +##签名证书密码,请修改为从cfca下载的正式私钥证书设置的密码,密码位数需小于等于6位,否则上传到商户服务网站会失败 | ||
41 | acpsdk.signCert.pwd=yohobuy | 34 | acpsdk.signCert.pwd=yohobuy |
42 | #acpsdk.signCert.pwd=000000 | 35 | #acpsdk.signCert.pwd=000000 |
43 | -#acpsdk.signCert.pwd=${acpsdk.signCert.pwd} | ||
44 | 36 | ||
37 | +##签名证书类型,固定不需要修改 | ||
45 | acpsdk.signCert.type=PKCS12 | 38 | acpsdk.signCert.type=PKCS12 |
46 | #acpsdk.encryptCert.path=/Users/ming/source/certs/RSA2048_PROD_index_22.cer | 39 | #acpsdk.encryptCert.path=/Users/ming/source/certs/RSA2048_PROD_index_22.cer |
47 | 40 | ||
48 | -# put acp_prod_verify_sign.cer into acpsdk.validateCert.dir | ||
49 | -#windows | 41 | +##########################验签证书配置################################ |
42 | +##验证签名证书目录,只配置到目录即可,必须使用绝对路径,如果不想使用绝对路径,可以自行实现相对路径获取证书的方法 | ||
43 | +#请将acp_prod_verify_sign.cer文件配置到acpsdk.validateCert.dir指定的目录下 | ||
44 | +#windows下 | ||
50 | acpsdk.validateCert.dir= | 45 | acpsdk.validateCert.dir= |
51 | #acpsdk.validateCert.dir=/Users/ming/source/certs/ | 46 | #acpsdk.validateCert.dir=/Users/ming/source/certs/ |
52 | 47 | ||
53 | -#linux | 48 | +#linux下(注意:在linux下读取证书需要保证证书有被应用读的权限) |
54 | #acpsdk.validateCert.dir=/SERVICE01/usr/ac_frnas/conf/ACPtest/ | 49 | #acpsdk.validateCert.dir=/SERVICE01/usr/ac_frnas/conf/ACPtest/ |
55 | 50 | ||
51 | +##是否启用多证书模式(true:单证书|false:多证书---没有配置此项时,默认为单证书模式) | ||
56 | acpsdk.singleMode=false | 52 | acpsdk.singleMode=false |
-
Please register or login to post a comment