diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d04fb2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,112 @@ +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. + .idea/artifacts + .idea/compiler.xml + .idea/jarRepositories.xml + .idea/modules.xml + .idea/*.iml + .idea/modules + *.iml + *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Maven template +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +/ECPayAIO_Java.iml diff --git a/README.md b/README.md index a165f47..31f4410 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,54 @@ -# 綠界 全方位(All In One)金流介接Java版 ---- - -## 1. 介紹 - - - 綠界對於有收款需求的會員,提供完整的交易介接API,並有多種收款方式(All In One)可選擇使用。 本套件為Java版,可使用作建立訂單,接受付款通知,查詢訂單等金流交易的應用。 - - 收款方式清單: - - 信用卡(一次付清、分期付款、定期定額) - - 網路ATM - - ATM櫃員機 - - 超商代碼 - - Apple Pay - - Google Pay (須特別申請才能使用)(原Android Pay) - - -## 2. 安裝環境 - - _jdk 1.6以上_ - - SDK元件限制在伺服器上使用,嚴禁使用於手機環境,已避免商家金鑰資訊外流 - - -## 3. 使用教學 - - 使用者文件放置於Doc資料夾內,可供參閱 - - -## 4. 聯絡我們 - - 綠界技術服務工程師信箱: techsupport@ecpay.com.tw - -## 5.版權宣告 - -* License: GPLv2 or later -* License URI: https://www.gnu.org/licenses/gpl-2.0.html - - -[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax) +# 綠界 全方位(All In One)金流介接Java版 +--- + +## 1. 介紹 + - 綠界對於有收款需求的會員,提供完整的交易介接API,並有多種收款方式(All In One)可選擇使用。 本套件為Java版,可使用作建立訂單,接受付款通知,查詢訂單等金流交易的應用。 + - 收款方式清單: + - 信用卡(一次付清、分期付款、定期定額) + - 網路ATM + - ATM櫃員機 + - 超商代碼 + - Apple Pay + - Google Pay (須特別申請才能使用)(原Android Pay) + + +## 2. 安裝環境 + - _jdk 1.6以上_ + - SDK元件限制在伺服器上使用,嚴禁使用於手機環境,已避免商家金鑰資訊外流 + + +## 3. 使用教學 + - 使用者文件放置於Doc資料夾內,可供參閱 + - 範例放在example資料夾,可供參閱 + - JavaDoc 在建置完成後將出現在target資料夾 (ECPayAIO_Java--javadoc.jar),解除壓縮後並打開index.html,就會有完整的JavaDoc (Parameters, Examples WIP) + + +## 4. Maven 使用 +目前並未放在任何Maven Repository,必須自行建置,其指令如下,這將會建置並安裝到你的Local Maven Repository (~/.m2/repository) (照理來說能夠在Windows, MacOS和Linux運作,但是需要安裝Git和Maven): +```shell +git clone https://github.com/ECPay/ECPayAIO_Java.git +cd ECPayAIO_Java +mvn clean package install +``` +使用方法:
+```xml + + + tw.com.ecpay + ECPayAIO_Java + 版本 (請見pom.xml) + compile + + + +``` + + +## 5. 聯絡我們 + - 綠界技術服務工程師信箱: techsupport@ecpay.com.tw + +## 6.版權宣告 +* License: GPLv2 or later +* License URI: https://www.gnu.org/licenses/gpl-2.0.html + + diff --git a/jars/javax.servlet-3.0.0.v201112011016.jar b/jars/javax.servlet-3.0.0.v201112011016.jar deleted file mode 100644 index b135409..0000000 Binary files a/jars/javax.servlet-3.0.0.v201112011016.jar and /dev/null differ diff --git a/jars/log4j.jar b/jars/log4j.jar deleted file mode 100644 index 6251307..0000000 Binary files a/jars/log4j.jar and /dev/null differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c37d799 --- /dev/null +++ b/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + tw.com.ecpay + ECPayAIO_Java + 2.0.1 + + + 8 + 8 + + + + + log4j + log4j + 1.2.17 + compile + + + + javax.servlet + javax.servlet-api + 4.0.1 + compile + + + + + + + org.apache.maven.plugins + maven-install-plugin + 3.0.0-M1 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + package + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.0 + + + package + + jar + + + + + + + + \ No newline at end of file diff --git a/ecpay/payment/integration/AllInOne.java b/src/main/java/ecpay/payment/integration/AllInOne.java similarity index 97% rename from ecpay/payment/integration/AllInOne.java rename to src/main/java/ecpay/payment/integration/AllInOne.java index 55d7cd6..1973486 100644 --- a/ecpay/payment/integration/AllInOne.java +++ b/src/main/java/ecpay/payment/integration/AllInOne.java @@ -71,8 +71,6 @@ public AllInOne(String log4jPropertiesPath){ /** * 檢查Hashtable中的檢查碼是否正確(確保資料未被竄改) - * @param Hashtable params - * @return boolean */ public boolean compareCheckMacValue(Hashtable params){ String checkMacValue = ""; @@ -93,8 +91,6 @@ public boolean compareCheckMacValue(Hashtable params){ /** * Apple Pay信用卡授權作業 - * @param CreateServerOrderobj - * @return */ public String createServerOrder(CreateServerOrderObj obj){ obj.setPlatformID(PlatformID); @@ -130,8 +126,6 @@ public String createServerOrder(CreateServerOrderObj obj){ /** * 下載信用卡撥款對帳資料檔的方法 - * @param fundingReconDetailObj - * @return response string */ public String fundingReconDetail(FundingReconDetailObj fundingReconDetailObj){ fundingReconDetailObj.setMerchantID(MerchantID); @@ -185,8 +179,6 @@ public String fundingReconDetail(FundingReconDetailObj fundingReconDetailObj){ /** * 查詢信用卡單筆明細記錄的方法 - * @param queryTradeObj - * @return response string */ public String queryTrade(QueryTradeObj queryTradeObj){ queryTradeObj.setMerchantID(MerchantID); @@ -212,8 +204,6 @@ public String queryTrade(QueryTradeObj queryTradeObj){ /** * 下載會員對帳媒體檔的方法 - * @param tradeNoAioObj - * @return response string */ public String tradeNoAio(TradeNoAioObj tradeNoAioObj){ tradeNoAioObj.setMerchantID(MerchantID); @@ -260,8 +250,6 @@ public String tradeNoAio(TradeNoAioObj tradeNoAioObj){ /** * 信用卡關帳/退刷/取消/放棄的方法 - * @param doActionObj - * @return response string */ public String doAction(DoActionObj doActionObj){ doActionObj.setPlatformID(PlatformID); @@ -292,8 +280,6 @@ public String doAction(DoActionObj doActionObj){ /** * 查詢訂單資料的方法 - * @param queryTradeInfoObj - * @return response string */ public String queryTradeInfo(QueryTradeInfoObj queryTradeInfoObj){ queryTradeInfoObj.setPlatformID(PlatformID); @@ -325,7 +311,6 @@ public String queryTradeInfo(QueryTradeInfoObj queryTradeInfoObj){ /** * 信用卡定期定額訂單查詢 - * @param queryCreditCardPeriodInfoObj * @return response JSON string */ public String queryCreditCardPeriodInfo(QueryCreditCardPeriodInfoObj queryCreditCardPeriodInfoObj) { @@ -353,9 +338,6 @@ public String queryCreditCardPeriodInfo(QueryCreditCardPeriodInfoObj queryCredit /** * 產生訂單Html form的方法 - * @param aioCheckOutObj - * @param invoice - * @param String */ public String aioCheckOut(Object obj, InvoiceObj invoice){ StringBuilder out = new StringBuilder(); @@ -475,8 +457,6 @@ public String aioCheckOut(Object obj, InvoiceObj invoice){ /** * ATM、CVS或BARCODE的取號結果通知方法。接收傳送至PaymentInfoURL的資料。回傳物件分為ATMRequestObj, CVSOrBARCODERequestObj二種,請用適當的物件承接以免出錯 - * @param req - * @return obj */ public Object aioCheckOutFeedback(HttpServletRequest req){ List parameterNames = new ArrayList(req.getParameterMap().keySet()); @@ -485,7 +465,7 @@ public Object aioCheckOutFeedback(HttpServletRequest req){ for(String name: parameterNames){ Method method; try { - method = obj.getClass().getMethod("set"+name, null); + method = obj.getClass().getMethod("set"+name, String.class); method.invoke(obj, req.getParameter(name)); } catch(Exception e){ throw new EcpayException(ErrorMessage.OBJ_MISSING_FIELD); @@ -504,7 +484,7 @@ public Object aioCheckOutFeedback(HttpServletRequest req){ for(String name: parameterNames){ Method method; try { - method = obj.getClass().getMethod("set"+name, null); + method = obj.getClass().getMethod("set"+name, String.class); method.invoke(obj, req.getParameter(name)); } catch(Exception e){ throw new EcpayException(ErrorMessage.OBJ_MISSING_FIELD); @@ -523,9 +503,6 @@ public Object aioCheckOutFeedback(HttpServletRequest req){ /** * 產生HTML code - * @param aio object - * @param invoice obj - * @return string */ private String genCheckOutHtmlCode(Object aio, InvoiceObj invoice){ StringBuilder builder = new StringBuilder(); diff --git a/ecpay/payment/integration/AllInOneBase.java b/src/main/java/ecpay/payment/integration/AllInOneBase.java similarity index 100% rename from ecpay/payment/integration/AllInOneBase.java rename to src/main/java/ecpay/payment/integration/AllInOneBase.java diff --git a/ecpay/payment/integration/config/EcpayConfig.java b/src/main/java/ecpay/payment/integration/config/EcpayConfig.java similarity index 100% rename from ecpay/payment/integration/config/EcpayConfig.java rename to src/main/java/ecpay/payment/integration/config/EcpayConfig.java diff --git a/ecpay/payment/integration/domain/ATMRequestObj.java b/src/main/java/ecpay/payment/integration/domain/ATMRequestObj.java similarity index 88% rename from ecpay/payment/integration/domain/ATMRequestObj.java rename to src/main/java/ecpay/payment/integration/domain/ATMRequestObj.java index 27cd5db..f92d92c 100644 --- a/ecpay/payment/integration/domain/ATMRequestObj.java +++ b/src/main/java/ecpay/payment/integration/domain/ATMRequestObj.java @@ -125,266 +125,228 @@ public class ATMRequestObj { /** * 取得MerchantID 合作特店編號 - * @return MerchantID */ public String getMerchantID() { return MerchantID; } /** * 設定MerchantID 合作特店編號 - * @param merchantID */ public void setMerchantID(String merchantID) { MerchantID = merchantID; } /** * 取得MerchantTradeNo 合作特店交易編號 - * @return MerchantTradeNo */ public String getMerchantTradeNo() { return MerchantTradeNo; } /** * 設定MerchantTradeNo 合作特店交易編號 - * @param MerchantTradeNo */ public void setMerchantTradeNo(String merchantTradeNo) { MerchantTradeNo = merchantTradeNo; } /** * 取得RtnCode 交易狀態 - * @return RtnCode */ public String getRtnCode() { return RtnCode; } /** * 設定RtnCode 交易狀態 - * @param RtnCode */ public void setRtnCode(String rtnCode) { RtnCode = rtnCode; } /** * 取得RtnMsg 交易訊息 - * @return RtnMsg */ public String getRtnMsg() { return RtnMsg; } /** * 設定RtnMsg 交易訊息 - * @param RtnMsg */ public void setRtnMsg(String rtnMsg) { RtnMsg = rtnMsg; } /** * 取得TradeNo 綠界的交易編號 - * @return TradeNo */ public String getTradeNo() { return TradeNo; } /** * 設定TradeNo 綠界的交易編號 - * @param TradeNo */ public void setTradeNo(String tradeNo) { TradeNo = tradeNo; } /** * 取得TradeAmt 交易金額 - * @return TradeAmt */ public String getTradeAmt() { return TradeAmt; } /** * 設定TradeAmt 交易金額 - * @param TradeAmt */ public void setTradeAmt(String tradeAmt) { TradeAmt = tradeAmt; } /** * 取得PaymentType 合作特店選擇的付款方式 - * @return PaymentType */ public String getPaymentType() { return PaymentType; } /** * 設定PaymentType 合作特店選擇的付款方式 - * @param PaymentType */ public void setPaymentType(String paymentType) { PaymentType = paymentType; } /** * 取得TradeDate 訂單成立時間 - * @return TradeDate */ public String getTradeDate() { return TradeDate; } /** * 設定TradeDate 訂單成立時間 - * @param TradeDate */ public void setTradeDate(String tradeDate) { TradeDate = tradeDate; } /** * 取得CheckMacValue 檢查碼 - * @return CheckMacValue */ public String getCheckMacValue() { return CheckMacValue; } /** * 設定CheckMacValue 檢查碼 - * @param CheckMacValue */ public void setCheckMacValue(String checkMacValue) { CheckMacValue = checkMacValue; } /** * 取得BankCode 繳費銀行代碼 - * @return BankCode */ public String getBankCode() { return BankCode; } /** * 設定BankCode 繳費銀行代碼 - * @param BankCode */ public void setBankCode(String bankCode) { BankCode = bankCode; } /** * 取得vAccount 繳費虛擬帳號 - * @return vAccount */ public String getvAccount() { return vAccount; } /** * 設定vAccount 繳費虛擬帳號 - * @param vAccount */ public void setvAccount(String vAccount) { this.vAccount = vAccount; } /** * 取得ExpireDate 繳費期限 - * @return ExpireDate */ public String getExpireDate() { return ExpireDate; } /** * 設定ExpireDate 繳費期限 - * @param ExpireDate */ public void setExpireDate(String expireDate) { ExpireDate = expireDate; } /** * 取得StoreID 合作特店商店代碼,提供合作特店填入店家代碼使用 - * @return StoreID */ public String getStoreID() { return StoreID; } /** * 設定StoreID 合作特店商店代碼,提供合作特店填入店家代碼使用 - * @param storeID */ public void setStoreID(String storeID) { StoreID = storeID; } /** * 取得CustomField1 自訂名稱欄位1,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField1 */ public String getCustomField1() { return CustomField1; } /** * 設定CustomField1 自訂名稱欄位1,提供合作廠商使用記錄用客製化使用欄位 - * @param customField1 */ public void setCustomField1(String customField1) { CustomField1 = customField1; } /** * 取得CustomField2 自訂名稱欄位2,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField2 */ public String getCustomField2() { return CustomField2; } /** * 設定CustomField2 自訂名稱欄位2,提供合作廠商使用記錄用客製化使用欄位 - * @param customField2 */ public void setCustomField2(String customField2) { CustomField2 = customField2; } /** * 取得CustomField3 自訂名稱欄位3,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField3 */ public String getCustomField3() { return CustomField3; } /** * 設定CustomField3 自訂名稱欄位3,提供合作廠商使用記錄用客製化使用欄位 - * @param customField3 */ public void setCustomField3(String customField3) { CustomField3 = customField3; } /** * 取得CustomField4 自訂名稱欄位4,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField4 */ public String getCustomField4() { return CustomField4; } /** * 設定CustomField4 自訂名稱欄位4,提供合作廠商使用記錄用客製化使用欄位 - * @param customField4 */ public void setCustomField4(String customField4) { CustomField4 = customField4; } /** * 取得PaymentTypeChargeFee 通路費 - * @return PaymentTypeChargeFee */ public String getPaymentTypeChargeFee() { return PaymentTypeChargeFee; } /** * 設定PaymentTypeChargeFee 通路費 - * @param paymentTypeChargeFee */ public void setPaymentTypeChargeFee(String paymentTypeChargeFee) { PaymentTypeChargeFee = paymentTypeChargeFee; } /** - * 取得SimulatePaid 是否為模擬付款 - * @return SimulatePaid + * 取得SimulatePaid 是否為模擬付款 */ public String getSimulatePaid() { return SimulatePaid; } /** - * 設定SimulatePaid 是否為模擬付款 - * @param simulatePaid + * 設定SimulatePaid 是否為模擬付款 */ public void setSimulatePaid(String simulatePaid) { SimulatePaid = simulatePaid; diff --git a/ecpay/payment/integration/domain/AioCheckOutALL.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutALL.java similarity index 87% rename from ecpay/payment/integration/domain/AioCheckOutALL.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutALL.java index 8863972..4f26942 100644 --- a/ecpay/payment/integration/domain/AioCheckOutALL.java +++ b/src/main/java/ecpay/payment/integration/domain/AioCheckOutALL.java @@ -281,630 +281,525 @@ public class AioCheckOutALL { /** * 取得MerchantID 合作特店編號(由綠界提供) - * @return MerchantID */ public String getMerchantID() { return MerchantID; } /** * 設定MerchantID 合作特店編號(由綠界提供) - * @param merchantID */ public void setMerchantID(String merchantID) { MerchantID = merchantID; } /** * 取得MerchantTradeNo 合作特店交易編號(由合作特店提供),該交易編號不可重複 - * @return MerchantTradeNo */ public String getMerchantTradeNo() { return MerchantTradeNo; } /** * 設定MerchantTradeNo 合作特店交易編號(由合作特店提供),該交易編號不可重複 - * @param merchantTradeNo */ public void setMerchantTradeNo(String merchantTradeNo) { MerchantTradeNo = merchantTradeNo; } /** * 取得MerchantTradeDate 合作特店交易時間 - * @return MerchantTradeDate */ public String getMerchantTradeDate() { return MerchantTradeDate; } /** * 設定MerchantTradeDate 合作特店交易時間,請以 yyyy/MM/dd HH:mm:ss格式帶入 - * @param merchantTradeDate */ public void setMerchantTradeDate(String merchantTradeDate) { MerchantTradeDate = merchantTradeDate; } /** * 取得PaymentType 交易類型 - * @return PaymentType */ public String getPaymentType() { return PaymentType; } - /** - * 設定PaymentType 會員選擇的付款方式 - * @param paymentType - */ -// public void setPaymentType(String paymentType) { -// PaymentType = paymentType; -// } + /** * 取得TotalAmount 交易金額 - * @return TotalAmount */ public String getTotalAmount() { return TotalAmount; } /** * 設定TotalAmount 交易金額 - * @param totalAmount */ public void setTotalAmount(String totalAmount) { TotalAmount = totalAmount; } /** * 取得TradeDesc 交易描述 - * @return TradeDesc */ public String getTradeDesc() { return TradeDesc; } /** * 設定TradeDesc 交易描述 - * @param tradeDesc */ public void setTradeDesc(String tradeDesc) { TradeDesc = tradeDesc; } /** * 取得ItemName 商品名稱 - * @return ItemName */ public String getItemName() { return ItemName; } /** * 設定ItemName 商品名稱 - * @param itemName */ public void setItemName(String itemName) { ItemName = itemName; } /** * 取得ReturnURL 付款完成通知回傳網址 - * @return ReturnURL */ public String getReturnURL() { return ReturnURL; } /** * 設定ReturnURL 付款完成通知回傳網址 - * @param returnURL */ public void setReturnURL(String returnURL) { ReturnURL = returnURL; } /** * 取得ChoosePayment 選擇預設付款方式 - * @return ChoosePayment */ public String getChoosePayment() { return ChoosePayment; } - /** - * 設定ChoosePayment 選擇預設付款方式 - * @param choosePayment - */ -// public void setChoosePayment(String choosePayment) { -// ChoosePayment = choosePayment; -// } + /** * 取得ClientBackURL Client端返回合作特店系統的按鈕連結 - * @return ClientBackURL */ public String getClientBackURL() { return ClientBackURL; } /** * 設定ClientBackURL Client端返回合作特店系統的按鈕連結 - * @param clientBackURL */ public void setClientBackURL(String clientBackURL) { ClientBackURL = clientBackURL; } /** * 取得ItemURL 商品銷售網址 - * @return ItemURL */ public String getItemURL() { return ItemURL; } /** * 設定 ItemURL 商品銷售網址 - * @param itemURL */ public void setItemURL(String itemURL) { ItemURL = itemURL; } /** * 取得Remark 備註欄位 - * @return Remark */ public String getRemark() { return Remark; } /** * 設定Remark 備註欄位 - * @param remark */ public void setRemark(String remark) { Remark = remark; } /** * 取得ChooseSubPayment 選擇預設付款子項目 - * @return ChooseSubPayment */ public String getChooseSubPayment() { return ChooseSubPayment; } /** * 設定ChooseSubPayment 選擇預設付款子項目 - * @param chooseSubPayment */ public void setChooseSubPayment(String chooseSubPayment) { ChooseSubPayment = chooseSubPayment; } /** * 取得OrderResultURL Client端回傳付款結果網址 - * @return OrderResultURL */ public String getOrderResultURL() { return OrderResultURL; } /** * 設定OrderResultURL Client端回傳付款結果網址 - * @param orderResultURL */ public void setOrderResultURL(String orderResultURL) { OrderResultURL = orderResultURL; } /** - * 取得NeedExtraPaidInfo 是否需要額外的付款資訊 - * @return NeedExtraPaidInfo + * 取得NeedExtraPaidInfo 是否需要額外的付款資訊 */ public String getNeedExtraPaidInfo() { return NeedExtraPaidInfo; } /** - * 設定NeedExtraPaidInfo 是否需要額外的付款資訊 - * @param needExtraPaidInfo + * 設定NeedExtraPaidInfo 是否需要額外的付款資訊 */ public void setNeedExtraPaidInfo(String needExtraPaidInfo) { NeedExtraPaidInfo = needExtraPaidInfo; } /** * 取得DeviceSource 裝置來源 - * @return DeviceSource */ public String getDeviceSource() { return DeviceSource; } /** * 設定DeviceSource 裝置來源 - * @param deviceSource */ public void setDeviceSource(String deviceSource) { DeviceSource = deviceSource; } /** * 取得IgnorePayment 隱藏付款方式 - * @return IgnorePayment */ public String getIgnorePayment() { return IgnorePayment; } /** * 設定IgnorePayment 隱藏付款方式 - * @param ignorePayment */ public void setIgnorePayment(String ignorePayment) { IgnorePayment = ignorePayment; } /** * 取得PlatformID 特約合作平台商代號(由綠界提供) - * @return PlatformID */ public String getPlatformID() { return PlatformID; } /** * 設定PlatformID 特約合作平台商代號(由綠界提供) - * @param platformID */ public void setPlatformID(String platformID) { PlatformID = platformID; } /** * 取得InvoiceMark 電子發票開立註記 - * @return InvoiceMark */ public String getInvoiceMark() { return InvoiceMark; } /** * 設定InvoiceMark 電子發票開立註記 - * @param invoiceMark */ public void setInvoiceMark(String invoiceMark) { InvoiceMark = invoiceMark; } /** * 取得EncryptType CheckMacValue加密類型 - * @return EncryptType */ public String getEncryptType() { return EncryptType; } - /** - * 設定EncryptType CheckMacValue加密類型 - * @param encryptType - */ -// public void setEncryptType(String encryptType) { -// EncryptType = encryptType; -// } + /** * 取得ExpireDate 允許繳費有效天數,若需設定最長 60 天,最短1天。未設定此參數則預設為3天 - * @return ExpireDate */ public String getExpireDate() { return ExpireDate; } /** * 設定ExpireDate 允許繳費有效天數,若需設定最長 60 天,最短1天。未設定此參數則預設為3天 - * @param expireDate */ public void setExpireDate(String expireDate) { ExpireDate = expireDate; } /** * 取得PaymentInfoURL Server端回傳付款相關資訊 - * @return PaymentInfoURL */ public String getPaymentInfoURL() { return PaymentInfoURL; } /** * 設定PaymentInfoURL Server端回傳付款相關資訊 - * @param paymentInfoURL */ public void setPaymentInfoURL(String paymentInfoURL) { PaymentInfoURL = paymentInfoURL; } /** * 取得ClientRedirectURL Client端回傳付款相關資訊 - * @return ClientRedirectURL */ public String getClientRedirectURL() { return ClientRedirectURL; } /** * 設定ClientRedirectURL Client端回傳付款相關資訊 - * @param clientRedirectURL */ public void setClientRedirectURL(String clientRedirectURL) { ClientRedirectURL = clientRedirectURL; } /** * 取得StoreExpireDate 超商繳費截止時間 - * @return StoreExpireDate */ public String getStoreExpireDate() { return StoreExpireDate; } /** * 設定StoreExpireDate 超商繳費截止時間 - * @param storeExpireDate */ public void setStoreExpireDate(String storeExpireDate) { StoreExpireDate = storeExpireDate; } /** * 取得Desc_1 交易描述1 - * @return Desc_1 */ public String getDesc_1() { return Desc_1; } /** * 設定Desc_1 交易描述1 - * @param desc_1 */ public void setDesc_1(String desc_1) { Desc_1 = desc_1; } /** * 取得Desc_2 交易描述2 - * @return Desc_2 */ public String getDesc_2() { return Desc_2; } /** * 設定Desc_2 交易描述2 - * @param desc_2 */ public void setDesc_2(String desc_2) { Desc_2 = desc_2; } /** * 取得Desc_3 交易描述3 - * @return Desc_3 */ public String getDesc_3() { return Desc_3; } /** * 設定Desc_3 交易描述3 - * @param desc_3 */ public void setDesc_3(String desc_3) { Desc_3 = desc_3; } /** * 取得Desc_4 交易描述4 - * @return Desc_4 */ public String getDesc_4() { return Desc_4; } /** * 設定Desc_4 交易描述4 - * @param desc_4 */ public void setDesc_4(String desc_4) { Desc_4 = desc_4; } /** * 取得Language 語系設定 - * @return Language */ public String getLanguage() { return Language; } /** * 設定Language 語系設定 - * @param language */ public void setLanguage(String language) { Language = language; } /** * 取得Redeem 信用卡是否使用紅利折抵 - * @return Redeem */ public String getRedeem() { return Redeem; } /** * 設定Redeem 信用卡是否使用紅利折抵 - * @param redeem */ public void setRedeem(String redeem) { Redeem = redeem; } /** * 取得UnionPay 是否為銀聯卡交易 - * @return UnionPay */ public String getUnionPay() { return UnionPay; } /** * 設定UnionPay 是否為銀聯卡交易 - * @param unionPay */ public void setUnionPay(String unionPay) { UnionPay = unionPay; } /** * 取得CreditInstallment 刷卡分期期數 - * @return CreditInstallment */ public String getCreditInstallment() { return CreditInstallment; } /** * 設定CreditInstallment 刷卡分期期數 - * @param creditInstallment */ public void setCreditInstallment(String creditInstallment) { CreditInstallment = creditInstallment; } /** * 取得InstallmentAmount 使用刷卡分期的總付款金額 - * @return InstallmentAmount */ public String getInstallmentAmount() { return InstallmentAmount; } /** * 設定InstallmentAmount 使用刷卡分期的總付款金額 - * @param installmentAmount */ public void setInstallmentAmount(String installmentAmount) { InstallmentAmount = installmentAmount; } /** * 取得PeriodAmount 每次授權金額 - * @return PeriodAmount */ public String getPeriodAmount() { return PeriodAmount; } /** * 設定PeriodAmount 每次授權金額 - * @param periodAmount */ public void setPeriodAmount(String periodAmount) { PeriodAmount = periodAmount; } /** * 取得PeriodType 週期種類 - * @return PeriodType */ public String getPeriodType() { return PeriodType; } /** * 設定PeriodType 週期種類 - * @param periodType */ public void setPeriodType(String periodType) { PeriodType = periodType; } /** * 取得Frequency 執行頻率 - * @return Frequency */ public String getFrequency() { return Frequency; } /** * 設定Frequency 執行頻率 - * @param frequency */ public void setFrequency(String frequency) { Frequency = frequency; } /** * 取得ExecTimes 執行次數 - * @return ExecTimes */ public String getExecTimes() { return ExecTimes; } /** * 設定ExecTimes 執行次數 - * @param execTimes */ public void setExecTimes(String execTimes) { ExecTimes = execTimes; } /** * 取得PeriodReturnURL 定期定額的執行結果回應URL - * @return PeriodReturnURL */ public String getPeriodReturnURL() { return PeriodReturnURL; } /** * 設定PeriodReturnURL 定期定額的執行結果回應URL - * @param periodReturnURL */ public void setPeriodReturnURL(String periodReturnURL) { PeriodReturnURL = periodReturnURL; } /** * 取得StoreID 合作特店商店代碼,提供合作特店填入店家代碼使用 - * @return StoreID */ public String getStoreID() { return StoreID; } /** * 設定StoreID 合作特店商店代碼,提供合作特店填入店家代碼使用 - * @param storeID */ public void setStoreID(String storeID) { StoreID = storeID; } /** * 取得CustomField1 自訂名稱欄位1,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField1 */ public String getCustomField1() { return CustomField1; } /** * 設定CustomField1 自訂名稱欄位1,提供合作廠商使用記錄用客製化使用欄位 - * @param customField1 */ public void setCustomField1(String customField1) { CustomField1 = customField1; } /** * 取得CustomField2 自訂名稱欄位2,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField2 */ public String getCustomField2() { return CustomField2; } /** * 設定CustomField2 自訂名稱欄位2,提供合作廠商使用記錄用客製化使用欄位 - * @param customField2 */ public void setCustomField2(String customField2) { CustomField2 = customField2; } /** * 取得CustomField3 自訂名稱欄位3,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField3 */ public String getCustomField3() { return CustomField3; } /** * 設定CustomField3 自訂名稱欄位3,提供合作廠商使用記錄用客製化使用欄位 - * @param customField3 */ public void setCustomField3(String customField3) { CustomField3 = customField3; } /** * 取得CustomField4 自訂名稱欄位4,提供合作廠商使用記錄用客製化使用欄位 - * @return CustomField4 */ public String getCustomField4() { return CustomField4; } /** * 設定CustomField4 自訂名稱欄位4,提供合作廠商使用記錄用客製化使用欄位 - * @param customField4 */ public void setCustomField4(String customField4) { CustomField4 = customField4; } /** * 取得BidingCard 記憶卡號,使用記憶信用卡 1:使用 0:不使用 - * @return BidingCard */ public String getBidingCard() { return BidingCard; } /** * 設定BidingCard 記憶卡號,使用記憶信用卡 1:使用 0:不使用 - * @param bidingCard */ public void setBidingCard(String bidingCard) { BidingCard = bidingCard; } /** * 取得MerchantMemberID 記憶卡號識別碼,為合作特店使的會員識別碼,若記憶卡號為1時,記憶卡號識別碼為必填 - * @return MerchantMemberID */ public String getMerchantMemberID() { return MerchantMemberID; } /** * 設定MerchantMemberID 記憶卡號識別碼,為合作特店使的會員識別碼,若記憶卡號為1時,記憶卡號識別碼為必填 - * @param merchantMemberID */ public void setMerchantMemberID(String merchantMemberID) { MerchantMemberID = merchantMemberID; diff --git a/ecpay/payment/integration/domain/AioCheckOutATM.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutATM.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutATM.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutATM.java diff --git a/ecpay/payment/integration/domain/AioCheckOutBARCODE.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutBARCODE.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutBARCODE.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutBARCODE.java diff --git a/ecpay/payment/integration/domain/AioCheckOutCVS.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutCVS.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutCVS.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutCVS.java diff --git a/ecpay/payment/integration/domain/AioCheckOutDevide.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutDevide.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutDevide.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutDevide.java diff --git a/ecpay/payment/integration/domain/AioCheckOutGooglePay.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutGooglePay.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutGooglePay.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutGooglePay.java diff --git a/ecpay/payment/integration/domain/AioCheckOutOneTime.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutOneTime.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutOneTime.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutOneTime.java diff --git a/ecpay/payment/integration/domain/AioCheckOutPeriod.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutPeriod.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutPeriod.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutPeriod.java diff --git a/ecpay/payment/integration/domain/AioCheckOutWebATM.java b/src/main/java/ecpay/payment/integration/domain/AioCheckOutWebATM.java similarity index 100% rename from ecpay/payment/integration/domain/AioCheckOutWebATM.java rename to src/main/java/ecpay/payment/integration/domain/AioCheckOutWebATM.java diff --git a/ecpay/payment/integration/domain/CVSOrBARCODERequestObj.java b/src/main/java/ecpay/payment/integration/domain/CVSOrBARCODERequestObj.java similarity index 100% rename from ecpay/payment/integration/domain/CVSOrBARCODERequestObj.java rename to src/main/java/ecpay/payment/integration/domain/CVSOrBARCODERequestObj.java diff --git a/ecpay/payment/integration/domain/CaptureObj.java b/src/main/java/ecpay/payment/integration/domain/CaptureObj.java similarity index 100% rename from ecpay/payment/integration/domain/CaptureObj.java rename to src/main/java/ecpay/payment/integration/domain/CaptureObj.java diff --git a/ecpay/payment/integration/domain/CreateServerOrderObj.java b/src/main/java/ecpay/payment/integration/domain/CreateServerOrderObj.java similarity index 100% rename from ecpay/payment/integration/domain/CreateServerOrderObj.java rename to src/main/java/ecpay/payment/integration/domain/CreateServerOrderObj.java diff --git a/ecpay/payment/integration/domain/DoActionObj.java b/src/main/java/ecpay/payment/integration/domain/DoActionObj.java similarity index 100% rename from ecpay/payment/integration/domain/DoActionObj.java rename to src/main/java/ecpay/payment/integration/domain/DoActionObj.java diff --git a/ecpay/payment/integration/domain/FundingReconDetailObj.java b/src/main/java/ecpay/payment/integration/domain/FundingReconDetailObj.java similarity index 100% rename from ecpay/payment/integration/domain/FundingReconDetailObj.java rename to src/main/java/ecpay/payment/integration/domain/FundingReconDetailObj.java diff --git a/ecpay/payment/integration/domain/InvoiceObj.java b/src/main/java/ecpay/payment/integration/domain/InvoiceObj.java similarity index 100% rename from ecpay/payment/integration/domain/InvoiceObj.java rename to src/main/java/ecpay/payment/integration/domain/InvoiceObj.java diff --git a/ecpay/payment/integration/domain/QueryCreditCardPeriodInfoObj.java b/src/main/java/ecpay/payment/integration/domain/QueryCreditCardPeriodInfoObj.java similarity index 100% rename from ecpay/payment/integration/domain/QueryCreditCardPeriodInfoObj.java rename to src/main/java/ecpay/payment/integration/domain/QueryCreditCardPeriodInfoObj.java diff --git a/ecpay/payment/integration/domain/QueryTradeInfoObj.java b/src/main/java/ecpay/payment/integration/domain/QueryTradeInfoObj.java similarity index 100% rename from ecpay/payment/integration/domain/QueryTradeInfoObj.java rename to src/main/java/ecpay/payment/integration/domain/QueryTradeInfoObj.java diff --git a/ecpay/payment/integration/domain/QueryTradeObj.java b/src/main/java/ecpay/payment/integration/domain/QueryTradeObj.java similarity index 100% rename from ecpay/payment/integration/domain/QueryTradeObj.java rename to src/main/java/ecpay/payment/integration/domain/QueryTradeObj.java diff --git a/ecpay/payment/integration/domain/TradeNoAioObj.java b/src/main/java/ecpay/payment/integration/domain/TradeNoAioObj.java similarity index 100% rename from ecpay/payment/integration/domain/TradeNoAioObj.java rename to src/main/java/ecpay/payment/integration/domain/TradeNoAioObj.java diff --git a/ecpay/payment/integration/ecpayOperator/EcpayFunction.java b/src/main/java/ecpay/payment/integration/ecpayOperator/EcpayFunction.java similarity index 93% rename from ecpay/payment/integration/ecpayOperator/EcpayFunction.java rename to src/main/java/ecpay/payment/integration/ecpayOperator/EcpayFunction.java index 8f61c95..e4f6141 100644 --- a/ecpay/payment/integration/ecpayOperator/EcpayFunction.java +++ b/src/main/java/ecpay/payment/integration/ecpayOperator/EcpayFunction.java @@ -51,10 +51,6 @@ public class EcpayFunction { /** * 產生檢查碼 - * @param key - * @param iv - * @param obj - * @return */ public final static String genCheckMacValue(String key, String iv, Object obj){ Class cls = obj.getClass(); @@ -64,7 +60,9 @@ public final static String genCheckMacValue(String key, String iv, Object obj){ for(String name: fieldNames){ if(name != "CheckMacValue" && name != "PaymentToken"){ Method method = cls.getMethod("get"+name, null); - data = data + '&' + name + '=' + method.invoke(obj).toString(); + if(method.invoke(obj)!=null){ + data = data + '&' + name + '=' + method.invoke(obj).toString(); + } } } String urlEncode = urlEncode("HashKey=" + key + data + "&HashIV=" + iv).toLowerCase(); @@ -77,11 +75,6 @@ public final static String genCheckMacValue(String key, String iv, Object obj){ /** * AES加密 - * @param HashKey - * @param HashIV - * @param plaintext - * @return - * @throws Exception */ public final static String AESEncode(String HashKey, String HashIV, String plaintext) throws Exception{ SecretKey key = new SecretKeySpec(HashKey.getBytes("UTF-8"), "AES"); @@ -125,10 +118,6 @@ private final static String pkcs7Padding(String plaintext){ /** * 產生檢查碼 - * @param key - * @param iv - * @param Hashtable params - * @return */ public final static String genCheckMacValue(String key, String iv, Hashtable params){ Set keySet = params.keySet(); @@ -148,9 +137,6 @@ public final static String genCheckMacValue(String key, String iv, Hashtable cls = obj.getClass(); @@ -171,8 +157,6 @@ public final static String genHttpValue(Object obj, String CheckMacValue){ /** * 將物件轉為Hashtable - * @param obj - * @return Hashtable */ public final static HashtableobjToHashtable(Object obj){ Class cls = obj.getClass(); @@ -200,9 +184,6 @@ private final static String invokeMethod(Method method, Object obj){ /** * client http post的功能 - * @param url - * @param urlParameters - * @return response string */ public final static String httpPost(String url, String urlParameters, String encoding){ try{ @@ -239,7 +220,6 @@ public final static String httpPost(String url, String urlParameters, String enc /** * 產生 Unix TimeStamp - * @return TimeStamp */ public final static String genUnixTimeStamp(){ Date date = new Date(); @@ -262,7 +242,6 @@ public final static Document xmlParser(String uri){ /** * 信任所有憑證. - * @param connection */ private static void trustAllHosts(HttpsURLConnection connection) { X509TrustManager easyTrustManager = new X509TrustManager() { @@ -304,8 +283,6 @@ public X509Certificate[] getAcceptedIssuers() { /** * 針對物件內屬性的參數作排序 - * @param Class - * @return List */ private static List getSortedFieldNames(Class cls){ Field[] fields = cls.getDeclaredFields(); @@ -319,8 +296,6 @@ private static List getSortedFieldNames(Class cls){ /** * 將資料做 urlEncode編碼 - * @param data - * @return url encoded string */ public static String urlEncode(String data){ String result = ""; @@ -334,8 +309,6 @@ public static String urlEncode(String data){ /** * 將做完的urlEncode字串做轉換符合 .NET語言的轉換規則 - * @param url - * @return .Net url encoded string */ private static String netUrlEncode(String url){ String netUrlEncode = url.replaceAll("%21", "\\!").replaceAll("%28", "\\(").replaceAll("%29", "\\)"); @@ -344,9 +317,6 @@ private static String netUrlEncode(String url){ /** * 將 byte array 資料做 hash md5或 sha256 運算,並回傳 hex值的字串資料 - * @param data - * @param isMD5 - * @return string */ private final static String hash(byte data[], String mode){ MessageDigest md = null; @@ -364,8 +334,6 @@ else if(mode == "SHA-256"){ /** * 將 byte array 資料轉換成 hex字串值 - * @param bytes - * @return string */ private final static String bytesToHex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; diff --git a/ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java b/src/main/java/ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java similarity index 97% rename from ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java rename to src/main/java/ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java index 3f465e4..341e1ee 100644 --- a/ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java +++ b/src/main/java/ecpay/payment/integration/ecpayOperator/PaymentVerifyBase.java @@ -13,7 +13,7 @@ import ecpay.payment.integration.exception.EcpayException; public class PaymentVerifyBase{ - protected String confPath = "/ecpay/payment/integration/config/EcpayPayment.xml"; + protected String confPath = "/EcpayPayment.xml"; protected Document doc; public PaymentVerifyBase(){ URL fileURL = this.getClass().getResource(confPath); diff --git a/ecpay/payment/integration/errorMsg/ErrorMessage.java b/src/main/java/ecpay/payment/integration/errorMsg/ErrorMessage.java similarity index 100% rename from ecpay/payment/integration/errorMsg/ErrorMessage.java rename to src/main/java/ecpay/payment/integration/errorMsg/ErrorMessage.java diff --git a/ecpay/payment/integration/exception/EcpayException.java b/src/main/java/ecpay/payment/integration/exception/EcpayException.java similarity index 100% rename from ecpay/payment/integration/exception/EcpayException.java rename to src/main/java/ecpay/payment/integration/exception/EcpayException.java diff --git a/ecpay/payment/integration/verification/VerifyAioCheckOut.java b/src/main/java/ecpay/payment/integration/verification/VerifyAioCheckOut.java similarity index 93% rename from ecpay/payment/integration/verification/VerifyAioCheckOut.java rename to src/main/java/ecpay/payment/integration/verification/VerifyAioCheckOut.java index 15ff057..dbc1c45 100644 --- a/ecpay/payment/integration/verification/VerifyAioCheckOut.java +++ b/src/main/java/ecpay/payment/integration/verification/VerifyAioCheckOut.java @@ -136,8 +136,8 @@ else if(obj.getInvoiceItemPrice().isEmpty()) else if(obj.getInvoiceItemTaxType().isEmpty()) throw new EcpayException("InvoiceItemTaxType cannot be empty."); // 商品名稱含有管線 => 認為是多樣商品 *InvoiceItemName, *InvoiceItemCount ,*InvoiceItemWord, *InvoiceItemPrice InvoiceItemTaxType逐一用管線分割,計算數量後與第一個比對 - if(obj.getInvoiceItemName().contains("|")){ - int itemCount = obj.getInvoiceItemName().split("|").length; + if(obj.getInvoiceItemName().contains("\\|")){ + int itemCount = obj.getInvoiceItemName().split("\\|").length; int paramCount = 0; Pattern r = Pattern.compile("(\\|\\||^\\||\\|$)"); Matcher invCount = r.matcher(obj.getInvoiceItemCount()); @@ -147,33 +147,33 @@ else if(obj.getInvoiceItemTaxType().isEmpty()) if(invCount.find()){ throw new EcpayException("InvoiceItemCount contains empty value."); } else{ - paramCount = obj.getInvoiceItemCount().split("|").length; + paramCount = obj.getInvoiceItemCount().split("\\|").length; if(itemCount != paramCount) throw new EcpayException("Count of item info InvoiceItemCount(" + paramCount + ") not match item count from InvoiceItemName(" + itemCount + ")"); } if(invWord.find()){ throw new EcpayException("InvoiceItemWord contains empty value."); } else{ - paramCount = obj.getInvoiceItemWord().split("|").length; + paramCount = obj.getInvoiceItemWord().split("\\|").length; if(itemCount != paramCount) throw new EcpayException("Count of item info InvoiceItemWord(" + paramCount + ") not match item count from InvoiceItemName(" + itemCount + ")"); } if(invPrice.find()){ throw new EcpayException("InvoiceItemPrice contains empty value."); } else{ - paramCount = obj.getInvoiceItemPrice().split("|").length; + paramCount = obj.getInvoiceItemPrice().split("\\|").length; if(itemCount != paramCount) throw new EcpayException("Count of item info InvoiceItemPrice(" + paramCount + ") not match item count from InvoiceItemName(" + itemCount + ")"); } if(invType.find()){ throw new EcpayException("InvoiceItemTaxType contains empty value."); } else{ - paramCount = obj.getInvoiceItemTaxType().split("|").length; + paramCount = obj.getInvoiceItemTaxType().split("\\|").length; if(itemCount != paramCount) throw new EcpayException("Count of item info InvoiceItemTaxType(" + paramCount + ") not match item count from InvoiceItemName(" + itemCount + ")"); } // 課稅類別[TaxType] = 9 時 => InvoiceItemTaxType 能含有1,2 3(and at least contains one 1 and other) - String[] itemTax = obj.getInvoiceItemTaxType().split("|"); + String[] itemTax = obj.getInvoiceItemTaxType().split("\\|"); for(String tax : itemTax){ if(tax.equals("1") || tax.equals("2") || tax.equals("3")) continue; @@ -188,13 +188,13 @@ else if(obj.getInvoiceItemTaxType().isEmpty()) } } else{ // 沒有管線 => 逐一檢查後4項有無管線 - if(obj.getInvoiceItemCount().contains("|")) + if(obj.getInvoiceItemCount().contains("\\|")) throw new EcpayException("Item info InvoiceItemCount contains pipeline delimiter but there's only one item in param InvoiceItemName."); - else if(obj.getInvoiceItemWord().contains("|")) + else if(obj.getInvoiceItemWord().contains("\\|")) throw new EcpayException("Item info InvoiceItemWord contains pipeline delimiter but there's only one item in param InvoiceItemName."); - else if(obj.getInvoiceItemPrice().contains("|")) + else if(obj.getInvoiceItemPrice().contains("\\|")) throw new EcpayException("Item info InvoiceItemPrice contains pipeline delimiter but there's only one item in param InvoiceItemName."); - else if(obj.getInvoiceItemTaxType().contains("|")) + else if(obj.getInvoiceItemTaxType().contains("\\|")) throw new EcpayException("Item info InvoiceItemTaxType contains pipeline delimiter but there's only one item in param InvoiceItemName."); } // 4 比對所有欄位Pattern diff --git a/ecpay/payment/integration/verification/VerifyCapture.java b/src/main/java/ecpay/payment/integration/verification/VerifyCapture.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyCapture.java rename to src/main/java/ecpay/payment/integration/verification/VerifyCapture.java diff --git a/ecpay/payment/integration/verification/VerifyCreateServerOrder.java b/src/main/java/ecpay/payment/integration/verification/VerifyCreateServerOrder.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyCreateServerOrder.java rename to src/main/java/ecpay/payment/integration/verification/VerifyCreateServerOrder.java diff --git a/ecpay/payment/integration/verification/VerifyDoAction.java b/src/main/java/ecpay/payment/integration/verification/VerifyDoAction.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyDoAction.java rename to src/main/java/ecpay/payment/integration/verification/VerifyDoAction.java diff --git a/ecpay/payment/integration/verification/VerifyFundingReconDetail.java b/src/main/java/ecpay/payment/integration/verification/VerifyFundingReconDetail.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyFundingReconDetail.java rename to src/main/java/ecpay/payment/integration/verification/VerifyFundingReconDetail.java diff --git a/ecpay/payment/integration/verification/VerifyQueryCreditTrade.java b/src/main/java/ecpay/payment/integration/verification/VerifyQueryCreditTrade.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyQueryCreditTrade.java rename to src/main/java/ecpay/payment/integration/verification/VerifyQueryCreditTrade.java diff --git a/ecpay/payment/integration/verification/VerifyQueryTrade.java b/src/main/java/ecpay/payment/integration/verification/VerifyQueryTrade.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyQueryTrade.java rename to src/main/java/ecpay/payment/integration/verification/VerifyQueryTrade.java diff --git a/ecpay/payment/integration/verification/VerifyQueryTradeInfo.java b/src/main/java/ecpay/payment/integration/verification/VerifyQueryTradeInfo.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyQueryTradeInfo.java rename to src/main/java/ecpay/payment/integration/verification/VerifyQueryTradeInfo.java diff --git a/ecpay/payment/integration/verification/VerifyTradeNoAio.java b/src/main/java/ecpay/payment/integration/verification/VerifyTradeNoAio.java similarity index 100% rename from ecpay/payment/integration/verification/VerifyTradeNoAio.java rename to src/main/java/ecpay/payment/integration/verification/VerifyTradeNoAio.java diff --git a/ecpay/payment/integration/config/EcpayPayment.xml b/src/main/resources/EcpayPayment.xml similarity index 100% rename from ecpay/payment/integration/config/EcpayPayment.xml rename to src/main/resources/EcpayPayment.xml