diff --git a/CHANGELOG.md b/CHANGELOG.md index 302b3e8..eae9bb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +* 4.52 (2017-10-25) + + * new "merchantName" parameter for services + - doWebPayment + - manageWebWallet + - verifyEnrollment + * new "details" object parameter for doRefund service + * new "avs" child node for "transaction" object + * new "paymentData" child node for "card" object + +---------------------------------------- + * 4.48 (2016-09-20) * new getAlertDetails parameters diff --git a/README.md b/README.md index a23b167..4c48a7e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Add this dependency in your project's POM: com.payline payline-java-sdk - 4.48 + 4.52 ``` @@ -69,7 +69,7 @@ public class SampleCalls { ``` ## Version -4.48 +4.52 ## Learn about Payline * [www.payline.com](http://www.payline.com/index.php/en/) diff --git a/pom.xml b/pom.xml index 8379fdd..ec0a460 100644 --- a/pom.xml +++ b/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.payline payline-java-sdk - 4.48 + 4.52 Payline JAVA SDK Project The Payline API provides access to the various functions of the Payline payment solution. It is based on standard web service components, which include the SOAP protocol, the WSDL and XSD definition languages. These standards are supported by a large range of development tools on multiple platforms. This SDK covers all the functions of the Payline payment solution. 1.6 - 4.48 + 4.52 www.payline.com diff --git a/src/main/java/com/payline/kit/utils/ConnectParams.java b/src/main/java/com/payline/kit/utils/ConnectParams.java index 49abff9..120af23 100644 --- a/src/main/java/com/payline/kit/utils/ConnectParams.java +++ b/src/main/java/com/payline/kit/utils/ConnectParams.java @@ -25,48 +25,48 @@ public class ConnectParams { /** * production, flag to indicate whether web services calls should be done in production environment */ - private static boolean production; + private boolean production; /** * clientAuthentication, This attribute specifies if client authentication should be required. Returns whether client authentication is required. true, if * clients are required to authenticate, false otherwise. */ - private static boolean clientAuthentication; + private boolean clientAuthentication; /** * module, the module to connect */ - private static String module = null; + private String module = null; /** * merchantId the merchant identifier being used */ - private static String merchantId; + private String merchantId; /** * accessKey, the access key for this credentials object The unique identifier access key of the connection in security domain */ - private static String accessKey; + private String accessKey; /** * proxyHost, The hostname, or address, of the proxy server */ - private static String proxyHost = null; + private String proxyHost = null; /** * proxyPort, The port number of the proxy server. */ - private static String proxyPort = null; + private String proxyPort = null; /** * proxyLogin, the proxy login should use for retrieving Connections */ - private static String proxyLogin = null; + private String proxyLogin = null; /** * proxyPassword, the proxy password that should use for retrieving Connections */ - private static String proxyPassword = null; + private String proxyPassword = null; /** * Class constructor specifying the connection properties to create @@ -83,23 +83,23 @@ public class ConnectParams { public ConnectParams(String module, boolean production, boolean clientAuthentication, String merchantId, String accessKey, String proxyHost, String proxyPort, String proxyLogin, String proxyPassword) { if (module != null && module.length() != 0) { - ConnectParams.module = module; + this.module = module; } - ConnectParams.production = production; - ConnectParams.clientAuthentication = clientAuthentication; - ConnectParams.merchantId = merchantId; - ConnectParams.accessKey = accessKey; + this.production = production; + this.clientAuthentication = clientAuthentication; + this.merchantId = merchantId; + this.accessKey = accessKey; if (proxyHost != null && proxyHost.length() != 0) { - ConnectParams.proxyHost = proxyHost; + this.proxyHost = proxyHost; } if (proxyPort != null && proxyPort.length() != 0) { - ConnectParams.proxyPort = proxyPort; + this.proxyPort = proxyPort; } if (proxyLogin != null && proxyLogin.length() != 0) { - ConnectParams.proxyLogin = proxyLogin; + this.proxyLogin = proxyLogin; } if (proxyPassword != null && proxyPassword.length() != 0) { - ConnectParams.proxyPassword = proxyPassword; + this.proxyPassword = proxyPassword; } } @@ -113,12 +113,12 @@ public ConnectParams(String module, boolean production, boolean clientAuthentica */ public ConnectParams(String module, boolean production, boolean clientAuthentication, String merchantId, String accessKey) { if (module != null && module.length() != 0) { - ConnectParams.module = module; + this.module = module; } - ConnectParams.production = production; - ConnectParams.clientAuthentication = clientAuthentication; - ConnectParams.merchantId = merchantId; - ConnectParams.accessKey = accessKey; + this.production = production; + this.clientAuthentication = clientAuthentication; + this.merchantId = merchantId; + this.accessKey = accessKey; } /** diff --git a/src/main/java/com/payline/kit/utils/Utils.java b/src/main/java/com/payline/kit/utils/Utils.java index f0c66f2..25fd1c6 100644 --- a/src/main/java/com/payline/kit/utils/Utils.java +++ b/src/main/java/com/payline/kit/utils/Utils.java @@ -73,7 +73,7 @@ public final class Utils { /** * WSDL */ - public static final String WSDL = "wsdls/v4.48.wsdl"; + public static final String WSDL = "wsdls/v4.52.wsdl"; /** * logger. @@ -85,11 +85,12 @@ public final class Utils { * Communication error */ public static final String EXCEPTION_CODE = "XXXXX"; + public static final String EXCEPTION_SHORTMESSAGE = "EXCEPTION"; /** * kit version */ - public static final String kitVersion = "kit JAVA v4.48"; + public static final String kitVersion = "kit JAVA v4.52"; /** * Default constructor. diff --git a/src/main/java/com/payline/ws/wrapper/DirectPayment.java b/src/main/java/com/payline/ws/wrapper/DirectPayment.java index 8a95901..e773e30 100644 --- a/src/main/java/com/payline/ws/wrapper/DirectPayment.java +++ b/src/main/java/com/payline/ws/wrapper/DirectPayment.java @@ -18,6 +18,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +import javax.xml.bind.JAXBElement; import javax.xml.ws.WebServiceException; import com.payline.kit.utils.ConnectParams; @@ -56,6 +57,7 @@ import com.payline.ws.model.GetMerchantSettingsResponse; import com.payline.ws.model.GetTokenRequest; import com.payline.ws.model.GetTokenResponse; +import com.payline.ws.model.ObjectFactory; import com.payline.ws.model.Order; import com.payline.ws.model.Payment; import com.payline.ws.model.PrivateDataList; @@ -77,6 +79,11 @@ public class DirectPayment extends WebServiceWrapper { * A Logger object is used to log messages */ private static final Logger logger = Logger.getLogger(DirectPayment.class.getName()); + + /** + * ObjectFactory is used to create result messages + */ + private ObjectFactory factory = null; /** * initFromFile, initiating Direct Services from payline properties file @@ -94,6 +101,7 @@ public class DirectPayment extends WebServiceWrapper { */ public DirectPayment() { super(); + this.factory = new ObjectFactory(); } /** @@ -102,6 +110,7 @@ public DirectPayment() { */ public DirectPayment(ConnectParams connectParams) { super(); + this.factory = new ObjectFactory(); this.initFromFile = false; this.connectParams = connectParams; } @@ -144,8 +153,8 @@ public final DoAuthorizationResponse doAuthorization(final Payment payment, fina logger.log(Level.SEVERE, "Error during doAuthorization call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -192,8 +201,8 @@ public final DoDebitResponse doDebit(final Payment payment, final Order order, f logger.log(Level.SEVERE, "Error during doDebit call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -232,8 +241,8 @@ public final DoBankTransferResponse doBankTransfer(final Payment payment, final logger.log(Level.SEVERE, "Error during doBankTransfer call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -271,8 +280,8 @@ public final DoCaptureResponse doCapture(final Payment payment, final String tra logger.log(Level.SEVERE, "Error during doCapture call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -312,8 +321,8 @@ public final DoRefundResponse doRefund(final Payment payment, final String trans logger.log(Level.SEVERE, "Error during doRefund call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -357,8 +366,8 @@ public final DoCreditResponse doCredit(final Payment payment, final Card card, f logger.log(Level.SEVERE, "Error during doCredit call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -413,8 +422,8 @@ public final VerifyEnrollmentResponse verifyEnrollment(final Card card, final Pa logger.log(Level.SEVERE, "Error during verifyEnrollment call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -447,8 +456,8 @@ public final DoResetResponse doReset(final String transationID, final String com logger.log(Level.SEVERE, "Error during doReset call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -479,8 +488,8 @@ public final GetBalanceResponse getBalance(final String cardID, final String con logger.log(Level.SEVERE, "Error during getBalance call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -507,8 +516,8 @@ public final GetEncryptionKeyResponse getEncryptionKey() { logger.log(Level.SEVERE, "Error during getEncryptionKey call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -538,8 +547,8 @@ public final GetMerchantSettingsResponse getMerchantSettings(final String versio logger.log(Level.SEVERE, "Error during getMerchantSettings call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -572,8 +581,8 @@ public final GetTokenResponse getToken(final String cardNumber, final String exp logger.log(Level.SEVERE, "Error during getToken call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -605,8 +614,8 @@ public final UnBlockResponse unBlock(final String transactionID, final String tr logger.log(Level.SEVERE, "Error during unBlock call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -643,8 +652,8 @@ public final DoScoringChequeResponse doScoringCheque(final Cheque cheque, final logger.log(Level.SEVERE, "Error during doScoringCheque call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -682,8 +691,8 @@ public final DoReAuthorizationResponse doReAuthorization(final String transation logger.log(Level.SEVERE, "Error during doReAuthorization call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -722,8 +731,8 @@ public final VerifyAuthenticationResponse verifyAuthentication(final String cont logger.log(Level.SEVERE, "Error during verifyAuthentication call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; diff --git a/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java b/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java index 0508981..30f14db 100644 --- a/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java +++ b/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java @@ -26,6 +26,7 @@ import com.payline.ws.model.GetAlertDetailsResponse; import com.payline.ws.model.GetTransactionDetailsRequest; import com.payline.ws.model.GetTransactionDetailsResponse; +import com.payline.ws.model.ObjectFactory; import com.payline.ws.model.Result; import com.payline.ws.model.TransactionsSearchRequest; import com.payline.ws.model.TransactionsSearchResponse; @@ -40,6 +41,11 @@ public class ExtendedAPI extends WebServiceWrapper { * A Logger object is used to log messages */ private static final Logger logger = Logger.getLogger(ExtendedAPI.class.getName()); + + /** + * ObjectFactory is used to create result messages + */ + private ObjectFactory factory = null; /** * initFromFile @@ -57,6 +63,7 @@ public class ExtendedAPI extends WebServiceWrapper { */ public ExtendedAPI() { super(); + this.factory = new ObjectFactory(); } /** @@ -65,6 +72,7 @@ public ExtendedAPI() { */ public ExtendedAPI(ConnectParams connectParams) { super(); + this.factory = new ObjectFactory(); this.initFromFile = false; this.connectParams = connectParams; } diff --git a/src/main/java/com/payline/ws/wrapper/WalletPayment.java b/src/main/java/com/payline/ws/wrapper/WalletPayment.java index 027a6fe..2030e96 100644 --- a/src/main/java/com/payline/ws/wrapper/WalletPayment.java +++ b/src/main/java/com/payline/ws/wrapper/WalletPayment.java @@ -56,6 +56,7 @@ import com.payline.ws.model.GetWebWalletResponse; import com.payline.ws.model.ManageWebWalletRequest; import com.payline.ws.model.ManageWebWalletResponse; +import com.payline.ws.model.ObjectFactory; import com.payline.ws.model.Order; import com.payline.ws.model.Owner; import com.payline.ws.model.Payment; @@ -86,6 +87,11 @@ public class WalletPayment extends WebServiceWrapper { * A Logger object is used to log messages */ private static final Logger logger = Logger.getLogger(ExtendedAPI.class.getName()); + + /** + * ObjectFactory is used to create result messages + */ + private ObjectFactory factory = null; /** * initFromFile @@ -103,6 +109,7 @@ public class WalletPayment extends WebServiceWrapper { */ public WalletPayment() { super(); + this.factory = new ObjectFactory(); } /** @@ -111,6 +118,7 @@ public WalletPayment() { */ public WalletPayment(ConnectParams connectParams) { super(); + this.factory = new ObjectFactory(); this.initFromFile = false; this.connectParams = connectParams; } @@ -149,8 +157,8 @@ public final CreateWalletResponse createWallet(final Wallet wallet, final String logger.log(Level.SEVERE, "Error during createWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -185,8 +193,8 @@ public final GetWalletResponse getWallet(final String walletId, final String con logger.log(Level.SEVERE, "Error during getWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -226,8 +234,8 @@ public final UpdateWalletResponse updateWallet(final Wallet wallet, final String logger.log(Level.SEVERE, "Error during updateWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -260,8 +268,8 @@ public final DisableWalletResponse disableWallet(final WalletIdList walletIdList logger.log(Level.SEVERE, "Error during disableWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -295,8 +303,8 @@ public final EnableWalletResponse enableWallet(final String walletId, final Stri logger.log(Level.SEVERE, "Error during enableWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -359,8 +367,8 @@ public final DoImmediateWalletPaymentResponse doImmediateWalletPayment(final Pay logger.log(Level.SEVERE, "Error during doImmediateWalletPayment call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -407,8 +415,8 @@ public final DoScheduledWalletPaymentResponse doScheduledWalletPayment(final Pay logger.log(Level.SEVERE, "Error during doScheduledWalletPayment call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -456,8 +464,8 @@ public final DoRecurrentWalletPaymentResponse doRecurrentWalletPayment(final Pay logger.log(Level.SEVERE, "Error during doRecurrentWalletPayment call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -489,8 +497,8 @@ public final GetPaymentRecordResponse getPaymentRecord(final String contractNumb logger.log(Level.SEVERE, "Error during getPaymentRecord call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -526,8 +534,8 @@ public final UpdatePaymentRecordResponse updatePaymentRecord(final String versio logger.log(Level.SEVERE, "Error during updatePaymentRecord call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -559,8 +567,8 @@ public final DisablePaymentRecordResponse disablePaymentRecord(final String cont logger.log(Level.SEVERE, "Error during disablePaymentRecord call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -592,8 +600,8 @@ public final GetBillingRecordResponse getBillingRecord(final String contractNumb logger.log(Level.SEVERE, "Error during getBillingRecord call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -629,8 +637,8 @@ public final UpdateBillingRecordResponse updateBillingRecord(final String contra logger.log(Level.SEVERE, "Error during updateBillingRecord call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -699,8 +707,8 @@ public final CreateWebWalletResponse createWebWallet(final Buyer buyer, final Pr logger.log(Level.SEVERE, "Error during createWebWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -761,8 +769,8 @@ public final UpdateWebWalletResponse updateWebWallet(final String walletId, fina logger.log(Level.SEVERE, "Error during updateWebWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -822,8 +830,8 @@ public final ManageWebWalletResponse manageWebWallet(final String version, final logger.log(Level.SEVERE, "Error during manageWebWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -854,8 +862,8 @@ public final GetWebWalletResponse getWebWallet(final String token, final String logger.log(Level.SEVERE, "Error during getWebWallet call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -890,8 +898,8 @@ public final GetCardsResponse getCards(final String contractNumber, final String logger.log(Level.SEVERE, "Error during getCards call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; diff --git a/src/main/java/com/payline/ws/wrapper/WebPayment.java b/src/main/java/com/payline/ws/wrapper/WebPayment.java index f8c8f1d..17f3173 100644 --- a/src/main/java/com/payline/ws/wrapper/WebPayment.java +++ b/src/main/java/com/payline/ws/wrapper/WebPayment.java @@ -28,6 +28,7 @@ import com.payline.ws.model.DoWebPaymentResponse; import com.payline.ws.model.GetWebPaymentDetailsRequest; import com.payline.ws.model.GetWebPaymentDetailsResponse; +import com.payline.ws.model.ObjectFactory; import com.payline.ws.model.Order; import com.payline.ws.model.Payment; import com.payline.ws.model.PrivateDataList; @@ -46,6 +47,11 @@ public class WebPayment extends WebServiceWrapper { * A Logger object is used to log messages */ private static final Logger logger = Logger.getLogger(WebPayment.class.getName()); + + /** + * ObjectFactory is used to create result messages + */ + private ObjectFactory factory = null; /** * initFromFile @@ -62,6 +68,7 @@ public class WebPayment extends WebServiceWrapper { */ public WebPayment() { super(); + this.factory = new ObjectFactory(); } /** @@ -70,6 +77,7 @@ public WebPayment() { */ public WebPayment(ConnectParams connectParams) { super(); + this.factory = new ObjectFactory(); this.initFromFile = false; this.connectParams = connectParams; } @@ -100,8 +108,8 @@ public final GetWebPaymentDetailsResponse getWebPaymentDetails(final String toke logger.log(Level.SEVERE, "Error during getWebPaymentDetails call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; @@ -203,8 +211,8 @@ public final DoWebPaymentResponse doWebPayment(final String version, final Payme logger.log(Level.SEVERE, "Error during doWebPayment call : ", ex); Result err = new Result(); err.setCode(Utils.EXCEPTION_CODE); - err.setLongMessage(ex.getMessage()); - err.setShortMessage(ex.getMessage()); + err.setLongMessage(this.factory.createResultLongMessage(ex.getMessage())); + err.setShortMessage(this.factory.createResultShortMessage(Utils.EXCEPTION_SHORTMESSAGE)); result.setResult(err); } return result; diff --git a/src/main/resources/wsdls/v4.52.wsdl b/src/main/resources/wsdls/v4.52.wsdl new file mode 100644 index 0000000..eb197f1 --- /dev/null +++ b/src/main/resources/wsdls/v4.52.wsdl @@ -0,0 +1,3403 @@ + + + + + + + + + This element is the request for the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + This element is the reponse from the + getWebPayment + method + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthorization + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthorization method + + + + + + + + + + + + + + + + + + This element is the request for the + doCapture method + + + + + + + + + + + + + + + + + This element is the reponse from the + doCapture + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doRefund + method + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRefund method + + + + + + + + + + + + + This element is the request for the doReset + method + + + + + + + + + + + + + + + This element is the reponse from the doReset + method + + + + + + + + + + + + + This element is the request for the doCredit + method + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doCredit method + + + + + + + + + + + + + + + This element is the request for the + createWallet + method + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWallet + method + + + + + + + + + + + + + + + + This element is the request for the + updateWallet + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWallet + method + + + + + + + + + + + + + + + This element is the request for the + getWallet method + + + + + + + + + + + + + + + + This element is the reponse from the + getWallet + method + + + + + + + + + + + + + + + + + + + + This element is the request for the + getCards method + + + + + + + + + + + + + + + This element is the reponse from the + getCards method + + + + + + + + + + + + + + + This element is the request for the + disableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + disableWallet + method + + + + + + + + + + + + + This element is the request for the + enableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + enableWallet + method + + + + + + + + + + + + This element is the request for the + doImmediateWalletPayment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doImmediateWalletPayment method + + + + + + + + + + + + + + This element is the request for the + doScheduledWalletPayment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doScheduledWalletPayment method + + + + + + + + + + + + + This element is the request for the + doRecurrentWalletPayment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRecurrentWalletPayment method + + + + + + + + + + + + + + This element is the request for the + getPaymentRecord method + + + + + + + + + + + + + + This element is the reponse from the + getPaymentRecord method + + + + + + + + + + + + + + + + + + + This element is the request for the + disablePaymentRecord method + + + + + + + + + + + + + This element is the reponse from the + disablePaymentRecord method + + + + + + + + + + + + This element is the request for the + manageWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + manageWebWallet method + + + + + + + + + + + + + + This element is the request for the + createWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWebWallet method + + + + + + + + + + + + + + This element is the request for the + updateWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWebWallet method + + + + + + + + + + + + + + This element is the request for the + getWebWallet + method + + + + + + + + + + + + + This element is the reponse from the + getWebWallet + method + + + + + + + + + + + + + + + + + + + This element is the request for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + This element is the response for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + transactionsSearch method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the response for the + transactionsSearch method + + + + + + + + + + + + + This element is the request for the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthentication method + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthentication method + + + + + + + + + + + + + + This element is the request for the + doScoringCheque + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doScoringCheque method + + + + + + + + + + + + + + This element is the request for the + getEncryptionKeyRequest method + + + + + + + + + This element is the reponse from the + getEncryptionKeyResponse method + + + + + + + + + + + + + This element is the request for the + doReAuthorization method + + + + + + + + + + + + + + + + + This element is the reponse from the + doReAuthorization method + + + + + + + + + + + + + + + This element is the request for the + getMerchantSettings method + + + + + + + + + + + + This element is the response from the + getMerchantSettings method + + + + + + + + + + + + + + + + + + + This element is the request for the + getBalance + method + + + + + + + + + + + + + + This element is the reponse from the + getBalance + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doBankTransfer + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doBankTransfer method + + + + + + + + + + + + This element contains information about the + process + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + order + + + + + + + + + + + + + + + + + + + + + This element contains information about the + encryptionKey + + + + + + + + + + + + + This element contains an array of orderDetail + + + + + + + + + + + This element contains information about the + order + product + + + + + + + + + + + + + + + + + + + This element contains information about the + merchant + private data + + + + + + + + + + + This element contains information about the + transaction + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + fraud + result details + + + + + + + + + + + + This element contains information about the + payment + + + + + + + + + + + + + + + + + + This element contains information about the + authorization + + + + + + + + + + + This element contains information about the paymentData + + + + + + + + + + + + This element contains information about the card + + + + + + + + + + + + + + + + + + + + + This element contains information about the + buyer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + owner + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + This element contains information about the + capture + + + + + + + + + + + This element contains information about the + refund + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + An array of private data + + + + + + + + + + This element contains the result of the address verification service + + + + + + + + + + + An array of contract number of a wallet + + + + + + + + + + An array of cards + + + + + + + + + + This element contains element for recurring + operation + + + + + + + + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a billing + record + + + + + + + + + + + + + + + + + An array of billing record + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains element for a 3DSecure + transaction + + + + + + + + + + + + + + + + + + + This element contains the merchant connection + parameters + + + + + + + + + + + + + + This element contains the scoring cheque parameters + + + + + + + + + + + + + This element contains information about Interlocutor + address + + + + + + + + + + + + + + + This element contains information about Interlocutor + + + + + + + + + + + + + + + + This element contains IBAN information + + + + + + + + + + + + + This element contains RIB information + + + + + + + + + + + + This element contains bankAccount information + + + + + + + + + + + + + This element contains bank Account information + + + + + + + + + + + + + This element contains technical data used to define + acquirer service + + + + + + + + + + + + This element contains all information about contract + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains all information about + customPaymentPageCode + + + + + + + + + + + + This element contains information e-ticket + + + + + + + + + + + This element contains all information about point of + sell + + + + + + + Merchant Category Code + + + + + + + + + + + + + + + + + + + + list of contract + + + + + + + + + + + list of custom payment page code + + + + + + + + + + + + virtualTerminal + + + + + + http session timeout delay + + + + + path to logo + + + + + list of functions + + + + + + + + + + + + functions availbe in virtual terminal + + + + + + Please refer to Payline documentation + + + + + + + + + + + + + + + Value of parameter + + + + + Parameter ID. Refer to payline documentation + + + + + + + + + + + + This element contains information about the + cheque + + + + + + + + + + This element contains all information about + contrinution + + + + + + + + + + + + + + + This element contains information about the + associated transactions + + + + + + + + + + + + + + + + An array of associatedTransactions + + + + + + + + + + + This element contains information about the + status + History + + + + + + + + + + + + + + + + An array of statusHistory + + + + + + + + + + This element contains information about the + paymentAdditional + + + + + + + + + + + + + + + + An array of paymentAdditionalList + + + + + + + + + + + An array of CustomerTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of PaymentMeansTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of AlertsTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + creditor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file