Commit e4df144b authored by 胡建龙's avatar 胡建龙

20220427 封装cmb.properties文件

parent b014a6af
package com.hand.app.cmb.util;
import com.alibaba.fastjson.JSONObject;
import com.chinapay.secss.LogUtil;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
......@@ -18,9 +19,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import javax.net.ssl.*;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.KeyManagementException;
......@@ -39,13 +38,16 @@ public class Utils {
try {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
......@@ -57,6 +59,7 @@ public class Utils {
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
......@@ -168,4 +171,33 @@ public class Utils {
return paramMap;
}
/**
* 加载properties配置文件
* @param propPath
* @return
*/
public static Properties loadProp(String propPath) {
Properties props = new Properties();
FileInputStream is = null;
try {
is = new FileInputStream(propPath);
props.load(is);
return props;
} catch (Exception var13) {
LogUtil.writeErrorLog("加载配置文件失败", var13);
} finally {
if (is != null) {
try {
is.close();
} catch (IOException var12) {
;
}
}
}
return null;
}
}
#招行获取二维码接口
cmb.qrCodeapplyUrl=https://api.cmburl.cn:8065/polypay/v1.0/mchorders/qrcodeapply
#招行查询订单状态接口
cmb.orderQueryUrl=https://api.cmburl.cn:8065/polypay/v1.0/mchorders/orderquery
#招行关闭订单接口
cmb.closeUrl=https://api.cmburl.cn:8065/polypay/v1.0/mchorders/qrcodeapply
#uat环境商户国密私钥
cmb.privateKey=D5F2AFA24E6BA9071B54A8C9AD735F9A1DE9C4657FA386C09B592694BC118B38
#uat环境招行国密公钥
cmb.publicKey=MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE6Q+fktsnY9OFP+LpSR5Udbxf5zHCFO0PmOKlFNTxDIGl8jsPbbB/9ET23NV+acSz4FEkzD74sW2iiNVHRLiKHg==
cmb.appId=8ab74856-8772-45c9-96db-54cb30ab9f74
cmb.appSecret=5b96f20a-011f-4254-8be8-9a5ceb2f317f
cmb.server=cmbServer
cmb.version=0.0.1
cmb.encoding=UTF-8
cmb.signMethod=02
cmb.currencyCode=156
cmb.user.id=N003574551
cmb.mer.id=3089991701201D0
cmb.payValidTime=900
cmb.notifyUrl=http://sign.hitachics.com/core/api/public/cmb/get/qr/code/listen
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment