diff --git a/src/main/java/com/payline/ws/wrapper/DirectPayment.java b/src/main/java/com/payline/ws/wrapper/DirectPayment.java index e773e30..2358cb9 100644 --- a/src/main/java/com/payline/ws/wrapper/DirectPayment.java +++ b/src/main/java/com/payline/ws/wrapper/DirectPayment.java @@ -124,7 +124,7 @@ public DirectPayment(ConnectParams connectParams) { * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param authentication3DSecure the authentication3DSecure object, filled with MD and PARES retrieved from the ACS after the customer entered his password * @param bank the bankAccountData object, used for ELV payment only - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return DoAuthorizationResponse the response given by Payline to a debit authorization request */ public final DoAuthorizationResponse doAuthorization(final Payment payment, final Order order, final Buyer buyer, final Card card, @@ -170,7 +170,7 @@ public final DoAuthorizationResponse doAuthorization(final Payment payment, fina * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param authentication3DSecure the authentication3DSecure object, filled with MD and PARES retrieved from the ACS after the customer entered his password * @param authorization the authorization - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return DoDebitResponse the response given by Payline to a debit request */ public final DoDebitResponse doDebit(final Payment payment, final Order order, final Buyer buyer, final Card card, final PrivateDataList privateDataList, @@ -214,7 +214,7 @@ public final DoDebitResponse doDebit(final Payment payment, final Order order, f * @param transationID the unique Payline transaction ID * @param orderID the unique Payline order id * @param comment the comment - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return DoBankTransferResponse */ public final DoBankTransferResponse doBankTransfer(final Payment payment, final Creditor creditor, final String transationID, final String orderID, @@ -295,10 +295,11 @@ public final DoCaptureResponse doCapture(final Payment payment, final String tra * @param comment the comment * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param sequenceNumber the transaction sequence number + * @param order the order info. Only details (cart content) is used for doRefund * @return DoRefundResponse the response given by Payline to a refund request */ public final DoRefundResponse doRefund(final Payment payment, final String transationID, final String comment, final PrivateDataList privateDataList, - final String sequenceNumber, final String version) { + final String sequenceNumber, final String version, final Order order) { setException(null); DoRefundResponse result = new DoRefundResponse(); DoRefundRequest parameters = new DoRefundRequest(); @@ -308,6 +309,7 @@ public final DoRefundResponse doRefund(final Payment payment, final String trans parameters.setSequenceNumber(sequenceNumber); parameters.setPrivateDataList(privateDataList); parameters.setVersion(version); + parameters.setDetails(order.getDetails()); DirectPaymentAPI port = null; try { if (this.initFromFile) { @@ -338,7 +340,7 @@ public final DoRefundResponse doRefund(final Payment payment, final String trans * @param buyer the buyer object, containing many information about the buyer: firstname, lastname, email, addresses,... * @param order the order object containing the ref, the amount, the currency, the date and cart content in details child * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return DoCreditResponse */ public final DoCreditResponse doCredit(final Payment payment, final Card card, final String comment, final Buyer buyer, final Order order, @@ -379,12 +381,12 @@ public final DoCreditResponse doCredit(final Payment payment, final Card card, f * @param payment the payment object containing the amount, the currency, action and mode codes * @param orderRef the order reference * @param UsrAgent the user Agent - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return VerifyEnrollmentResponse */ public final VerifyEnrollmentResponse verifyEnrollment(final Card card, final Payment payment, final String orderRef, final String UsrAgent, final String version) { - return this.verifyEnrollment(card, payment, orderRef, null, null, UsrAgent, version); + return this.verifyEnrollment(card, payment, orderRef, null, null, UsrAgent, version, null); } /** @@ -395,10 +397,12 @@ public final VerifyEnrollmentResponse verifyEnrollment(final Card card, final Pa * @param walletId the wallet identifier * @param walletCardInd the card index to use * @param UsrAgent the user Agent + * @param version the API version of Payline + * @param merchantName name displayed to buyer on 3D Secure authentication form * @return VerifyEnrollmentResponse */ public final VerifyEnrollmentResponse verifyEnrollment(final Card card, final Payment payment, final String orderRef, final String walletId, - final String walletCardInd, final String UsrAgent, final String version) { + final String walletCardInd, final String UsrAgent, final String version, final String merchantName) { setException(null); VerifyEnrollmentResponse result = new VerifyEnrollmentResponse(); VerifyEnrollmentRequest parameters = new VerifyEnrollmentRequest(); @@ -409,6 +413,8 @@ public final VerifyEnrollmentResponse verifyEnrollment(final Card card, final Pa parameters.setOrderRef(orderRef); parameters.setUserAgent(UsrAgent); parameters.setVersion(version); + parameters.setMerchantName(merchantName); + DirectPaymentAPI port = null; try { if (this.initFromFile) { @@ -591,7 +597,7 @@ public final GetTokenResponse getToken(final String cardNumber, final String exp /** * @param transactionID the unique Payline transaction ID * @param transactionDate the transaction date - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return UnBlockResponse */ public final UnBlockResponse unBlock(final String transactionID, final String transactionDate, final String version) { diff --git a/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java b/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java index 30f14db..879b437 100644 --- a/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java +++ b/src/main/java/com/payline/ws/wrapper/ExtendedAPI.java @@ -104,8 +104,8 @@ public final GetAlertDetailsResponse getAlertDetails(final String alertId, final logger.log(Level.SEVERE, "Error during getAlertDetails 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; @@ -119,7 +119,7 @@ public final GetAlertDetailsResponse getAlertDetails(final String alertId, final * @param startDate the Start date of the transaction search period * @param endDate the End date of the transaction search period * @param transactionHistory the status history for a given transaction - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return GetTransactionDetailsResponse */ public final GetTransactionDetailsResponse getTransactionDetails(final String orderRef, final String transactionID, final String startDate, @@ -146,8 +146,8 @@ public final GetTransactionDetailsResponse getTransactionDetails(final String or logger.log(Level.SEVERE, "Error during getTransactionDetails 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; @@ -214,8 +214,8 @@ public final TransactionsSearchResponse transactionsSearch(final String orderRef logger.log(Level.SEVERE, "Error during transactionsSearch 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/WalletPayment.java b/src/main/java/com/payline/ws/wrapper/WalletPayment.java index 2030e96..1a0d2a6 100644 --- a/src/main/java/com/payline/ws/wrapper/WalletPayment.java +++ b/src/main/java/com/payline/ws/wrapper/WalletPayment.java @@ -131,7 +131,7 @@ public WalletPayment(ConnectParams connectParams) { * @param contractNumber Payline identifier of your e-commerce contract number * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param authentication3DSecure the authentication3DSecure object, filled with MD and PARES retrieved from the ACS after the customer entered his password - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return CreateWalletResponse */ public final CreateWalletResponse createWallet(final Wallet wallet, final String contractNumber, final PrivateDataList privateDataList, @@ -169,7 +169,7 @@ public final CreateWalletResponse createWallet(final Wallet wallet, final String * @param walletId the wallet identifier * @param contractNumber Payline identifier of your e-commerce contract number * @param Cardind within a wallet, index of the card to be used for payment - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return GetWalletResponse */ public final GetWalletResponse getWallet(final String walletId, final String contractNumber, final String Cardind, final String version) { @@ -207,7 +207,7 @@ public final GetWalletResponse getWallet(final String walletId, final String con * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param authentication3DSecure the authentication3DSecure object, filled with MD and PARES retrieved from the ACS after the customer entered his password * @param Cardind within a wallet, index of the card to be used for payment - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return UpdateWalletResponse */ public final UpdateWalletResponse updateWallet(final Wallet wallet, final String contractNumber, final PrivateDataList privateDataList, @@ -319,7 +319,7 @@ public final EnableWalletResponse enableWallet(final String walletId, final Stri * @param walletId the wallet identifier * @param Cardind within a wallet, index of the card to be used for payment * @param cvx Card Verification Value associated to the Card Number - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return DoImmediateWalletPaymentResponse */ public final DoImmediateWalletPaymentResponse doImmediateWalletPayment(final Payment payment, final Order order, final Buyer buyer, @@ -506,7 +506,7 @@ public final GetPaymentRecordResponse getPaymentRecord(final String contractNumb /** * This web service modifies one or several settings for a payment record. - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @param contractNumber Payline identifier of your e-commerce contract number * @param paymentRecordId identifier of a payment record (a list of billing record) * @param recurring the recurring object, containing data about how Payline will deal with the recurring payment : first amount, other amount, number of @@ -778,7 +778,7 @@ public final UpdateWebWalletResponse updateWebWallet(final String walletId, fina /** * Manage a wallet from the web interface. - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @param contractNumber Payline identifier of your e-commerce contract number * @param selectedContractList a list of selectedContract objects, containing Payline identifier of your e-commerce contract number * @param updatePersonalDetails flag (0/1) to indicate whether customer can change his personal details (firstname, lastname,...) on update wallet page @@ -793,12 +793,13 @@ public final UpdateWebWalletResponse updateWebWallet(final String walletId, fina * @param privateDataList A list of privateData, allowing to send any kind of extra information organized with keys and values * @param customPaymentTemplateURL URL of the custom template * @param contractNumberWalletList a list of selectedContract objects, containing Payline identifier of your e-commerce contract number + * @param merchantName name displayed to buyer on 3D Secure authentication form * @return ManageWebWalletResponse */ public final ManageWebWalletResponse manageWebWallet(final String version, final String contractNumber, final SelectedContractList selectedContractList, final String updatePersonalDetails, final Buyer buyer, final Owner owner, final String languageCode, final String customPaymentPageCode, final String securityMode, final String returnURL, final String cancelURL, final String notificationURL, final PrivateDataList privateDataList, - final String customPaymentTemplateURL, final ContractNumberWalletList contractNumberWalletList) { + final String customPaymentTemplateURL, final ContractNumberWalletList contractNumberWalletList, final String merchantName) { setException(null); WebPaymentAPI port = null; ManageWebWalletResponse result = new ManageWebWalletResponse(); @@ -818,6 +819,7 @@ public final ManageWebWalletResponse manageWebWallet(final String version, final parameters.setPrivateDataList(privateDataList); parameters.setCustomPaymentTemplateURL(customPaymentTemplateURL); parameters.setContractNumberWalletList(contractNumberWalletList); + parameters.setMerchantName(merchantName); try { if (this.initFromFile) { port = Utils.initServiceWeb(); @@ -840,7 +842,7 @@ public final ManageWebWalletResponse manageWebWallet(final String version, final /** * This method is used to retrieve information from a virtual wallet created via the web interface * @param token identifier of a web payment, create/update wallet session - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @return GetWebWalletResponse */ public final GetWebWalletResponse getWebWallet(final String token, final String version) { diff --git a/src/main/java/com/payline/ws/wrapper/WebPayment.java b/src/main/java/com/payline/ws/wrapper/WebPayment.java index 17f3173..14984be 100644 --- a/src/main/java/com/payline/ws/wrapper/WebPayment.java +++ b/src/main/java/com/payline/ws/wrapper/WebPayment.java @@ -85,7 +85,7 @@ public WebPayment(ConnectParams connectParams) { /** * Get web payment results * @param token identifier of a web payment, create/update wallet session - * @param version, the API version of Payline : 13 corresponds to 4.45 release + * @param version, the API version of Payline * @return GetWebPaymentDetailsResponse the response from Payline to a request for the results of a web payment. */ public final GetWebPaymentDetailsResponse getWebPaymentDetails(final String token, final String version) { @@ -118,7 +118,7 @@ public final GetWebPaymentDetailsResponse getWebPaymentDetails(final String toke /** * Initialisation of a web payment The doWebPayment function initialises a web payment before redirecting your customer to Payline payment pages. * This allows immediate or deferred cash payments, X-time payments, and subscription payments to be made - * @param version the API version of Payline : 13 corresponds to 4.45 release + * @param version the API version of Payline * @param payment the payment object containing the amount, the currency, action and mode codes * @param order the order object containing the ref, the amount, the currency, the date and cart content in details child * @param buyer the buyer object, containing many information about the buyer: firstname, lastname, email, addresses,... @@ -134,12 +134,13 @@ public final GetWebPaymentDetailsResponse getWebPaymentDetails(final String toke * @param selectedContractList a list of selectedContract objects, containing Payline identifier of your e-commerce contract number * @param secondSelectedContractList the list of contract numbers you wish to present again after a first payment attempt has failed. * @param customPaymentTemplateURL URL of the custom template + * @param merchantName name displayed to buyer on 3D Secure authentication form * @return DoWebPaymentResponse the response given by Payline to a web payment initialisation request */ public final DoWebPaymentResponse doWebPayment(final String version, final Payment payment, final Order order, final Buyer buyer, final PrivateDataList privateDataList, final Recurring recurring, String notificationURL, String returnURL, String cancelURL, String languageCode, String securityMode, final String customPaymentPageCode, SelectedContractList selectedContractList, SelectedContractList secondSelectedContractList, - final String customPaymentTemplateURL) { + final String customPaymentTemplateURL, final String merchantName) { setException(null); DoWebPaymentResponse result = new DoWebPaymentResponse(); DoWebPaymentRequest parameters = new DoWebPaymentRequest(); @@ -198,6 +199,7 @@ public final DoWebPaymentResponse doWebPayment(final String version, final Payme parameters.setSelectedContractList(selectedContractList); parameters.setSecondSelectedContractList(secondSelectedContractList); + parameters.setMerchantName(merchantName); WebPaymentAPI port = null; try { if (this.initFromFile) {