通联支持多渠道扣款
This commit is contained in:
parent
361b099a04
commit
c08599e981
@ -4389,7 +4389,7 @@
|
||||
<class name="LC_CARD_PAYMENT" label="通联卡扣信息表" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="标识" type="STRING"/>
|
||||
<attribute name="CONTRACT_NUMBER" label="合同号" type="STRING"/>
|
||||
<attribute name="PROJECT_ID" label="项目ID" type="STRING"/>
|
||||
<attribute name="STATUS" label="扣款状态" type="STRING"/>
|
||||
<attribute name="SUBMITTIME" label="发起扣款时间" type="STRING"/>
|
||||
<attribute name="FINTIME" label="扣款时间" type="STRING"/>
|
||||
|
||||
@ -1,35 +1,56 @@
|
||||
#安鹏国际融资租赁(深圳)有限公司(SZ)
|
||||
#通联商户号 (测试) (正式待定)
|
||||
allinPayMerchantId=200604000011645
|
||||
SZ_allinPayMerchantId=200604000011645
|
||||
|
||||
#通联用户名(测试) (正式待定)
|
||||
allinPayUsername=20060400001164504
|
||||
SZ_allinPayUsername=20060400001164504
|
||||
|
||||
#通联用户密码 (测试) (正式待定)
|
||||
allinPayUserpass=111111
|
||||
SZ_allinPayUserpass=111111
|
||||
|
||||
#通联私钥密码 (测试) (正式待定)
|
||||
allinPayPfxpass=rzdp
|
||||
SZ_allinPayPfxpass=rzdp
|
||||
|
||||
#通联公钥 (测试)(正式待定)
|
||||
allinPayPathcer=20060400001164504.cer
|
||||
SZ_allinPayPathcer=20060400001164504.cer
|
||||
|
||||
#通联商户私钥路径(测试) (正式待定)
|
||||
allinPayPathpfx=allinpay.p12
|
||||
SZ_allinPayPathpfx=allinpay.p12
|
||||
|
||||
#通联收款类业务代码(测试)
|
||||
allinBusinessCode=19900
|
||||
SZ_allinBusinessCode=19900
|
||||
|
||||
|
||||
#安鹏国际融资租赁(深圳)有限公司(TJ)
|
||||
#通联商户号 (测试) (正式待定)
|
||||
TJ_allinPayMerchantId=200604000011645
|
||||
|
||||
#通联用户名(测试) (正式待定)
|
||||
TJ_allinPayUsername=20060400001164504
|
||||
|
||||
#通联用户密码 (测试) (正式待定)
|
||||
TJ_allinPayUserpass=111111
|
||||
|
||||
#通联私钥密码 (测试) (正式待定)
|
||||
TJ_allinPayPfxpass=rzdp
|
||||
|
||||
#通联公钥 (测试)(正式待定)
|
||||
TJ_allinPayPathcer=20060400001164504.cer
|
||||
|
||||
#通联商户私钥路径(测试) (正式待定)
|
||||
TJ_allinPayPathpfx=allinpay.p12
|
||||
|
||||
#通联收款类业务代码(测试)
|
||||
TJ_allinBusinessCode=19900
|
||||
|
||||
|
||||
|
||||
#公共区域
|
||||
#通联测试接口地址(测试)
|
||||
allinPayUrl=https://test.allinpaygd.com/aipg/ProcessServlet
|
||||
#通联测试接口地址(正式)
|
||||
#allinPayUrl=https://tlt.allinpay.com/aipg/ProcessServle
|
||||
|
||||
|
||||
#短信发送url(测试)
|
||||
sendMessageUrl=http://127.0.0.1:8081/apzl_leasing/allinpay/sign?method=allinPaySign&con=
|
||||
#短信发送url(正式)
|
||||
#sendMessageUrl=https://erp.zjmileasing.com/allinpay/sign?method=allinPaySign&con=
|
||||
|
||||
#通联文件保存地址
|
||||
filePath=/data/files/tmp/allinpay/allinpay_{uuid}_{YYYYMMDD}.txt
|
||||
|
||||
|
||||
@ -46,7 +46,6 @@ public class AllinpayPaymentQueryRun implements Runnable{
|
||||
private Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
public AllinpayPaymentQueryRun() {
|
||||
this.allinpay = new AllinpayProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,13 +70,17 @@ public class AllinpayPaymentQueryRun implements Runnable{
|
||||
}
|
||||
while (size > start) {
|
||||
logger.info("开始第" + start + "至" + (start + maxCount) + "次循环");
|
||||
boLOEDs = bomLCP.createQuery("O.STATUS='正在处理' ").setFirstResult(start).setMaxResults(maxCount).getResultList(true);
|
||||
boLOEDs = bomLCP.createQuery("O.STATUS='ÕýÔÚ´¦Àí' ").setFirstResult(start).setMaxResults(maxCount).getResultList(true);
|
||||
|
||||
if (boLOEDs == null || boLOEDs.size() == 0) {
|
||||
logger.error("没有需要查询的通联支付信息>>>>>>>>>>:");
|
||||
break;
|
||||
}
|
||||
for (BizObject boLCP : boLOEDs) {
|
||||
try {
|
||||
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO").createQuery("O.id=:id").setParameter("id", boLCP.getAttribute("PROJECT_ID").toString()).getSingleResult(false);
|
||||
|
||||
allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
|
||||
String quertSn= boLCP.getAttribute("REQ_SN").toString();
|
||||
String num = boLCP.getAttribute("NUM").toString();
|
||||
localFilePath = boLCP.getAttribute("FULLPATH").toString();
|
||||
|
||||
@ -36,7 +36,6 @@ public class AllinpayPaymentRun implements Runnable {
|
||||
private Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
public AllinpayPaymentRun(List<Map<String, String>> list) {
|
||||
this.allinpay = new AllinpayProperties();
|
||||
this.list=list;
|
||||
}
|
||||
|
||||
@ -58,6 +57,10 @@ public class AllinpayPaymentRun implements Runnable {
|
||||
String time = DateAssistant.getTodayNow();
|
||||
for (Map<String, String> map : list) {
|
||||
try {
|
||||
|
||||
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO").createQuery("O.id=:id").setParameter("id", map.get("PROJECT_ID")).getSingleResult(false);
|
||||
allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
|
||||
|
||||
BizObject result = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_CARD_TLSIGN").createQuery("O.PROJECT_ID=:projectId and SIGN_STATUS='sign_status2'").setParameter("projectId", map.get("PROJECT_ID")).getSingleResult(false);
|
||||
|
||||
logger.info(">>>>>>>>>>>ͨÁª¿¨¿ÛÐÒéÖ§¸¶>>>>>>>>PROJECT_ID=" + map.get("PROJECT_ID"));
|
||||
|
||||
@ -25,13 +25,15 @@ public class AllinpayServiceImpl implements AllinpayService {
|
||||
String phoneNumber = "";
|
||||
String accNumber = "";
|
||||
String certId = "";
|
||||
String sql = "SELECT ca.account customername,ca.mobile phonenumber,ca.acc_number accNumber,ca.certid certId FROM lb_project_info lpi LEFT JOIN customer_account ca ON ca.project_id=lpi.ID WHERE lpi.id=:Id";
|
||||
String subjectid = "";
|
||||
String sql = "SELECT lpi.subjectid,ca.account customername,ca.mobile phonenumber,ca.acc_number accNumber,ca.certid certId FROM lb_project_info lpi LEFT JOIN customer_account ca ON ca.project_id=lpi.ID WHERE lpi.id=:Id";
|
||||
Transaction Sqlca = Transaction.createTransaction("als");
|
||||
SqlObject sqlObject = new SqlObject(sql);
|
||||
sqlObject.setParameter("Id", projectId);
|
||||
ASResultSet resultSet = allinpayDao.getASResultSet(Sqlca,sqlObject);
|
||||
try {
|
||||
while (resultSet.next()) {
|
||||
subjectid = resultSet.getString("subjectid");
|
||||
userName = resultSet.getString("customername");
|
||||
phoneNumber = resultSet.getString("phonenumber");
|
||||
accNumber = resultSet.getString("accNumber");
|
||||
@ -67,6 +69,7 @@ public class AllinpayServiceImpl implements AllinpayService {
|
||||
map.put("accNumber", accNumber);
|
||||
map.put("phoneNumber", phoneNumber);
|
||||
map.put("certId", certId);
|
||||
map.put("subjectid", subjectid);
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -79,13 +82,15 @@ public class AllinpayServiceImpl implements AllinpayService {
|
||||
public Map<String, String> allinPaySigning(String projectId) throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String phoneNumber = "";
|
||||
String sql = "SELECT ca.mobile phonenumber FROM lb_project_info lpi LEFT JOIN customer_account ca ON ca.project_id=lpi.ID WHERE lpi.id=:Id";
|
||||
String subjectid = "";
|
||||
String sql = "SELECT lpi.subjectid,ca.mobile phonenumber FROM lb_project_info lpi LEFT JOIN customer_account ca ON ca.project_id=lpi.ID WHERE lpi.id=:Id";
|
||||
Transaction Sqlca = Transaction.createTransaction("als");
|
||||
SqlObject sqlObject = new SqlObject(sql);
|
||||
sqlObject.setParameter("Id", projectId);
|
||||
ASResultSet resultSet = allinpayDao.getASResultSet(Sqlca,sqlObject);
|
||||
try {
|
||||
while (resultSet.next()) {
|
||||
subjectid = resultSet.getString("subjectid");
|
||||
phoneNumber = resultSet.getString("phonenumber");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
@ -112,6 +117,7 @@ public class AllinpayServiceImpl implements AllinpayService {
|
||||
throw new Exception("数据为空,请联系相关业务人员");
|
||||
}
|
||||
map.put("phoneNumber", phoneNumber);
|
||||
map.put("subjectid", subjectid);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@ -21,18 +21,20 @@ import com.tenwa.lease.app.allinpay.util.AllinpayProperties;
|
||||
* ͨÁªÐÒéǩԼ²éѯ
|
||||
*/
|
||||
public class AllinpaySignService {
|
||||
public String contractNumber;
|
||||
public String projectId;
|
||||
public String accountNo;
|
||||
|
||||
public Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
public String allinPayQuery(JBOTransaction tx) throws Exception {
|
||||
AllinpayProperties allinpay = new AllinpayProperties();
|
||||
String message = contractNumber;
|
||||
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO", tx).createQuery("O.id=:id").setParameter("id", projectId).getSingleResult(false);
|
||||
|
||||
AllinpayProperties allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
|
||||
String message = projectId;
|
||||
try {
|
||||
BizObjectManager bomLCT = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_CARD_TLSIGN", tx);
|
||||
List<BizObject> boLCTs = bomLCT.createQuery("O.CONTRACT_NUMBER=:contractNumber").setParameter("contractNumber", contractNumber).getResultList(true);
|
||||
List<BizObject> boLCTs = bomLCT.createQuery("O.PROJECT_ID=:projectId").setParameter("projectId", projectId).getResultList(true);
|
||||
BizObject boLCT;
|
||||
if(boLCTs==null||boLCTs.size()==0) {
|
||||
message = "success";
|
||||
@ -81,18 +83,18 @@ public class AllinpaySignService {
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
message=contractNumber;
|
||||
message=projectId;
|
||||
e.printStackTrace();
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getContractNumber() {
|
||||
return contractNumber;
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setContractNumber(String contractNumber) {
|
||||
this.contractNumber = contractNumber;
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getAccountNo() {
|
||||
|
||||
@ -5,7 +5,6 @@ import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -35,7 +34,7 @@ public class AllinpayServlet extends BaseServlet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private AllinpayProperties factory = new AllinpayProperties();
|
||||
private AllinpayProperties factory ;
|
||||
|
||||
private AllinpayService allinpayService = new AllinpayServiceImpl();
|
||||
|
||||
@ -48,6 +47,8 @@ public class AllinpayServlet extends BaseServlet {
|
||||
String projectId = request.getParameter("projectId");
|
||||
Map<String, String> xmlMap = allinpayService.allinPaySendMessages(projectId);
|
||||
String phoneNumber = xmlMap.get("phoneNumber");
|
||||
String subjectid = xmlMap.get("subjectid");
|
||||
factory = new AllinpayProperties(subjectid);
|
||||
|
||||
Map<String, String> map = factory.allinPaySendMessages(xmlMap);
|
||||
|
||||
@ -113,6 +114,8 @@ public class AllinpayServlet extends BaseServlet {
|
||||
String projectId = request.getParameter("projectId");
|
||||
Map<String, String> messageMap = allinpayService.allinPaySigning(projectId);
|
||||
String phoneNumber = messageMap.get("phoneNumber");
|
||||
String subjectid = messageMap.get("subjectid");
|
||||
factory = new AllinpayProperties(subjectid);
|
||||
String time = DateAssistant.getTodayNow();
|
||||
|
||||
Cookie[] cookies = request.getCookies();
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
package com.tenwa.lease.app.allinpay.util;
|
||||
|
||||
import java.security.Provider;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.allinpay.util.AIPGSignature;
|
||||
import com.allinpay.util.DemoUtil;
|
||||
import com.allinpay.util.HttpUtil;
|
||||
import com.allinpay.xml.XmlParser;
|
||||
@ -20,10 +16,45 @@ import com.allinpay.xstruct.quickpay.FAGRCEXT;
|
||||
import com.allinpay.xstruct.quickpay.FASTTRX;
|
||||
import com.allinpay.xstruct.stdagr.QAGRINFO;
|
||||
import com.allinpay.xstruct.trans.qry.TransQueryReq;
|
||||
import com.tenwa.util.MultiSubjectUtil;
|
||||
|
||||
public class AllinpayProperties {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AllinpayProperties.class);
|
||||
|
||||
private String allinPayMerchantId;
|
||||
|
||||
private String allinPayUsername;
|
||||
|
||||
private String allinPayUserpass;
|
||||
|
||||
private String allinPayPfxpass;
|
||||
|
||||
private String allinPayPathpfx;
|
||||
|
||||
private String allinBusinessCode;
|
||||
|
||||
private String allinPayUrl;
|
||||
|
||||
public AllinpayProperties(String channel) {
|
||||
logger.info("通联链接渠道:"+channel);
|
||||
if(channel.equals(MultiSubjectUtil.SZSUBJECTID)) {
|
||||
this.allinPayMerchantId=ConfigConstant.SZ_allinPayMerchantId;
|
||||
this.allinPayUsername=ConfigConstant.SZ_allinPayUsername;
|
||||
this.allinPayUserpass=ConfigConstant.SZ_allinPayUserpass;
|
||||
this.allinPayPfxpass=ConfigConstant.SZ_allinPayPfxpass;
|
||||
this.allinPayPathpfx=ConfigConstant.SZ_allinPayPathpfx;
|
||||
this.allinBusinessCode=ConfigConstant.SZ_allinBusinessCode;
|
||||
}else if(channel.equals(MultiSubjectUtil.TJSUBJECTID)) {
|
||||
this.allinPayMerchantId=ConfigConstant.TJ_allinPayMerchantId;
|
||||
this.allinPayUsername=ConfigConstant.TJ_allinPayUsername;
|
||||
this.allinPayUserpass=ConfigConstant.TJ_allinPayUserpass;
|
||||
this.allinPayPfxpass=ConfigConstant.TJ_allinPayPfxpass;
|
||||
this.allinPayPathpfx=ConfigConstant.TJ_allinPayPathpfx;
|
||||
this.allinBusinessCode=ConfigConstant.TJ_allinBusinessCode;
|
||||
}
|
||||
this.allinPayUrl=ConfigConstant.allinPayUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通联卡扣签约
|
||||
@ -36,20 +67,20 @@ public class AllinpayProperties {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
try {
|
||||
InfoReq infoReq = DemoUtil.makeReq("310002", ConfigConstant.allinPayMerchantId, ConfigConstant.allinPayUsername, ConfigConstant.allinPayUserpass);
|
||||
InfoReq infoReq = DemoUtil.makeReq("310002", allinPayMerchantId, allinPayUsername, allinPayUserpass);
|
||||
|
||||
FAGRCEXT fagrcext = new FAGRCEXT();
|
||||
fagrcext.setSRCREQSN(mapXml.get("reqSn"));
|
||||
fagrcext.setVERCODE(mapXml.get("verCode"));
|
||||
|
||||
fagrcext.setMERCHANT_ID(ConfigConstant.allinPayMerchantId);
|
||||
fagrcext.setMERCHANT_ID(allinPayMerchantId);
|
||||
AipgReq aipgReq = new AipgReq();
|
||||
aipgReq.setINFO(infoReq);
|
||||
aipgReq.addTrx(fagrcext);
|
||||
String xml = XmlParser.toXml(aipgReq);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
String url = ConfigConstant.allinPayUrl + "?MERCHANT_ID=" + ConfigConstant.allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + allinPayPathpfx, allinPayPfxpass);
|
||||
String url = allinPayUrl + "?MERCHANT_ID=" + allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String requestContent = signedXml + url;
|
||||
map.put("request", requestContent);
|
||||
logger.info("通联请求>>>>>>>>>>>" + signedXml);
|
||||
@ -79,7 +110,7 @@ public class AllinpayProperties {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
try {
|
||||
InfoReq infoReq = DemoUtil.makeReq("310001", ConfigConstant.allinPayMerchantId, ConfigConstant.allinPayUsername, ConfigConstant.allinPayUserpass);
|
||||
InfoReq infoReq = DemoUtil.makeReq("310001", allinPayMerchantId, allinPayUsername, allinPayUserpass);
|
||||
|
||||
FAGRA fagra = new FAGRA();
|
||||
fagra.setACCOUNT_NAME(mapXml.get("userName"));
|
||||
@ -90,14 +121,14 @@ public class AllinpayProperties {
|
||||
fagra.setID_TYPE("0");
|
||||
fagra.setACCOUNT_TYPE("00");
|
||||
|
||||
fagra.setMERCHANT_ID(ConfigConstant.allinPayMerchantId);
|
||||
fagra.setMERCHANT_ID(allinPayMerchantId);
|
||||
AipgReq aipgReq = new AipgReq();
|
||||
aipgReq.setINFO(infoReq);
|
||||
aipgReq.addTrx(fagra);
|
||||
String xml = XmlParser.toXml(aipgReq);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
String url = ConfigConstant.allinPayUrl + "?MERCHANT_ID=" + ConfigConstant.allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + allinPayPathpfx, allinPayPfxpass);
|
||||
String url = allinPayUrl + "?MERCHANT_ID=" + allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String requestContent = signedXml + url;
|
||||
map.put("request", requestContent);
|
||||
logger.info("通联请求>>>>>>>>>>>" + signedXml);
|
||||
@ -127,11 +158,11 @@ public class AllinpayProperties {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
try {
|
||||
InfoReq infoReq = DemoUtil.makeReq("340009", ConfigConstant.allinPayMerchantId, ConfigConstant.allinPayUsername, ConfigConstant.allinPayUserpass);
|
||||
InfoReq infoReq = DemoUtil.makeReq("340009", allinPayMerchantId, allinPayUsername, allinPayUserpass);
|
||||
|
||||
QAGRINFO qagrInfo = new QAGRINFO();
|
||||
qagrInfo.setACCOUNT_NO(mapXml.get("accountNo"));
|
||||
qagrInfo.setMERCHANT_ID(ConfigConstant.allinPayMerchantId);
|
||||
qagrInfo.setMERCHANT_ID(allinPayMerchantId);
|
||||
qagrInfo.setAGRTYPE("01");
|
||||
qagrInfo.setQUERY_MODE("3");
|
||||
|
||||
@ -140,8 +171,8 @@ public class AllinpayProperties {
|
||||
aipgReq.addTrx(qagrInfo);
|
||||
String xml = XmlParser.toXml(aipgReq);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
String url = ConfigConstant.allinPayUrl + "?MERCHANT_ID=" + ConfigConstant.allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + allinPayPathpfx, allinPayPfxpass);
|
||||
String url = allinPayUrl + "?MERCHANT_ID=" + allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String requestContent = signedXml + url;
|
||||
map.put("request", requestContent);
|
||||
logger.info("通联请求>>>>>>>>>>>" + signedXml);
|
||||
@ -170,11 +201,11 @@ public class AllinpayProperties {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
try {
|
||||
InfoReq infoReq = DemoUtil.makeReq("310011", ConfigConstant.allinPayMerchantId, ConfigConstant.allinPayUsername, ConfigConstant.allinPayUserpass);
|
||||
InfoReq infoReq = DemoUtil.makeReq("310011", allinPayMerchantId, allinPayUsername, allinPayUserpass);
|
||||
|
||||
FASTTRX ft = new FASTTRX();
|
||||
ft.setMERCHANT_ID(ConfigConstant.allinPayMerchantId);
|
||||
ft.setBUSINESS_CODE(ConfigConstant.allinBusinessCode);// 测试为19900 正是环境为10702
|
||||
ft.setMERCHANT_ID(allinPayMerchantId);
|
||||
ft.setBUSINESS_CODE(allinBusinessCode);// 测试为19900 正是环境为10702
|
||||
ft.setSUBMIT_TIME(DemoUtil.getNow());
|
||||
ft.setAGRMNO(mapXml.get("AGRMNO").toString());//支付协议号
|
||||
ft.setACCOUNT_NAME(mapXml.get("ACCOUNT_NAME"));//账户姓名
|
||||
@ -187,8 +218,8 @@ public class AllinpayProperties {
|
||||
aipgReq.addTrx(ft);
|
||||
String xml = XmlParser.toXml(aipgReq);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
String url = ConfigConstant.allinPayUrl + "?MERCHANT_ID=" + ConfigConstant.allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + allinPayPathpfx, allinPayPfxpass);
|
||||
String url = allinPayUrl + "?MERCHANT_ID=" + allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String requestContent = signedXml + url;
|
||||
map.put("request", requestContent);
|
||||
String reqSn = infoReq.getREQ_SN();
|
||||
@ -219,19 +250,19 @@ public class AllinpayProperties {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
try {
|
||||
InfoReq infoReq = DemoUtil.makeReq("200004", ConfigConstant.allinPayMerchantId, ConfigConstant.allinPayUsername, ConfigConstant.allinPayUserpass);
|
||||
InfoReq infoReq = DemoUtil.makeReq("200004", allinPayMerchantId, allinPayUsername, allinPayUserpass);
|
||||
|
||||
TransQueryReq queryReq = new TransQueryReq();
|
||||
queryReq.setQUERY_SN(mapXml.get("quertSn"));//支付时的流水
|
||||
queryReq.setMERCHANT_ID(ConfigConstant.allinPayMerchantId);
|
||||
queryReq.setMERCHANT_ID(allinPayMerchantId);
|
||||
|
||||
AipgReq aipgReq = new AipgReq();
|
||||
aipgReq.setINFO(infoReq);
|
||||
aipgReq.addTrx(queryReq);
|
||||
String xml = XmlParser.toXml(aipgReq);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
String url = ConfigConstant.allinPayUrl + "?MERCHANT_ID=" + ConfigConstant.allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String signedXml = DemoUtil.buildSignedXml(xml, path + allinPayPathpfx, allinPayPfxpass);
|
||||
String url = allinPayUrl + "?MERCHANT_ID=" + allinPayMerchantId + "&REQ_SN=" + infoReq.getREQ_SN();
|
||||
String requestContent = signedXml + url;
|
||||
map.put("request", requestContent);
|
||||
logger.info("通联请求>>>>>>>>>>>" + signedXml);
|
||||
@ -249,40 +280,4 @@ public class AllinpayProperties {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通联卡扣对账文件下载
|
||||
*
|
||||
* @param settday需要查询的日期,格式20180911,只能查询40天之内的数据
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> allinReconciliationFileDownload(String settday) {
|
||||
logger.info("开始调用通联卡扣简单对账接口");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("message", "error");
|
||||
Provider prvd = null;
|
||||
String url = ConfigConstant.allinUrlFileGet;
|
||||
String reqtime = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||
String contfee = "1";
|
||||
String sign = "";
|
||||
contfee = settday + "|" + reqtime + "|" + ConfigConstant.allinPayMerchantId;
|
||||
String fileSt = "";
|
||||
try {
|
||||
AIPGSignature signature = new AIPGSignature(prvd);
|
||||
String path = Thread.currentThread().getContextClassLoader().getResource("/").getPath();
|
||||
sign = signature.signMsg(contfee, path + ConfigConstant.allinPayPathpfx, ConfigConstant.allinPayPfxpass);
|
||||
url = url.replaceAll("@xxx", settday).replaceAll("@yyy", reqtime).replaceAll("@zzz", ConfigConstant.allinPayMerchantId)
|
||||
.replaceAll("@sss", sign);
|
||||
logger.info("通联请求地址>>>>>>>>>>>" + url);
|
||||
fileSt = HttpUtil.post("", url);
|
||||
map.put("msg",fileSt);
|
||||
map.put("message","success");
|
||||
} catch (Exception e) {
|
||||
logger.error("调用通联卡扣简单对账接口失败,系统异常或通联反馈异常:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
map.put("msg", e.getMessage());
|
||||
return map;
|
||||
}
|
||||
logger.info("结束调用通联卡扣简单对账接口");
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,35 +11,52 @@ public class ConfigConstant {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ConfigConstant.class);
|
||||
|
||||
// 通联商户号
|
||||
public final static String allinPayMerchantId;
|
||||
public final static String SZ_allinPayMerchantId;
|
||||
|
||||
// 通联用户名
|
||||
public final static String allinPayUsername;
|
||||
public final static String SZ_allinPayUsername;
|
||||
|
||||
// 通联用户密码
|
||||
public final static String allinPayUserpass;
|
||||
public final static String SZ_allinPayUserpass;
|
||||
|
||||
// 通联私钥密码
|
||||
public final static String allinPayPfxpass;
|
||||
public final static String SZ_allinPayPfxpass;
|
||||
|
||||
// 通联公钥
|
||||
public final static String allinPayPathcer;
|
||||
public final static String SZ_allinPayPathcer;
|
||||
|
||||
// 通联商户私钥路径
|
||||
public final static String allinPayPathpfx;
|
||||
public final static String SZ_allinPayPathpfx;
|
||||
|
||||
// 通联收款类业务代码
|
||||
public final static String SZ_allinBusinessCode;
|
||||
|
||||
|
||||
// 通联商户号
|
||||
public final static String TJ_allinPayMerchantId;
|
||||
|
||||
// 通联用户名
|
||||
public final static String TJ_allinPayUsername;
|
||||
|
||||
// 通联用户密码
|
||||
public final static String TJ_allinPayUserpass;
|
||||
|
||||
// 通联私钥密码
|
||||
public final static String TJ_allinPayPfxpass;
|
||||
|
||||
// 通联公钥
|
||||
public final static String TJ_allinPayPathcer;
|
||||
|
||||
// 通联商户私钥路径
|
||||
public final static String TJ_allinPayPathpfx;
|
||||
|
||||
// 通联收款类业务代码
|
||||
public final static String TJ_allinBusinessCode;
|
||||
|
||||
|
||||
// 通联测试接口地址
|
||||
public final static String allinPayUrl;
|
||||
|
||||
// 通联对账文件的接口地址
|
||||
public final static String allinUrlFileGet;
|
||||
|
||||
// 通联收款类业务代码
|
||||
public final static String allinBusinessCode;
|
||||
|
||||
//用户点击url
|
||||
public final static String sendMessageUrl;
|
||||
|
||||
//用户点击url
|
||||
public final static String filePath;
|
||||
|
||||
@ -51,16 +68,23 @@ public class ConfigConstant {
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.info("通联配置文件加载:" + prop.toString());
|
||||
allinPayMerchantId = prop.getProperty("allinPayMerchantId");
|
||||
allinPayUsername = prop.getProperty("allinPayUsername");
|
||||
allinPayUserpass = prop.getProperty("allinPayUserpass");
|
||||
allinPayPfxpass = prop.getProperty("allinPayPfxpass");
|
||||
allinPayPathcer = prop.getProperty("allinPayPathcer");
|
||||
allinPayPathpfx = prop.getProperty("allinPayPathpfx");
|
||||
SZ_allinPayMerchantId = prop.getProperty("SZ_allinPayMerchantId");
|
||||
SZ_allinPayUsername = prop.getProperty("SZ_allinPayUsername");
|
||||
SZ_allinPayUserpass = prop.getProperty("SZ_allinPayUserpass");
|
||||
SZ_allinPayPfxpass = prop.getProperty("SZ_allinPayPfxpass");
|
||||
SZ_allinPayPathcer = prop.getProperty("SZ_allinPayPathcer");
|
||||
SZ_allinPayPathpfx = prop.getProperty("SZ_allinPayPathpfx");
|
||||
SZ_allinBusinessCode = prop.getProperty("SZ_allinBusinessCode");
|
||||
|
||||
TJ_allinPayMerchantId = prop.getProperty("TJ_allinPayMerchantId");
|
||||
TJ_allinPayUsername = prop.getProperty("TJ_allinPayUsername");
|
||||
TJ_allinPayUserpass = prop.getProperty("TJ_allinPayUserpass");
|
||||
TJ_allinPayPfxpass = prop.getProperty("TJ_allinPayPfxpass");
|
||||
TJ_allinPayPathcer = prop.getProperty("TJ_allinPayPathcer");
|
||||
TJ_allinPayPathpfx = prop.getProperty("TJ_allinPayPathpfx");
|
||||
TJ_allinBusinessCode = prop.getProperty("TJ_allinBusinessCode");
|
||||
|
||||
allinPayUrl = prop.getProperty("allinPayUrl");
|
||||
allinUrlFileGet = prop.getProperty("allinUrlFileGet");
|
||||
allinBusinessCode = prop.getProperty("allinBusinessCode");
|
||||
sendMessageUrl = prop.getProperty("sendMessageUrl");
|
||||
filePath = prop.getProperty("filePath");
|
||||
}
|
||||
|
||||
|
||||
@ -18,9 +18,9 @@ public interface LC_CARD_PAYMENT{
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* ºÏͬºÅ STRING(20)<br>
|
||||
* ÏîÄ¿ID STRING(20)<br>
|
||||
*/
|
||||
public static final String CONTRACT_NUMBER = "CONTRACT_NUMBER";
|
||||
public static final String PROJECT_ID = "PROJECT_ID";
|
||||
/**
|
||||
* ¿Û¿î״̬ STRING(20)<br>
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user