一、背景:地产行业获取银行流水跟应付单进行对账
二、农行接口对接参考文档:https://bank.u51.com/ebus-two/docs/#/
三、版本:TrustPayClient-V3.3.0.jar
四、调用接口:
1、银行交易流水明细查询
2、统一单笔查询(根据1返回的订单编号,查询订单的详细信息)
五、调用方式:使用quartz定时任务的形式
···························································分隔符···························································
1、引入jar包,包是私有的
<dependency> <groupId>com.abc.ebusclient</groupId> <artifactId>ebusclient</artifactId> <version>V3.3.0</version> <scope>system</scope> <systemPath>${project.basedir}/lib/TrustPayClient-V3.3.0.jar</systemPath> </dependency>
2、两项配置文件
ConfigSource.properties
TrustMerchant.properties
配置文件放的位置,resource,此配置需要在pom.xml中进行注明
3、pom.xml读取resource位置
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <configuration> <attach>true</attach> </configuration> <executions> <execution> <phase>compile</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> <resources> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>
4、ConfigSource.properties 配置文件内容
# 配置读取的方式: # 1、database 同时下方的ConfigSourceClass需指定数据库读取的类 # 2、数据库;file 读取的文件:TrustMerchant.properties # 注意,ConfigSource.properties和TrustMerchant.properties文件名称不可改变 ConfigSourceMethod=database ConfigSourceClass=com.lelern.quartz.task.MerchantParaFromDB
5、TrustMerchant.properties 配置文件内容
# 配置无需改动 前提是版本TrustPayClient-V3.3.0.jar; 如果版本3.1.X配置会有不同 TrustPayConnectMethod = https TrustPayServerName = pay.abchina.com TrustPayServerPort = 443 TrustPayNewLine = 2 TrustPayTrxURL = /ebus/ReceiveMerchantTrxReqServlet TrustPayFileTrxURL = /ebussettle/ReceiveMerchantFileTrxReqServlet TrustPayIETrxURL = https://pay.abchina.com/ebus/ReceiveMerchantIERequestServlet MerchantErrorURL = https://pay.abchina.com/ebus/MerchantIEFailure.aspx # 网上支付平台证书 TrustPayCertFile=C:/cert/TrustPay.cer # 农行根证书文件 TrustStoreFile=C:/cert/abc.truststore # 下方配置可根据各自系统的商户信息配置 # 商户编号 # 如果单一商户,即MerchantID=103881XXXXXXX # 如果多商户 MerchantID=103881XXXXXXX,10388192XXXXXXX 使用,号分割 MerchantID=103881XXXXXXX,10388192XXXXXXX # 日志是否开启 PrintLog=true # 商户接口包日志 LogPath=C:/cert/log # 商户私钥 # 配置跟上方商户编号配置方式一致 # 注意:私钥放的顺序需要跟上方商户编号顺序一致 # 即:103881XXXXXXX为商户1,C:/cert/111111.pfx为商户1的密钥,以此类推 MerchantCertFile=C:/cert/111111.pfx,C:/cert/222222.pfx # 商户私钥密码 # 配置跟上方商户编号和商户私钥配置方式一致 # 注意:私钥密码