資源簡介
包括 asp.net接口包、java接口包、php接口包、各種語言接口的demo,對于web及app 支付開發有幫助。
代碼片段和文件信息
import?java.io.File;
import?java.io.FileInputStream;
import?java.io.FileNotFoundException;
import?java.io.IOException;
import?java.util.ArrayList;
import?com.abc.pay.client.CertHelper;
import?com.abc.pay.client.Constants;
import?com.abc.pay.client.FileUtil;
import?com.abc.pay.client.MerchantPara;
import?com.abc.pay.client.MerchantParaFactory;
import?com.abc.pay.client.MerchantParaWeb;
import?com.abc.pay.client.TrxException;
/**
?*?具體工廠-客運工廠,從數據庫中讀取配置
?*?生產兩種產品:MerchantParaWeb和
?*/
public?class?MerchantParaFromDB?extends?MerchantParaFactory?{
????/**
?????*?商戶端配置文件資源對象
?????*/
????private?static?MerchantPara?paraWeb?=?null;
???
????/**
?????*?初始旗標
?????*/
????private?static?boolean?iIsInitialedWeb?=?false;
public?void?refreshConfig()?throws?TrxException?{
iIsInitialedWeb?=?false;
}
public?void?init(MerchantPara?para){
try?{
//##網上支付平臺系統配置段?-?生產環境?-?請勿更改?
//#網上支付平臺通訊方式(http?/?https)
//公網
para.setTrustPayConnectMethod(“https“);
//專線
para.setTrustPayConnectMethodLine(“https“);
//#網上支付平臺服務器名
//公網
para.setTrustPayServerName(“pay.abchina.com“);
//專線
para.setTrustPayServerNameLine(“pay.abchina.com“);
????//#網上支付平臺交易端口
//公網
para.setTrustPayServerPort(“443“);
//專線
para.setTrustPayServerPortLine(“443“);
//#網上支付平臺交易網址
para.setTrustPayTrxURL(“/ReceiveMerchantTrxReqServlet“);
para.setTrustPayTrxIEURL(“https://pay.abchina.com/ebus/ReceiveMerchantIERequestServlet“);
//#頁面提交支付請求失敗后的轉向地址
para.setMerchantErrorURL(“http://127.0.0.1:8080/ebusnewupdate/Merchant.html“);
//##網上支付平臺系統配置段?-?生產環境?-?更改證書存放路徑,使其和本地存放路徑相匹配(絕對路徑)
//#網上支付平臺證書
para.setTrustPayCertFileName(“D:/cert/TrustPay.cer“);
//#農行根證書文件
para.setTrustStoreFileName(“D:/cert/abc.truststore“);
//#農行根證書文件密碼
para.setTrustStorePassword(“changeit“);
//設置商戶編號。如果是多商戶則在iMerchantIDList放置多條記錄
ArrayList?iMerchantIDList?=?new?ArrayList();
iMerchantIDList.add(“103881104410001“);
??????para.setMerchantIDList(iMerchantIDList);???????????
??????FileUtil?util?=?new?FileUtil();
????????????
//設置商戶證書。如果是多商戶則在iMerchantCertNameList放置多條記錄。注意:商戶證書名稱順序要與商戶編號順序一致
ArrayList?iMerchantCertList?=?new?ArrayList();
iMerchantCertList.add(util.readFile(“D:/cert/103881104410001.pfx“));
para.setMerchantCertFileList(iMerchantCertList);
????????????
??????//設置商戶證書密碼。如果是多商戶則在iMerchantPasswordList放置多條記錄。注意:密碼順序要與商戶編號順序一致
ArrayList?iMerchantPasswordList?=?new?ArrayList();
iMerchantPasswordList.add(“11111111“);//?商戶私鑰密碼
para.setMerchantCertPasswordList(iMerchantPasswordList);
//#交易日志文件存放目錄
para.setLogPath(“D:/workspace/ebusnewupdate/log“);
//#證書儲存媒體
para.setMerchantKeyStoreType(“0“);
//一般商戶都選用文件證書
??????if?(para.getMerchantKeyStoreType().equals(MerchantPara.KEY_STORE_TYPE_FILE))?{
??????????CertHelper.bindMerchantCertificate(para?i
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-03-28?10:27??ABCPayInterface\
?????文件??????321438??2017-03-06?10:30??ABCPayInterface\ASP.NET接口包.zip
?????文件?????1378493??2017-03-06?10:30??ABCPayInterface\ASP.NET接口說明文檔.zip
?????文件??????205338??2017-03-06?10:30??ABCPayInterface\PHP接口包.zip
?????文件?????1427344??2017-03-06?10:30??ABCPayInterface\PHP接口說明文檔.zip
?????目錄???????????0??2017-03-28?10:34??ABCPayInterface\TrustPayClient-Java-V3.1.1\
?????目錄???????????0??2017-03-06?15:12??ABCPayInterface\TrustPayClient-Java-V3.1.1\ABCIcon\
?????文件???????59239??2009-06-17?13:53??ABCPayInterface\TrustPayClient-Java-V3.1.1\ABCIcon\abcicon1.jpg
?????文件???????43840??2009-06-17?13:53??ABCPayInterface\TrustPayClient-Java-V3.1.1\ABCIcon\abcicon2.jpg
?????文件???????57971??2009-06-17?13:53??ABCPayInterface\TrustPayClient-Java-V3.1.1\ABCIcon\abcicon3.jpg
?????文件???????11480??2017-03-28?10:32??ABCPayInterface\TrustPayClient-Java-V3.1.1\ABC接口證書.zip
?????目錄???????????0??2017-06-15?15:35??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\
?????文件???????10736??2017-03-14?17:05??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170314.log
?????文件???????49585??2017-03-15?16:54??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170315.log
?????文件???????18675??2017-03-16?15:59??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170316.log
?????文件???????13595??2017-03-20?14:21??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170320.log
?????文件???????72809??2017-03-24?14:57??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170324.log
?????文件??????186270??2017-03-27?16:45??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170327.log
?????文件???????23271??2017-03-29?15:36??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170328.log
?????文件????????7654??2017-03-29?15:44??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170329.log
?????文件????????3825??2017-03-30?13:21??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170330.log
?????文件???????15209??2017-04-01?13:03??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170401.log
?????文件???????15298??2017-04-06?15:31??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170406.log
?????文件???????41566??2017-04-12?15:45??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170412.log
?????文件???????34736??2017-06-15?16:38??ABCPayInterface\TrustPayClient-Java-V3.1.1\Log\TrxLog.20170615.log
?????目錄???????????0??2017-03-28?10:31??ABCPayInterface\TrustPayClient-Java-V3.1.1\cert\
?????文件????????2012??2017-03-27?08:50??ABCPayInterface\TrustPayClient-Java-V3.1.1\cert\SHFWQZH.pfx
?????文件??????????49??2017-03-28?10:30??ABCPayInterface\TrustPayClient-Java-V3.1.1\cert\SHFWQZH.txt
?????文件?????????565??2006-02-14?16:43??ABCPayInterface\TrustPayClient-Java-V3.1.1\cert\TrustPay.cer
?????文件???????15250??2014-04-30?08:56??ABCPayInterface\TrustPayClient-Java-V3.1.1\cert\abc.truststore
?????目錄???????????0??2017-03-06?15:12??ABCPayInterface\TrustPayClient-Java-V3.1.1\demo\
............此處省略90個文件信息
評論
共有 條評論