diff --git a/README.md b/README.md
index e0ec815d..f2e22fc3 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ About Worldpay: Worldpay (formerly RBS WorldPay) is a payment processing company
The extension is crafted for SAP Commerce Cloud as well previous versions of what was formerly called Hybris.
## Release Information
-This release is tailored for SAP Commerce Cloud 2005. It is advised to use the latest release available in Github to get the benefits of newest development made to this extension.
+This release is tailored for SAP Commerce Cloud 2105. It is advised to use the latest release available in Github to get the benefits of newest development made to this extension.
# Installation and Usage
@@ -38,14 +38,36 @@ In order to install the AddOn using one of the recipes, run the following comman
HYBRIS_HOME/installer$ ./install.sh -r [RECIPE_NAME] perform
## RELEASE NOTES
-- A read/write socket connection timeout was configured in the library
+##Features:
+- SEPA Direct Debit has been integrated as an APM
+- Prime routing
+- Level2/3 Data
+- Request and response payloads are now saved into the Order
+- Fraud Sight Integration
+- Unprocessed order tickets are now linked to their order
+
+##Breaking changes:
+- Several POJO objects are now created as beans defined in a beans.xml file.
+- transformToInternalModel has been removed. New Converters/Populators per each one of the types that we have has been created and are used instead
+- Java Classes from the Worldpay's DTD are now generated with JAXB's xjc
+- The merchant configuration has been migrated to the data model:
+ 1. Every merchant.xml file has been deleted from the repository and sensitive data like passwords, macSecret are not visible anymore.
+ 2. New Types have been added into the DB definition: WorldpayMerchantConfiguration, WorldpayApplePayConfiguration, WorldpayGooglePayConfiguration, WorldpayThreeDS2JsonWebTokenConfiguration.
+ 3. New enumerations have been added into the DB definition: EnvironmentType, ApplePaySupportedNetworks, ApplePayMerchantCapabilities, GooglePayCardNetworks, GooglePayCardAuthMethods, ChallengePreference
+ 4. The Merchant Configuration can be found in the backoffice following the path: Worldpay → Merchant Configuration
+ 5. The Merchant Configuration is related to the Site. Every site will have now a new tab called Worldpay. Inside this type there is the section MERCHANT CONFIGURATION DETAILS in which you can find the new 3 attributes:
+ - Web Merchant Configuration
+ - ASM Merchant Configuration
+ - Replenishment Merchant Configuration
+- All of them are of the same type WorldpayMerchantConfiguration. This new configuration represents the old xml configuration of the merchant.xml file.
+
+##Bugs Fixed:
+- Fixed an issue related with date generation that was causing unprocessed order tickets not being created.
+- Fixed an issue that was causing customers being redirected to an incorrect HOP URL when using express checkout.
+- Fixed a NPE thrown on the summary step of the checkout when a paymentInfo has no bin number set.
+- Fixed an issue with Ideal that was making the successURL not being encrypted.
+- The profiletagaddon has been added to the project to fix a JSP file not found exception.
+- Fixed an issue related to the tax configuration that was causing an error in the Electronics site when paying with a saved card.
+- Fixed an issue related to the client side encryption that was causing an error when accessing to the payment details page.
+- Fixed an issue with Klarna where an invalid shopper locale was being set.
-- ypay-lib was updated to the latest DTD version
-
-- When upgrading to version 2011 redundant address converters were removed after ootb hybris populated the email
-
-- A bug was raised to fix hybris ootb causing an order process failure. Unnecessary user rights were removed and warehouse users were imported just for OMS. User rights were also moved to the common impex
-
-- Added obfuscated cart number, card expiry month and year in the order confirmation page and payment info for googlepay with spartacus
-
-- Fixed a bug related to saved cards for the b2b accelerator. The issue was caused by order placed with replenishment and card tokenized and saved in the step. The billing address was not saved in this case and it was causing the error when reusing the saved card.
diff --git a/YPAY-1823670290-300921-0935.pdf b/YPAY-1823670290-300921-0935.pdf
new file mode 100644
index 00000000..45fc9ccd
Binary files /dev/null and b/YPAY-1823670290-300921-0935.pdf differ
diff --git a/YPAY-902561797-180121-1453.pdf b/YPAY-902561797-180121-1453.pdf
deleted file mode 100644
index c696a8f9..00000000
Binary files a/YPAY-902561797-180121-1453.pdf and /dev/null differ
diff --git a/YPAY-SAPCommerce2011ConnectorR1.0-B2BTechnicalImplementationGuide-180121-1454.pdf b/YPAY-SAPCommerce2105ConnectorR1.0-B2BTechnicalImplementationGuide-300921-0935.pdf
similarity index 89%
rename from YPAY-SAPCommerce2011ConnectorR1.0-B2BTechnicalImplementationGuide-180121-1454.pdf
rename to YPAY-SAPCommerce2105ConnectorR1.0-B2BTechnicalImplementationGuide-300921-0935.pdf
index 2937c073..729441f8 100644
Binary files a/YPAY-SAPCommerce2011ConnectorR1.0-B2BTechnicalImplementationGuide-180121-1454.pdf and b/YPAY-SAPCommerce2105ConnectorR1.0-B2BTechnicalImplementationGuide-300921-0935.pdf differ
diff --git a/YPAY-SAPCommerce2011ConnectorR1.0-ImplementationGuide-180121-1454.pdf b/YPAY-SAPCommerce2105ConnectorR1.0-ImplementationGuide-300921-0935.pdf
similarity index 54%
rename from YPAY-SAPCommerce2011ConnectorR1.0-ImplementationGuide-180121-1454.pdf
rename to YPAY-SAPCommerce2105ConnectorR1.0-ImplementationGuide-300921-0935.pdf
index aff6a54c..e2e67f26 100644
Binary files a/YPAY-SAPCommerce2011ConnectorR1.0-ImplementationGuide-180121-1454.pdf and b/YPAY-SAPCommerce2105ConnectorR1.0-ImplementationGuide-300921-0935.pdf differ
diff --git a/YPAY-SAPCommerce2011ConnectorR1.0-OCCTechnicalImplementationGuide-180121-1454.pdf b/YPAY-SAPCommerce2105ConnectorR1.0-OCCTechnicalImplementationGuide-300921-0935.pdf
similarity index 84%
rename from YPAY-SAPCommerce2011ConnectorR1.0-OCCTechnicalImplementationGuide-180121-1454.pdf
rename to YPAY-SAPCommerce2105ConnectorR1.0-OCCTechnicalImplementationGuide-300921-0935.pdf
index dc4a0c5c..f0f7b4c1 100644
Binary files a/YPAY-SAPCommerce2011ConnectorR1.0-OCCTechnicalImplementationGuide-180121-1454.pdf and b/YPAY-SAPCommerce2105ConnectorR1.0-OCCTechnicalImplementationGuide-300921-0935.pdf differ
diff --git a/YPAY-SAPCommerce2011ConnectorR1.0-TechnicalImplementationGuide-180121-1454.pdf b/YPAY-SAPCommerce2105ConnectorR1.0-TechnicalImplementationGuide-300921-0947.pdf
similarity index 94%
rename from YPAY-SAPCommerce2011ConnectorR1.0-TechnicalImplementationGuide-180121-1454.pdf
rename to YPAY-SAPCommerce2105ConnectorR1.0-TechnicalImplementationGuide-300921-0947.pdf
index 532dc7dc..905137fe 100644
Binary files a/YPAY-SAPCommerce2011ConnectorR1.0-TechnicalImplementationGuide-180121-1454.pdf and b/YPAY-SAPCommerce2105ConnectorR1.0-TechnicalImplementationGuide-300921-0947.pdf differ
diff --git a/YPAY-SAPCommerceCloud2011ConnectorR1.0-Documentation-180121-1454.pdf b/YPAY-SAPCommerceCloud2011ConnectorR1.0-Documentation-180121-1454.pdf
deleted file mode 100644
index 40f98bc5..00000000
Binary files a/YPAY-SAPCommerceCloud2011ConnectorR1.0-Documentation-180121-1454.pdf and /dev/null differ
diff --git a/YPAY-SAPCommerceCloud2105ConnectorR1.0-Documentation-300921-0935.pdf b/YPAY-SAPCommerceCloud2105ConnectorR1.0-Documentation-300921-0935.pdf
new file mode 100644
index 00000000..32e243a5
Binary files /dev/null and b/YPAY-SAPCommerceCloud2105ConnectorR1.0-Documentation-300921-0935.pdf differ
diff --git a/YPAY-SettingupApplePayMerchantCertificates2011R1.0-180121-1454.pdf b/YPAY-SettingupApplePayMerchantCertificates2011R1.0-180121-1454.pdf
deleted file mode 100644
index 878ec4a4..00000000
Binary files a/YPAY-SettingupApplePayMerchantCertificates2011R1.0-180121-1454.pdf and /dev/null differ
diff --git a/YPAY-SettingupApplePayMerchantCertificates2105R1.0-300921-0935.pdf b/YPAY-SettingupApplePayMerchantCertificates2105R1.0-300921-0935.pdf
new file mode 100644
index 00000000..c7273156
Binary files /dev/null and b/YPAY-SettingupApplePayMerchantCertificates2105R1.0-300921-0935.pdf differ
diff --git a/YPAY-TestingApplePay2011R1.0-180121-1454.pdf b/YPAY-TestingApplePay2011R1.0-180121-1454.pdf
deleted file mode 100644
index 17f5c424..00000000
Binary files a/YPAY-TestingApplePay2011R1.0-180121-1454.pdf and /dev/null differ
diff --git a/YPAY-TestingApplePay2105R1.0-300921-0935.pdf b/YPAY-TestingApplePay2105R1.0-300921-0935.pdf
new file mode 100644
index 00000000..2faee04e
Binary files /dev/null and b/YPAY-TestingApplePay2105R1.0-300921-0935.pdf differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/GooglePayController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/GooglePayController.java
index 87334192..847eb07f 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/GooglePayController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/GooglePayController.java
@@ -16,7 +16,8 @@
import de.hybris.platform.commerceservices.strategies.CheckoutCustomerStrategy;
import de.hybris.platform.order.InvalidCartException;
import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -30,7 +31,7 @@
@RequestMapping(value = "/checkout/multi/worldpay/googlepay")
public class GooglePayController extends AbstractCheckoutController {
- private static final Logger LOG = Logger.getLogger(GooglePayController.class);
+ private static final Logger LOG = LoggerFactory.getLogger(GooglePayController.class);
@Resource
private WorldpayDirectOrderFacade worldpayDirectOrderFacade;
@@ -81,7 +82,7 @@ protected void setRegion(final AddressData addressData, final GooglePayAddressDa
if (region != null) {
addressData.setRegion(region);
} else {
- LOG.debug(MessageFormat.format("Failed to determine region from country {0} and region code {1}", countryIsoCode, administrativeArea));
+ LOG.debug("Failed to determine region from country {} and region code {}", countryIsoCode, administrativeArea);
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/WorldpayPaymentAPIController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/WorldpayPaymentAPIController.java
index dc733b35..3dc24373 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/WorldpayPaymentAPIController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/WorldpayPaymentAPIController.java
@@ -23,7 +23,8 @@
import de.hybris.platform.commerceservices.customer.DuplicateUidException;
import de.hybris.platform.order.InvalidCartException;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
@@ -42,7 +43,7 @@
@RequestMapping(value = "/checkout/worldpay/payment/api")
public class WorldpayPaymentAPIController extends WorldpayChoosePaymentMethodCheckoutStepController {
- private static final Logger LOGGER = Logger.getLogger(WorldpayPaymentAPIController.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(WorldpayPaymentAPIController.class);
@Resource
protected Validator cseFormValidator;
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepController.java
index 62d2b145..a97fc03b 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepController.java
@@ -30,6 +30,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
+import java.text.SimpleDateFormat;
+import java.util.Date;
/**
* Web controller to handle a CSE checkout step
@@ -38,7 +40,8 @@
@RequestMapping(value = "/checkout/multi/worldpay/cse")
public class WorldpayCseCheckoutStepController extends AbstractWorldpayDirectCheckoutStepController {
- protected static final Logger LOGGER = LogManager.getLogger(WorldpayCseCheckoutStepController.class);
+ private static final Logger LOGGER = LogManager.getLogger(WorldpayCseCheckoutStepController.class);
+
protected static final String CSE_PUBLIC_KEY = "csePublicKey";
protected static final String CSE_PAYMENT_FORM = "csePaymentForm";
protected static final String REDIRECT_TO_CSE_PAGE = "redirect:/checkout/multi/worldpay/cse/cse-data";
@@ -131,7 +134,7 @@ public String addCseData(final HttpServletRequest request, final Model model, @V
}
final CSEAdditionalAuthInfo cseAdditionalAuthInfo = createCSEAdditionalAuthInfo(csePaymentForm);
- final WorldpayAdditionalInfoData worldpayAdditionalInfoData = createWorldpayAdditionalInfo(request, csePaymentForm.getCvc(), cseAdditionalAuthInfo);
+ final WorldpayAdditionalInfoData worldpayAdditionalInfoData = createWorldpayAdditionalInfo(request, csePaymentForm, cseAdditionalAuthInfo);
return authoriseAndHandleResponse(model, cseAdditionalAuthInfo, worldpayAdditionalInfoData, response);
}
@@ -173,9 +176,11 @@ public String getChallengeIframeContent(final Model model) {
return worldpayAddonEndpointService.getChallengeIframe3dSecureFlex();
}
- protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServletRequest request, final String cvc, final CSEAdditionalAuthInfo cseAdditionalAuthInfo) {
+ protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServletRequest request, final CSEPaymentForm csePaymentForm, final CSEAdditionalAuthInfo cseAdditionalAuthInfo) {
final WorldpayAdditionalInfoData worldpayAdditionalInfo = worldpayAdditionalInfoFacade.createWorldpayAdditionalInfoData(request);
- worldpayAdditionalInfo.setSecurityCode(cvc);
+ worldpayAdditionalInfo.setDateOfBirth(csePaymentForm.getDateOfBirth());
+ worldpayAdditionalInfo.setSecurityCode(csePaymentForm.getCvc());
+ worldpayAdditionalInfo.setDeviceSession(csePaymentForm.getDeviceSession());
if (cseAdditionalAuthInfo.getAdditional3DS2() != null) {
worldpayAdditionalInfo.setAdditional3DS2(cseAdditionalAuthInfo.getAdditional3DS2());
}
@@ -188,7 +193,11 @@ protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServ
@Override
protected void setupAddPaymentPage(final Model model) throws CMSItemNotFoundException {
super.setupAddPaymentPage(model);
+
model.addAttribute(CSE_PAYMENT_FORM, new CSEPaymentForm());
+ model.addAttribute(IS_FS_ENABLED, worldpayPaymentCheckoutFacade.isFSEnabled());
+ final SimpleDateFormat dateFormat = new SimpleDateFormat(BIRTH_DAY_DATE_FORMAT);
+ model.addAttribute(CURRENT_DATE, dateFormat.format(new Date()));
model.addAttribute(CSE_PUBLIC_KEY, worldpayMerchantConfigDataFacade.getCurrentSiteMerchantConfigData().getCsePublicKey());
model.addAttribute(THREEDSFLEX_EVENT_ORIGIN_DOMAIN, worldpayDDCFacade.getEventOriginDomainForDDC());
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayHopResponseController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayHopResponseController.java
index fbd703b6..4f462095 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayHopResponseController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayHopResponseController.java
@@ -17,11 +17,12 @@
import de.hybris.platform.order.InvalidCartException;
import de.hybris.platform.payment.model.PaymentTransactionModel;
import de.hybris.platform.servicelayer.dto.converter.Converter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -31,7 +32,6 @@
import java.util.Set;
import static com.worldpay.enums.order.AuthorisedStatus.*;
-import static java.text.MessageFormat.format;
/**
* Web controller to handle HOP responses
@@ -40,7 +40,7 @@
@RequestMapping(value = "/checkout/multi/worldpay")
public class WorldpayHopResponseController extends WorldpayChoosePaymentMethodCheckoutStepController {
- private static final Logger LOG = Logger.getLogger(WorldpayHopResponseController.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpayHopResponseController.class);
private static final String REDIRECT_URL_ADD_DELIVERY_ADDRESS = REDIRECT_PREFIX + "/checkout/multi/delivery-address/add";
private static final String REDIRECT_URL_CHOOSE_DELIVERY_METHOD = REDIRECT_PREFIX + "/checkout/multi/delivery-method/choose";
@@ -76,7 +76,7 @@ public class WorldpayHopResponseController extends WorldpayChoosePaymentMethodCh
* @return
*/
@RequireHardLogIn
- @RequestMapping(value = "/hop-response", method = RequestMethod.GET)
+ @GetMapping(value = "/hop-response")
public String doHandleHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes) {
final Map requestParameterMap = getRequestParameterMap(request);
final RedirectAuthoriseResult response = extractAuthoriseResultFromRequest(request);
@@ -97,7 +97,7 @@ public String doHandleHopResponse(final HttpServletRequest request, final Model
* @return
*/
@RequireHardLogIn
- @RequestMapping(value = "/hop-pending", method = RequestMethod.GET)
+ @GetMapping(value = "/hop-pending")
public String doHandlePendingHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes) {
final Map requestParameterMap = getRequestParameterMap(request);
AuthorisedStatus paymentStatus = AuthorisedStatus.ERROR;
@@ -109,7 +109,7 @@ public String doHandlePendingHopResponse(final HttpServletRequest request, final
worldpayHostedOrderFacade.completeRedirectAuthorise(authoriseResult);
return placeOrderAndRedirect(model, redirectAttributes);
} else {
- LOG.error(format("Failed to create payment authorisation for successful hop-response (/hop-pending). Received {0}", paymentStatus.name()));
+ LOG.error("Failed to create payment authorisation for successful hop-response (/hop-pending). Received {}", paymentStatus);
}
}
return doHostedOrderPageError(paymentStatus.name(), redirectAttributes);
@@ -125,7 +125,7 @@ public String doHandlePendingHopResponse(final HttpServletRequest request, final
* @return
*/
@RequireHardLogIn
- @RequestMapping(value = "bank-transfer/hop-response", method = RequestMethod.GET)
+ @GetMapping(value = "bank-transfer/hop-response")
public String doHandleBankTransferHopResponse(@RequestParam(value = "orderId") final String orderId, final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes) {
if (!worldpayOrderCodeVerificationService.isValidEncryptedOrderCode(orderId)) {
redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name());
@@ -145,11 +145,10 @@ public String doHandleBankTransferHopResponse(@RequestParam(value = "orderId") f
* @return
*/
@RequireHardLogIn
- @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET)
+ @GetMapping(value = "bank-transfer/hop-failure")
public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) {
final Map requestParameterMap = getRequestParameterMap(request);
- LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap));
-
+ LOG.info("Failed to complete bank transfer for selected payment method. request params {}", requestParameterMap);
redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name());
return REDIRECT_URL_CHOOSE_PAYMENT_METHOD;
}
@@ -159,7 +158,7 @@ public String doHandleBankTransferHopFailure(final HttpServletRequest request, f
*
* @return the string
*/
- @RequestMapping(value = "/hop-cancel", method = RequestMethod.GET)
+ @GetMapping(value = "/hop-cancel")
@RequireHardLogIn
public String doCancelPayment() {
String redirectUrl = REDIRECT_URL_CHOOSE_PAYMENT_METHOD;
@@ -180,7 +179,7 @@ public String doCancelPayment() {
* @param redirectAttributes the {@link RedirectAttributes } to be used
* @return url for view
*/
- @RequestMapping(value = "/error", method = RequestMethod.GET)
+ @GetMapping(value = "/error")
@RequireHardLogIn
public String doHostedOrderPageError(@RequestParam(value = "paymentStatus", required = false) final String paymentStatus, final RedirectAttributes redirectAttributes) {
redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, paymentStatus != null ? paymentStatus : AuthorisedStatus.ERROR.name());
@@ -193,7 +192,7 @@ public String doHostedOrderPageError(@RequestParam(value = "paymentStatus", requ
* @param model the {@link Model} to be used
* @return
*/
- @RequestMapping(value = "/billingaddressform", method = RequestMethod.GET)
+ @GetMapping(value = "/billingaddressform")
public String getCountryAddressForm(@RequestParam("countryIsoCode") final String countryIsoCode,
@RequestParam("useDeliveryAddress") final boolean useDeliveryAddress, final Model model) {
model.addAttribute("supportedCountries", getCountries());
@@ -228,8 +227,9 @@ protected String processResponse(final Model model, final RedirectAttributes red
worldpayHostedOrderFacade.completeRedirectAuthorise(response);
return placeOrderAndRedirect(model, redirectAttributes);
} else {
- LOG.error(format("Failed to create payment authorisation for successful hop-response (/hop-response). Received {0}", paymentStatus.name()));
- return doHostedOrderPageError(paymentStatus.name(), redirectAttributes);
+ final String paymentStatusName = paymentStatus.name();
+ LOG.error("Failed to create payment authorisation for successful hop-response (/hop-response). Received {}", paymentStatusName);
+ return doHostedOrderPageError(paymentStatusName, redirectAttributes);
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepController.java
index b16749b5..236a773b 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepController.java
@@ -11,7 +11,8 @@
import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages;
import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
@@ -22,6 +23,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
+import java.util.Date;
/**
* Web controller to handle the Iframe in a checkout step
@@ -30,9 +32,11 @@
@RequestMapping(value = "/checkout/multi/worldpay/iframe")
public class WorldpayIframeCheckoutStepController extends WorldpayChoosePaymentMethodCheckoutStepController {
+ protected static final Logger LOGGER = LogManager.getLogger(WorldpayIframeCheckoutStepController.class);
+
protected static final String SHOW_NGPP_IFRAME = "showNGPPIframe";
protected static final String REDIRECT_CHECKOUT_MULTI_WORLDPAY_IFRAME_ADD_PAYMENT_DETAILS = REDIRECT_PREFIX + "/checkout/multi/worldpay/iframe/add-payment-details";
- private static final Logger LOGGER = Logger.getLogger(WorldpayIframeCheckoutStepController.class);
+
@Resource
protected WorldpayCartFacade worldpayCartFacade;
@Resource
@@ -71,7 +75,7 @@ public String addPaymentDetails(final Model model, @Valid final PaymentDetailsFo
}
try {
final AdditionalAuthInfo additionalAuthInfo = createAdditionalAuthInfo(paymentDetailsForm.getSaveInAccount(), paymentMethod);
- final PaymentData paymentData = worldpayHostedOrderFacade.redirectAuthorise(additionalAuthInfo, createWorldpayAdditionalInfo(httpServletRequest));
+ final PaymentData paymentData = worldpayHostedOrderFacade.redirectAuthorise(additionalAuthInfo, createWorldpayAdditionalInfo(httpServletRequest, paymentDetailsForm.getDateOfBirth()));
worldpayHostedOrderFacade.createPaymentInfoModelOnCart(paymentDetailsForm.getSaveInAccount());
redirectAttrs.addFlashAttribute(PAYMENT_DATA, paymentData);
redirectAttrs.addFlashAttribute(SHOW_NGPP_IFRAME, true);
@@ -83,8 +87,10 @@ public String addPaymentDetails(final Model model, @Valid final PaymentDetailsFo
return REDIRECT_CHECKOUT_MULTI_WORLDPAY_IFRAME_ADD_PAYMENT_DETAILS;
}
- protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServletRequest request) {
- return worldpayAdditionalInfoFacade.createWorldpayAdditionalInfoData(request);
+ protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final HttpServletRequest request, final Date dateOfBirth) {
+ final WorldpayAdditionalInfoData worldpayAdditionalInfoData = worldpayAdditionalInfoFacade.createWorldpayAdditionalInfoData(request);
+ worldpayAdditionalInfoData.setDateOfBirth(dateOfBirth);
+ return worldpayAdditionalInfoData;
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayKlarnaCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayKlarnaCheckoutStepController.java
index 65218c61..5a32f78f 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayKlarnaCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayKlarnaCheckoutStepController.java
@@ -10,11 +10,12 @@
import de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages;
import de.hybris.platform.order.InvalidCartException;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.annotation.Resource;
@@ -27,7 +28,9 @@
@Controller
@RequestMapping(value = "/checkout/multi/worldpay")
public class WorldpayKlarnaCheckoutStepController extends AbstractController {
- private static final Logger LOG = Logger.getLogger(WorldpayHopResponseController.class);
+
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpayKlarnaCheckoutStepController.class);
+
private static final String KLARNA_RESPONSE_PAGE_DATA_PARAM = "KLARNA_VIEW_DATA";
private static final String CHECKOUT_PLACE_ORDER_FAILED = "checkout.placeOrder.failed";
private static final String PAYMENT_STATUS_PARAMETER_NAME = "paymentStatus";
@@ -49,7 +52,7 @@ public class WorldpayKlarnaCheckoutStepController extends AbstractController {
* @param redirectAttributes
* @return
*/
- @RequestMapping(value = "/klarna/confirmation", method = RequestMethod.GET)
+ @GetMapping(value = "/klarna/confirmation")
@RequireHardLogIn
public String doHandleKlarnaConfirmation(final Model model, final RedirectAttributes redirectAttributes) {
try {
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayThreeDSecureEndpointController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayThreeDSecureEndpointController.java
index 0444f5ac..e38e0ebf 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayThreeDSecureEndpointController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/controllers/pages/checkout/steps/WorldpayThreeDSecureEndpointController.java
@@ -9,7 +9,8 @@
import com.worldpay.payment.TransactionStatus;
import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn;
import de.hybris.platform.order.InvalidCartException;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,7 +30,7 @@
@RequestMapping(value = "/checkout/multi/worldpay/3dsecure/sop/response")
public class WorldpayThreeDSecureEndpointController extends WorldpayChoosePaymentMethodCheckoutStepController {
- private static final Logger LOG = Logger.getLogger(WorldpayThreeDSecureEndpointController.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpayThreeDSecureEndpointController.class);
@Resource
protected WorldpayDirectOrderFacade worldpayDirectOrderFacade;
@@ -56,11 +57,11 @@ public String doHandleThreeDSecureResponse(final HttpServletRequest request, fin
if (AUTHORISED.equals(transactionStatus)) {
return redirectToOrderConfirmationPage(responseData.getOrderData());
} else {
- LOG.error(format("Failed to create payment authorisation for successful 3DSecure response. Received {0} as transactionStatus", transactionStatus));
+ LOG.error("Failed to create payment authorisation for successful 3DSecure response. Received {} as transactionStatus", transactionStatus);
worldpayCartService.setWorldpayDeclineCodeOnCart(worldpayOrderCode, responseData.getReturnCode());
}
} catch (WorldpayException | InvalidCartException e) {
- LOG.error(format("There was an error processing the 3d secure payment for order with worldpayOrderCode [{0}]", worldpayOrderCode), e);
+ LOG.error("There was an error processing the 3d secure payment for order with worldpayOrderCode [{}]", worldpayOrderCode, e);
}
redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, transactionStatus.toString());
return REDIRECT_URL_CHOOSE_PAYMENT_METHOD + "?" + PAYMENT_STATUS_PARAMETER_NAME + "=" + transactionStatus;
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/forms/validation/CseFormValidator.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/forms/validation/CseFormValidator.java
index ff71a69a..19f09109 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/forms/validation/CseFormValidator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/forms/validation/CseFormValidator.java
@@ -1,18 +1,27 @@
package com.worldpay.forms.validation;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.CSEPaymentForm;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
+import javax.annotation.Resource;
+import java.util.Date;
+
/**
* Class to validate if an object is of CSEPaymentForm
*/
-@Component ("cseFormValidator")
+@Component("cseFormValidator")
public class CseFormValidator implements Validator {
+
protected static final String GLOBAL_MISSING_CSE_TOKEN = "checkout.multi.paymentMethod.cse.invalid";
protected static final String CHECKOUT_ERROR_TERMS_NOT_ACCEPTED = "checkout.error.terms.not.accepted";
+ protected static final String CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY = "checkout.error.fraudSight.dob.mandatory";
+
+ @Resource
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacade;
@Override
public boolean supports(final Class> aClass) {
@@ -30,5 +39,19 @@ public void validate(final Object object, final Errors errors) {
if (!form.isTermsCheck()) {
errors.reject(CHECKOUT_ERROR_TERMS_NOT_ACCEPTED);
}
+
+ if (worldpayPaymentCheckoutFacade.isFSEnabled() && form.isDobRequired() && !isValidDate(form.getDateOfBirth())) {
+ errors.reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+ }
+
+ /**
+ * Checks if the birthday date is in the past
+ *
+ * @param birthdayDate the birthday date
+ * @return true if valid, false otherwise
+ */
+ protected boolean isValidDate(final Date birthdayDate) {
+ return birthdayDate != null && birthdayDate.before(new Date());
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/security/WorldpayCommerceRedirectStrategy.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/security/WorldpayCommerceRedirectStrategy.java
new file mode 100644
index 00000000..e5e3e93b
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/src/com/worldpay/security/WorldpayCommerceRedirectStrategy.java
@@ -0,0 +1,52 @@
+package com.worldpay.security;
+
+import de.hybris.platform.acceleratorfacades.flow.CheckoutFlowFacade;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.security.web.DefaultRedirectStrategy;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * A redirect strategy used in
+ * {@link de.hybris.platform.acceleratorstorefrontcommons.security.StorefrontAuthenticationSuccessHandler} to handle
+ * express checkout case.
+ */
+public class WorldpayCommerceRedirectStrategy extends DefaultRedirectStrategy {
+
+ private static final String EXPRESS_CHECKOUT_ENABLED = "expressCheckoutEnabled";
+
+ private final CheckoutFlowFacade checkoutFlowFacade;
+ private final String expressTargetUrl;
+
+ public WorldpayCommerceRedirectStrategy(final CheckoutFlowFacade checkoutFlowFacade, final String expressTargetUrl) {
+ this.checkoutFlowFacade = checkoutFlowFacade;
+ this.expressTargetUrl = expressTargetUrl;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void sendRedirect(final HttpServletRequest request, final HttpServletResponse response, final String url)
+ throws IOException {
+ super.sendRedirect(request, response, determineRedirectUrl(request, url));
+ }
+
+ /**
+ * Determine the redirect url depending on if express checkout is enabled and request has expressCheckoutEnabled parameter.
+ *
+ * @param request the request.
+ * @param originalUrl the original url.
+ * @return the calculated url.
+ */
+ protected String determineRedirectUrl(final HttpServletRequest request, final String originalUrl) {
+ if (checkoutFlowFacade.isExpressCheckoutEnabledForStore()
+ && StringUtils.isNotEmpty(request.getParameter(EXPRESS_CHECKOUT_ENABLED))) {
+ return expressTargetUrl;
+ } else {
+ return originalUrl;
+ }
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepControllerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepControllerTest.java
index 586f9e23..946ecc89 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepControllerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayCseCheckoutStepControllerTest.java
@@ -4,6 +4,7 @@
import com.worldpay.data.Additional3DS2Info;
import com.worldpay.data.CSEAdditionalAuthInfo;
import com.worldpay.exception.WorldpayException;
+import com.worldpay.facades.WorldpayCartFacade;
import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.facades.order.impl.WorldpayCheckoutFacadeDecorator;
import com.worldpay.facades.payment.WorldpayAdditionalInfoFacade;
@@ -47,6 +48,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collections;
+import java.util.Date;
import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.CMS_PAGE_MODEL;
import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayPaymentMethodCheckoutStepController.*;
@@ -82,6 +84,9 @@ public class WorldpayCseCheckoutStepControllerTest {
private static final String THREDSFLEX_DDC_PAGE = "ddcIframePage";
private static final String THREEDS_FLEX_CHALLENGE_IFRAME = "threeDSFlexIframePage";
private static final String THREEDSECURE_FLEX_DDC_URL_VALUE = "threeDSecureDDCUrlValue";
+ private static final Date CURRENT_DATE_VALUE = new Date();
+ private static final String DEVICE_SESSION = "device_session";
+ private static final String CURRENT_DATE = "currentDate";
@Spy
@InjectMocks
@@ -108,6 +113,8 @@ public class WorldpayCseCheckoutStepControllerTest {
private BindingResult bindingResultMock;
@Mock
private WorldpayDirectOrderFacade worldpayDirectOrderFacadeMock;
+ @Mock
+ private WorldpayCartFacade worldpayCartFacadeMock;
@Mock(name = "cseFormValidator")
private Validator cseFormValidatorMock;
@Mock(answer = RETURNS_DEEP_STUBS)
@@ -159,6 +166,7 @@ public class WorldpayCseCheckoutStepControllerTest {
@Mock
private HttpServletResponse responseMock;
+
@Before
public void setUp() throws CMSItemNotFoundException {
doNothing().when(testObj).handleAndSaveAddresses(paymentDetailsFormMock);
@@ -181,6 +189,7 @@ public void setUp() throws CMSItemNotFoundException {
when(pageTitleResolverMock.resolveContentPageTitle(anyString())).thenReturn(RESOLVED_PAGE_TITLE);
when(checkoutFacadeMock.hasCheckoutCart()).thenReturn(true);
when(worldpayAddonEndpointServiceMock.getCSEPaymentDetailsPage()).thenReturn(CSE_PAYMENT_DETAILS_PAGE);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
}
@Test
@@ -296,14 +305,27 @@ public void shouldCheckForValidCart() throws CMSItemNotFoundException {
}
@Test
- public void shouldAddCMSContentForPageToModel() throws CMSItemNotFoundException {
+ public void getCseDataPage_WhenFSEnabled_ShouldAddCMSContentForPageToModelAndFSAttributeTrue() throws CMSItemNotFoundException {
+ testObj.getCseDataPage(modelMock);
+
+ verify(modelMock).addAttribute(CMS_PAGE_MODEL, contentPageModelMock);
+ verify(modelMock).addAttribute(IS_FS_ENABLED, true);
+ verify(modelMock).addAttribute(eq(CURRENT_DATE), any(Date.class));
+ }
+
+ @Test
+ public void getCseDataPage_WhenFSDisabled_ShouldAddCMSContentForPageToModelAndFSAttributeFalse() throws CMSItemNotFoundException {
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(false);
+
testObj.getCseDataPage(modelMock);
verify(modelMock).addAttribute(CMS_PAGE_MODEL, contentPageModelMock);
+ verify(modelMock).addAttribute(IS_FS_ENABLED, false);
+ verify(modelMock).addAttribute(eq(CURRENT_DATE), any(Date.class));
}
@Test
- public void shouldAddCartToModel() throws CMSItemNotFoundException {
+ public void getCseDataPage_shouldAddCartToModel() throws CMSItemNotFoundException {
testObj.getCseDataPage(modelMock);
verify(modelMock).addAttribute(CART_DATA, cartDataMock);
@@ -347,11 +369,16 @@ public void shouldCreateWorldpayAdditionalInfo() {
when(cseAdditionalAuthInfoMock.getAdditional3DS2()).thenReturn(additional3DS2InfoMock);
when(cseAdditionalAuthInfoMock.getAdditional3DS2().getDfReferenceId()).thenReturn(ID_REFERENCE);
when(cseAdditionalAuthInfoMock.getAdditional3DS2().getChallengeWindowSize()).thenReturn(WINDOW_SIZE);
+ when(csePaymentFormMock.getDateOfBirth()).thenReturn(CURRENT_DATE_VALUE);
+ when(csePaymentFormMock.getDeviceSession()).thenReturn(DEVICE_SESSION);
+ when(csePaymentFormMock.getCvc()).thenReturn(CVC);
- testObj.createWorldpayAdditionalInfo(httpServletRequestMock, CVC, cseAdditionalAuthInfoMock);
+ testObj.createWorldpayAdditionalInfo(httpServletRequestMock, csePaymentFormMock, cseAdditionalAuthInfoMock);
verify(worldpayAdditionalInfoFacadeMock).createWorldpayAdditionalInfoData(httpServletRequestMock);
verify(worldpayAdditionalInfoDataMock).setSecurityCode(CVC);
+ verify(worldpayAdditionalInfoDataMock).setDateOfBirth(CURRENT_DATE_VALUE);
+ verify(worldpayAdditionalInfoDataMock).setDeviceSession(DEVICE_SESSION);
verify(worldpayAdditionalInfoDataMock).setAdditional3DS2(additional3DS2InfoMock);
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepControllerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepControllerTest.java
index 7438e9a0..4555693b 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepControllerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayIframeCheckoutStepControllerTest.java
@@ -27,6 +27,8 @@
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
+import java.util.Calendar;
+import java.util.Date;
import static java.util.Collections.singleton;
import static org.junit.Assert.assertEquals;
@@ -45,6 +47,7 @@ public class WorldpayIframeCheckoutStepControllerTest {
private static final String SHOW_NGPP_IFRAME = "showNGPPIframe";
private static final String REDIRECT_PREFIX = "redirect:";
private static final String REDIRECT_CHECKOUT_MULTI_WORLDPAY_IFRAME_ADD_PAYMENT_DETAILS = REDIRECT_PREFIX + "/checkout/multi/worldpay/iframe/add-payment-details";
+ private static final Date BIRTHDAY_DATE_VALUE = new Date(1990, Calendar.MAY, 17);
private static final String PAYMENT_DATA = "paymentData";
private static final String SHOPPER_BANK_CODE = "shopperBankCode";
@@ -122,6 +125,7 @@ public void addPaymentDetailsShouldReturnIframePageWithSaveInAccountSetAsTrue()
public void addPaymentDetailsShouldReturnIframePageWithSaveInAccountSetAsFalse() throws WorldpayException, CMSItemNotFoundException {
when(worldpayHostedOrderFacadeMock.redirectAuthorise(additionalAuthInfoMock, worldpayAdditionalInfoDataMock)).thenReturn(paymentDataMock);
when(worldpayAdditionalInfoFacadeMock.createWorldpayAdditionalInfoData(any())).thenReturn(worldpayAdditionalInfoDataMock);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(BIRTHDAY_DATE_VALUE);
final String result = testObj.addPaymentDetails(modelMock, paymentDetailsFormMock, httpServletRequestMock, bindingResultMock, redirectAttrbsMock);
@@ -132,6 +136,7 @@ public void addPaymentDetailsShouldReturnIframePageWithSaveInAccountSetAsFalse()
verify(redirectAttrbsMock).addFlashAttribute(SHOW_NGPP_IFRAME, true);
verify(paymentDetailsFormValidatorMock).validate(paymentDetailsFormMock, bindingResultMock);
verify(worldpayHostedOrderFacadeMock).createPaymentInfoModelOnCart(Boolean.FALSE);
+ verify(worldpayAdditionalInfoDataMock).setDateOfBirth(BIRTHDAY_DATE_VALUE);
assertEquals(REDIRECT_CHECKOUT_MULTI_WORLDPAY_IFRAME_ADD_PAYMENT_DETAILS, result);
}
@@ -139,6 +144,7 @@ public void addPaymentDetailsShouldReturnIframePageWithSaveInAccountSetAsFalse()
public void addPaymentDetailsShouldReturnBillingPageWithErrors() throws WorldpayException, CMSItemNotFoundException {
when(worldpayHostedOrderFacadeMock.redirectAuthorise(additionalAuthInfoMock, worldpayAdditionalInfoDataMock)).thenThrow(new WorldpayException(EXCEPTION_MESSAGE));
when(worldpayAdditionalInfoFacadeMock.createWorldpayAdditionalInfoData(any())).thenReturn(worldpayAdditionalInfoDataMock);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(BIRTHDAY_DATE_VALUE);
final String result = testObj.addPaymentDetails(modelMock, paymentDetailsFormMock, httpServletRequestMock, bindingResultMock, redirectAttrbsMock);
@@ -149,6 +155,7 @@ public void addPaymentDetailsShouldReturnBillingPageWithErrors() throws Worldpay
verify(redirectAttrbsMock, never()).addFlashAttribute(eq(PAYMENT_METHOD_PARAM), any());
verify(redirectAttrbsMock, never()).addFlashAttribute(eq(SHOPPER_BANK_CODE), any());
verify(redirectAttrbsMock).addFlashAttribute(SHOW_NGPP_IFRAME, false);
+ verify(worldpayAdditionalInfoDataMock).setDateOfBirth(BIRTHDAY_DATE_VALUE);
assertEquals(REDIRECT_CHECKOUT_MULTI_WORLDPAY_IFRAME_ADD_PAYMENT_DETAILS, result);
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/facades/impl/DefaultAPMAvailabilityFacadeTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/facades/impl/DefaultAPMAvailabilityFacadeTest.java
index e8913e95..e0bb3490 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/facades/impl/DefaultAPMAvailabilityFacadeTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/facades/impl/DefaultAPMAvailabilityFacadeTest.java
@@ -1,5 +1,6 @@
package com.worldpay.facades.impl;
+import com.worldpay.core.services.APMConfigurationLookupService;
import com.worldpay.model.WorldpayAPMConfigurationModel;
import com.worldpay.service.apm.APMAvailabilityService;
import de.hybris.bootstrap.annotations.UnitTest;
@@ -23,13 +24,16 @@ public class DefaultAPMAvailabilityFacadeTest {
private DefaultAPMAvailabilityFacade testObj;
@Mock
- private WorldpayAPMConfigurationModel apmConfigurationMock;
+ private APMAvailabilityService apmAvailabilityServiceMock;
+ @Mock
+ private APMConfigurationLookupService apmConfigurationLookupServiceMock;
@Mock
private CartService cartServiceMock;
+
@Mock
- private CartModel cartModelMock;
+ private WorldpayAPMConfigurationModel apmConfigurationMock;
@Mock
- private APMAvailabilityService apmAvailabilityServiceMock;
+ private CartModel cartModelMock;
@Test
public void isAvailableInvokesApmAvailabilityService() {
@@ -42,4 +46,4 @@ public void isAvailableInvokesApmAvailabilityService() {
verify(apmAvailabilityServiceMock).isAvailable(apmConfigurationMock, cartModelMock);
}
-}
\ No newline at end of file
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/forms/validation/CseFormValidatorTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/forms/validation/CseFormValidatorTest.java
index b0aecfc5..0db7f841 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/forms/validation/CseFormValidatorTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/forms/validation/CseFormValidatorTest.java
@@ -1,7 +1,9 @@
package com.worldpay.forms.validation;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.CSEPaymentForm;
import de.hybris.bootstrap.annotations.UnitTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
@@ -9,21 +11,34 @@
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.validation.Errors;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static org.mockito.Mockito.*;
@UnitTest
-@RunWith (MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class CseFormValidatorTest {
- public static final String CSE_TOKEN = "cseToken";
+ private static final String CSE_TOKEN = "cseToken";
+ private static final String BIRTH_DAY_DATE_FORMAT = "dd/MM/yyyy";
+ private static final String CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY = "checkout.error.fraudSight.dob.mandatory";
+
@InjectMocks
private CseFormValidator testObj = new CseFormValidator();
+
@Mock
private Errors errorsMock;
@Mock
private CSEPaymentForm csePaymentFormMock;
+ @Mock
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacadeMock;
+
+ @Before
+ public void setUp() {
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
+ when(csePaymentFormMock.isDobRequired()).thenReturn(true);
+ }
@Test
public void shouldNotRejectIfCseIsSet() throws Exception {
@@ -60,4 +75,43 @@ public void shouldRejectIfTermsIsNotChecked() throws Exception {
verify(errorsMock).reject(CseFormValidator.CHECKOUT_ERROR_TERMS_NOT_ACCEPTED);
}
-}
\ No newline at end of file
+
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNull_ShouldAddTheError() {
+ when(csePaymentFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(csePaymentFormMock, errorsMock);
+
+ verify(errorsMock).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsDisabledAndBirthdayDateNull_ShouldNotAddTheError() {
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(false);
+ when(csePaymentFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(csePaymentFormMock, errorsMock);
+
+ verify(errorsMock, never()).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNullAndDobNotRequired_ShouldNotAddTheError() {
+ when(csePaymentFormMock.isDobRequired()).thenReturn(false);
+ when(csePaymentFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(csePaymentFormMock, errorsMock);
+
+ verify(errorsMock, never()).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNotInThePast_ShouldAddTheError() throws ParseException {
+ final SimpleDateFormat df = new SimpleDateFormat(BIRTH_DAY_DATE_FORMAT);
+ when(csePaymentFormMock.getDateOfBirth()).thenReturn(df.parse("21/10/2100"));
+
+ testObj.validate(csePaymentFormMock, errorsMock);
+
+ verify(errorsMock).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/security/WorldpayCommerceRedirectStrategyTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/security/WorldpayCommerceRedirectStrategyTest.java
new file mode 100644
index 00000000..ff4960be
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/testsrc/com/worldpay/security/WorldpayCommerceRedirectStrategyTest.java
@@ -0,0 +1,72 @@
+package com.worldpay.security;
+
+import de.hybris.bootstrap.annotations.UnitTest;
+import de.hybris.platform.acceleratorfacades.flow.CheckoutFlowFacade;
+import org.apache.logging.log4j.util.Strings;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+@UnitTest
+@RunWith(MockitoJUnitRunner.class)
+public class WorldpayCommerceRedirectStrategyTest {
+
+ private static final String EXPRESS_CHECKOUT_ENABLED = "expressCheckoutEnabled";
+ private static final String EXPRESS_CHECKOUT_ENABLED_TRUE = "True";
+ private static final String DEFAULT_URL = "defaultUrl";
+ private static final String EXPRESS_CHECKOUT_URL = "expressCheckoutUrl";
+
+ @InjectMocks
+ private WorldpayCommerceRedirectStrategy testObj;
+
+ @Mock
+ private CheckoutFlowFacade checkoutFlowFacadeMock;
+
+ @Mock
+ private HttpServletRequest requestMock;
+ @Mock
+ private HttpServletResponse responseMock;
+
+ @Before
+ public void setUp() {
+ testObj = new WorldpayCommerceRedirectStrategy(checkoutFlowFacadeMock, EXPRESS_CHECKOUT_URL);
+
+ when(checkoutFlowFacadeMock.isExpressCheckoutEnabledForStore()).thenReturn(Boolean.TRUE);
+ when(requestMock.getParameter(EXPRESS_CHECKOUT_ENABLED)).thenReturn(EXPRESS_CHECKOUT_ENABLED_TRUE);
+ }
+
+ @Test
+ public void sendRedirect_WhenExpressCheckoutIsNotEnabledForStore_ShouldNotChangeUrl() throws IOException {
+ when(checkoutFlowFacadeMock.isExpressCheckoutEnabledForStore()).thenReturn(Boolean.FALSE);
+
+ testObj.sendRedirect(requestMock, responseMock, DEFAULT_URL);
+
+ assertThat(testObj.determineRedirectUrl(requestMock, DEFAULT_URL)).isEqualTo(DEFAULT_URL);
+ }
+
+ @Test
+ public void sendRedirect_WhenHasNotExpressCheckoutEnabledParameter_ShouldNotChangeUrl() throws IOException {
+ when(requestMock.getParameter(EXPRESS_CHECKOUT_ENABLED)).thenReturn(Strings.EMPTY);
+
+ testObj.sendRedirect(requestMock, responseMock, DEFAULT_URL);
+
+ assertThat(testObj.determineRedirectUrl(requestMock, DEFAULT_URL)).isEqualTo(DEFAULT_URL);
+ }
+
+ @Test
+ public void sendRedirect_WhenExpressCheckoutIsNotEnabledForStoreAndHasExpressCheckoutEnabledParameter_ShouldChangeUrl() throws IOException {
+ testObj.sendRedirect(requestMock, responseMock, DEFAULT_URL);
+
+ assertThat(testObj.determineRedirectUrl(requestMock, DEFAULT_URL)).isEqualTo(EXPRESS_CHECKOUT_URL);
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/messages/base.properties b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/messages/base.properties
index 4d0c0106..e9e513b6 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/messages/base.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/messages/base.properties
@@ -74,3 +74,7 @@ checkout.multi.3dsecure.autosubmit.form.text2=After you successfully identify yo
form.required=Fields marked * are required
checkout.billing.address.page.global.field.error=Some fields were not filled in correctly. Please check your details are correct
+
+payment.dateOfBirth = Date of birth
+
+checkout.error.fraudSight.dob.mandatory = Date of birth is mandatory and must be in the past
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/dateOfBirthInput.tag b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/dateOfBirthInput.tag
new file mode 100644
index 00000000..fcde51ca
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/dateOfBirthInput.tag
@@ -0,0 +1,22 @@
+<%@ tag trimDirectiveWhitespaces="true" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/worldpayCSECardDetails.tag b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/worldpayCSECardDetails.tag
index 4265df5f..71bdd1c7 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/worldpayCSECardDetails.tag
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/WEB-INF/tags/responsive/checkout/multi/worldpayCSECardDetails.tag
@@ -1,5 +1,7 @@
<%@ tag trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="wp-multi-checkout" tagdir="/WEB-INF/tags/addons/worldpayaddon/responsive/checkout/multi" %>
@@ -16,7 +18,25 @@
-
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayCollector.js b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayCollector.js
new file mode 100644
index 00000000..240530b3
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayCollector.js
@@ -0,0 +1,43 @@
+var threatmetrix = threatmetrix || {};
+threatmetrix.version = 3, threatmetrix.create_url = function(t, e, r, n, a) {
+ function i() { return Math.floor(2742745743359 * Math.random()) }
+
+ function c() { return o(i()) }
+
+ function o(t) { return (t + 78364164096).toString(36) }
+ var m = i(),
+ u = i(),
+ l = 885187064159;
+ u = ((u = u - u % 256 + threatmetrix.version) + m) % 2742745743359, l = (l + m) % 2742745743359;
+ var s = "https://" + t + "/" + (m = c() + o(m)) + e,
+ h = [(u = o(l) + o(u)) + "=" + r, c() + c() + "=" + n];
+ return void 0 !== a && a.length > 0 && h.push(c() + c() + "=" + a), s + "?" + h.join("&")
+}, threatmetrix.beacon = function(t, e, r, n) {
+ var a = "turn:aa.online-metrix.net?transport=",
+ i = "1:" + e + ":" + r,
+ c = { iceServers: [{ urls: a + "tcp", username: i, credential: r }, { urls: a + "udp", username: i, credential: r }] };
+ try {
+ var o = new RTCPeerConnection(c);
+ o.createDataChannel(Math.random().toString());
+ var m = function() {},
+ u = function(t) { o.setLocalDescription(t, m, m) };
+ "undefined" == typeof Promise || o.createOffer.length > 0 ? o.createOffer(u, m) : o.createOffer().then(u, m)
+ } catch (t) {}
+}, threatmetrix.load_tags = function(t, e, r, n) {
+ threatmetrix.beacon(t, e, r, n);
+ var a = document.getElementsByTagName("head").item(0),
+ i = document.createElement("script");
+ i.id = "tmx_tags_js", i.setAttribute("type", "text/javascript");
+ var c = threatmetrix.create_url(t, ".js", e, r, n);
+ i.setAttribute("src", c), threatmetrix.set_csp_nonce(i), a.appendChild(i)
+}, threatmetrix.load_iframe_tags = function(t, e, r, n) {
+ threatmetrix.beacon(t, e, r, n);
+ var a = threatmetrix.create_url(t, ".htm", e, r, n),
+ i = document.createElement("iframe");
+ i.title = "empty", i.setAttribute("aria-disabled", "true"), i.width = "0", i.height = "0", i.setAttribute("style", "color:rgba(0,0,0,0); float:left; position:absolute; top:-200; left:-200; border:0px"), i.setAttribute("src", a), document.body.appendChild(i)
+}, threatmetrix.csp_nonce = null, threatmetrix.register_csp_nonce = function(t) {
+ if (void 0 !== t.currentScript && null !== t.currentScript) {
+ var e = t.currentScript.getAttribute("nonce");
+ void 0 !== e && null !== e && "" !== e ? threatmetrix.csp_nonce = e : void 0 !== t.currentScript.nonce && null !== t.currentScript.nonce && "" !== t.currentScript.nonce && (threatmetrix.csp_nonce = t.currentScript.nonce)
+ }
+}, threatmetrix.set_csp_nonce = function(t) { null !== threatmetrix.csp_nonce && (t.setAttribute("nonce", threatmetrix.csp_nonce), t.getAttribute("nonce") !== threatmetrix.csp_nonce && (t.nonce = threatmetrix.csp_nonce)) }, threatmetrix.cleanup = function() { for (; null !== (hp_frame = document.getElementById("tdz_ifrm"));) hp_frame.parentElement.removeChild(hp_frame); for (; null !== (tmx_frame = document.getElementById("tmx_tags_iframe"));) tmx_frame.parentElement.removeChild(tmx_frame); for (; null !== (tmx_script = document.getElementById("tmx_tags_js"));) tmx_script.parentElement.removeChild(tmx_script) }, threatmetrix.prfl = function(t, e, r, n) { threatmetrix.cleanup(), threatmetrix.register_csp_nonce(document), threatmetrix.load_tags(t, e, r, n) }, threatmetrix.prfl_iframe = function(t, e, r, n) { threatmetrix.cleanup(), threatmetrix.register_csp_nonce(document), threatmetrix.load_iframe_tags(t, e, r, n) };
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddon.js b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddon.js
index e6f5bcbd..73db8ef4 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddon.js
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddon.js
@@ -7,6 +7,7 @@ ACC.worldpay = {
"populateDeclineCodeTimeout",
"hideOrShowSaveDetails",
"bindBanks",
+ ["bindDOBInput", ACC.isFSEnabled === 'true'],
"checkPreviouslySelectedPaymentMethod",
"onPaymentMethodChange"
],
@@ -119,6 +120,7 @@ ACC.worldpay = {
setTimeout(function () {
populateDeclineCode();
}, waitTimer);
+
function populateDeclineCode() {
$.ajax({
url: ACC.config.encodedContextPath + "/checkout/multi/worldpay/choose-payment-method/getDeclineMessage",
@@ -247,6 +249,24 @@ ACC.worldpay = {
});
},
+ bindDOBInput: function () {
+ $('.cms-payment-button').on('change', function () {
+ var selectedCard = $('[name="paymentMethod"]:checked');
+ if (selectedCard.attr('id') === 'paymentMethod_CC') {
+ $('#dobElement').removeClass('hidden');
+ $('#dobRequired').val(true);
+ } else {
+ $('#dobElement').addClass('hidden');
+ $('#dobRequired').val(false);
+ }
+ });
+
+ if ($('[id="paymentMethod_CC"]:checked').length > 0) {
+ $('#dobElement').removeClass('hidden');
+ $('#dobRequired').val(ACC.isFSEnabled);
+ }
+ },
+
onPaymentMethodChange: function () {
const checkboxes = $('[name="paymentMethod"]');
checkboxes.on('change', function (event) {
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddonCSE.js b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddonCSE.js
index 498fb57d..20890643 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddonCSE.js
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/acceleratoraddon/web/webroot/_ui/responsive/common/js/worldpayaddonCSE.js
@@ -6,7 +6,8 @@ ACC.worldpayCSE = {
"bindPaymentButtons",
"bindMessageEventListener",
"fillResolutionForWindowChallenge",
- "bindPlaceOrderForm"
+ "bindPlaceOrderForm",
+ ["performJsc", $("#worldpayCsePaymentForm").length > 0 && ACC.isFSEnabled === 'true']
],
errorCodeMap: {},
@@ -23,7 +24,6 @@ ACC.worldpayCSE = {
const encryptedData = Worldpay.encrypt(data, ACC.worldpayCSE.errorHandler);
if (encryptedData) {
$("#encryptedData").val(encryptedData);
- $("#DDCIframe").contents().find('#collectionForm').submit();
return true;
} else {
return false;
@@ -128,7 +128,7 @@ ACC.worldpayCSE = {
return xhr;
},
success: function (res) {
- if (xhr.getResponseHeader('3D-Secure-Flow') === "false" || !xhr.getResponseHeader('3D-Secure-Flow')) {
+ if (xhr.getResponseHeader('3D-Secure-Flow') === "false" || !xhr.getResponseHeader('3D-Secure-Flow')) {
$('body').html(res);
window.scrollTo(0, 0);
} else {
@@ -164,6 +164,26 @@ ACC.worldpayCSE = {
}, false);
},
+ performJsc: function () {
+ let ndownc = ACC.worldpayCSE.create_uuid(); //that’s the sessionId
+ let div = $('#worldpayCsePaymentForm'); //suggestion how you can store sessionId for when you need it in payment request
+ let input = document.createElement('input');
+ input.setAttribute('type', 'hidden');
+ input.setAttribute('id', 'deviceSession');
+ input.setAttribute('name', 'deviceSession');
+ input.setAttribute('value', ndownc);
+ div.append(input);
+ threatmetrix.prfl(ACC.profilingDomain, ACC.organizationId, ndownc, 1); // Jsc.prfl is the renamed function
+ },
+
+ create_uuid: function () {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+ var r = Math.random() * 16 | 0,
+ v = c === 'x' ? r : (r & 0x3 | 0x8);
+ return v.toString(16);
+ });
+ },
+
populateErrorCodeMap: function () {
ACC.worldpayCSE.errorCodeMap["101"] = "error-number";
ACC.worldpayCSE.errorCodeMap["102"] = "error-number";
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties
index cc657b66..cd974110 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties
@@ -1,4 +1,4 @@
-#Mon, 18 Jan 2021 14:19:01 +0000
+#Wed, 29 Sep 2021 10:46:17 +0000
# -----------------------------------------------------------------------
# [y] hybris Platform
#
@@ -30,7 +30,7 @@ storefront.supportedUiExperienceLevels.powertools=DESKTOP,MOBILE
# Set the HOP PCI strategy at this level so that it's consistent across stores
hop.pci.strategy.enabled=true
-worldpayaddon.javascript.paths.responsive=/responsive/common/js/worldpayaddon.js;/responsive/common/js/worldpayaddonCSE.js;/responsive/common/js/worldpayaddonRedirect.js;/responsive/common/js/worldpayGooglePay.js;/responsive/common/js/worldpayApplePay.js
+worldpayaddon.javascript.paths.responsive=/responsive/common/js/worldpayaddon.js;/responsive/common/js/worldpayaddonCSE.js;/responsive/common/js/worldpayaddonRedirect.js;/responsive/common/js/worldpayGooglePay.js;/responsive/common/js/worldpayApplePay.js;/responsive/common/js/worldpayCollector.js
worldpayaddon.css.paths.responsive=/responsive/common/css/worldpayaddon.css
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties.template b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties.template
index edc926df..2afa2dbb 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties.template
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/project.properties.template
@@ -34,7 +34,8 @@ worldpayaddon.javascript.paths.responsive=\
/responsive/common/js/worldpayaddonCSE.js;\
/responsive/common/js/worldpayaddonRedirect.js;\
/responsive/common/js/worldpayGooglePay.js;\
- /responsive/common/js/worldpayApplePay.js
+ /responsive/common/js/worldpayApplePay.js;\
+ /responsive/common/js/worldpayCollector.js
worldpayaddon.css.paths.responsive=/responsive/common/css/worldpayaddon.css
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon.build.number b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon.build.number
index 24c7ef68..b595974e 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon.build.number
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon.build.number
@@ -1,11 +1,11 @@
#Ant properties
-#Mon Jan 18 14:19:09 UTC 2021
-version.api=2011
+#Wed Sep 29 10:46:25 UTC 2021
+version.api=2105
vendor=hybris
group.id=de.hybris.platform
name=worldpayaddon
description=worldpayaddon
-builddate=20210118 1419
-releasedate=20201208 1801
-version=2011.1
+builddate=20210929 1046
+releasedate=20210721 0907
+version=2105.0
module.name=platform-module
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon/web/spring/worldpayaddon-web-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon/web/spring/worldpayaddon-web-spring.xml
index ad916775..28477552 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon/web/spring/worldpayaddon-web-spring.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddon/resources/worldpayaddon/web/spring/worldpayaddon-web-spring.xml
@@ -1,15 +1,4 @@
-
+
@@ -102,4 +92,13 @@
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/.classpath b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/.classpath
index 482e73a5..912e49ad 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/.classpath
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/.classpath
@@ -10,7 +10,6 @@
-
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-config.xml b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-config.xml
index 35ad64a9..49ede202 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-config.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-config.xml
@@ -4,6 +4,7 @@
xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree"
xmlns:list-view="http://www.hybris.com/cockpitng/component/listView"
xmlns:y="http://www.hybris.com/cockpit/config/hybris"
+ xmlns:simple-search="http://www.hybris.com/cockpitng/config/simplesearch"
xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea"
xmlns:advanced-search="http://www.hybris.com/cockpitng/config/advancedsearch">
@@ -12,6 +13,7 @@
+
@@ -43,6 +45,14 @@
+
+
+
+ 'risk=' + message + ' score=' + score
+
+
+
+
@@ -102,18 +112,109 @@
+
-
-
+
+
+
+
+
+
+
+
+
+ identifier + ' - ' + code
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -252,4 +353,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-labels/labels_en.properties b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-labels/labels_en.properties
index a3201d88..851614ed 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-labels/labels_en.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice-backoffice-labels/labels_en.properties
@@ -1,18 +1,13 @@
-#
-# [y] hybris Platform
-#
-# Copyright (c) 2000-2015 hybris AG
-# All rights reserved.
-#
-# This software is the confidential and proprietary information of hybris
-# ("Confidential Information"). You shall not disclose such Confidential
-# Information and shall use it only in accordance with the terms of the
-# license agreement you entered into with hybris.
-#
-
-# in this file you has possibility to override widget labels
-# syntax:
-# .=value
-#
-# Example:
-# yourCustomLabel=value
+tab.configuration.worldpay = Worldpay
+sec.configuration.worldpay.pr.section = Prime Routing Configuration
+worldpay.merchant.configuration = Merchant Configuration
+tab.configuration.worldpay.merchant.essential = Essential
+sec.configuration.worldpay.details = Configuration Details
+tab.configuration.worldpay.merchant.card.payments = Card Payments
+tab.configuration.worldpay.merchant.applepay.payments = ApplePay Payments
+tab.configuration.worldpay.merchant.googlepay.payments = GooglePay Payments
+sec.configuration.worldpay.merchant.section = Merchant Configuration Details
+sec.configuration.worldpay.fs.section = Fraud Sight Configuration
+sec.configuration.worldpay.level23Data.section = Level 2/3 Data Configuration
+sec.configuration.worldpay.api.payload.section = Api Request/Response Payloads
+sec.configuration.worldpay.general.section = General configuration
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice.build.number b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice.build.number
index 6886ec1d..d5a8e165 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice.build.number
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/resources/worldpayaddonbackoffice.build.number
@@ -1,11 +1,11 @@
#Ant properties
-#Mon Jan 18 14:19:10 UTC 2021
-version.api=2011
+#Wed Sep 29 10:46:26 UTC 2021
+version.api=2105
vendor=hybris
group.id=de.hybris.platform
name=worldpayaddonbackoffice
description=worldpayaddonbackoffice
-builddate=20210118 1419
-releasedate=20201208 1801
-version=2011.1
+builddate=20210929 1046
+releasedate=20210721 0907
+version=2105.0
module.name=platform-module
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/src/com/worldpay/jalo/WorldpayaddonbackofficeManager.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/src/com/worldpay/jalo/WorldpayaddonbackofficeManager.java
index d5841883..3c883bf7 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/src/com/worldpay/jalo/WorldpayaddonbackofficeManager.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/src/com/worldpay/jalo/WorldpayaddonbackofficeManager.java
@@ -1,130 +1,19 @@
-/*
- * [y] hybris Platform
- *
- * Copyright (c) 2000-2015 hybris AG
- * All rights reserved.
- *
- * This software is the confidential and proprietary information of hybris
- * ("Confidential Information"). You shall not disclose such Confidential
- * Information and shall use it only in accordance with the terms of the
- * license agreement you entered into with hybris.
- */
package com.worldpay.jalo;
-import de.hybris.platform.core.Registry;
-import de.hybris.platform.util.JspContext;
-
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
import com.worldpay.constants.WorldpayaddonbackofficeConstants;
+import de.hybris.platform.jalo.JaloSession;
+import de.hybris.platform.jalo.extension.ExtensionManager;
+import org.apache.log4j.Logger;
-
-
-/**
- * This is the extension manager of the Ybackoffice extension.
- */
public class WorldpayaddonbackofficeManager extends GeneratedWorldpayaddonbackofficeManager
{
- /** Edit the local|project.properties to change logging behavior (properties 'log4j.*'). */
- private static final Logger LOG = Logger.getLogger(WorldpayaddonbackofficeManager.class.getName());
-
- /*
- * Some important tips for development:
- *
- * Do NEVER use the default constructor of manager's or items. => If you want to do something whenever the manger is
- * created use the init() or destroy() methods described below
- *
- * Do NEVER use STATIC fields in your manager or items! => If you want to cache anything in a "static" way, use an
- * instance variable in your manager, the manager is created only once in the lifetime of a "deployment" or tenant.
- */
-
-
- /**
- * Get the valid instance of this manager.
- *
- * @return the current instance of this manager
- */
- public static WorldpayaddonbackofficeManager getInstance()
- {
- return (WorldpayaddonbackofficeManager) Registry.getCurrentTenant().getJaloConnection().getExtensionManager()
- .getExtension(WorldpayaddonbackofficeConstants.EXTENSIONNAME);
- }
-
-
- /**
- * Never call the constructor of any manager directly, call getInstance() You can place your business logic here -
- * like registering a jalo session listener. Each manager is created once for each tenant.
- */
- public WorldpayaddonbackofficeManager() // NOPMD
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("constructor of WorldpayaddonbackofficeManager called.");
- }
- }
-
- /**
- * Use this method to do some basic work only ONCE in the lifetime of a tenant resp. "deployment". This method is
- * called after manager creation (for example within startup of a tenant). Note that if you have more than one tenant
- * you have a manager instance for each tenant.
- */
- @Override
- public void init()
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("init() of YbackofficeManager called. " + getTenant().getTenantID());
- }
- }
-
- /**
- * Use this method as a callback when the manager instance is being destroyed (this happens before system
- * initialization, at redeployment or if you shutdown your VM). Note that if you have more than one tenant you have a
- * manager instance for each tenant.
- */
- @Override
- public void destroy()
- {
- if (LOG.isDebugEnabled())
- {
- LOG.debug("destroy() of YbackofficeManager called, current tenant: " + getTenant().getTenantID());
- }
- }
-
- /**
- * Implement this method to create initial objects. This method will be called by system creator during
- * initialization and system update. Be sure that this method can be called repeatedly.
- *
- * An example usage of this method is to create required cronjobs or modifying the type system (setting e.g some
- * default values)
- *
- * @param params
- * the parameters provided by user for creation of objects for the extension
- * @param jspc
- * the jsp context; you can use it to write progress information to the jsp page during creation
- */
- @Override
- public void createEssentialData(final Map params, final JspContext jspc)
- {
- // implement here code creating essential data
- }
-
- /**
- * Implement this method to create data that is used in your project. This method will be called during the system
- * initialization.
- *
- * An example use is to import initial data like currencies or languages for your project from an csv file.
- *
- * @param params
- * the parameters provided by user for creation of objects for the extension
- * @param jspc
- * the jsp context; you can use it to write progress information to the jsp page during creation
- */
- @Override
- public void createProjectData(final Map params, final JspContext jspc)
+ @SuppressWarnings("unused")
+ private static final Logger log = Logger.getLogger( WorldpayaddonbackofficeManager.class.getName() );
+
+ public static final WorldpayaddonbackofficeManager getInstance()
{
- // implement here code creating project data
+ ExtensionManager em = JaloSession.getCurrentSession().getExtensionManager();
+ return (WorldpayaddonbackofficeManager) em.getExtension(WorldpayaddonbackofficeConstants.EXTENSIONNAME);
}
+
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/testsrc/com/hybris/backoffice/jalo/YbackofficeTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/testsrc/com/hybris/backoffice/jalo/YbackofficeTest.java
deleted file mode 100644
index bede2afe..00000000
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddonbackoffice/testsrc/com/hybris/backoffice/jalo/YbackofficeTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * [y] hybris Platform
- *
- * Copyright (c) 2000-2015 hybris AG
- * All rights reserved.
- *
- * This software is the confidential and proprietary information of hybris
- * ("Confidential Information"). You shall not disclose such Confidential
- * Information and shall use it only in accordance with the terms of the
- * license agreement you entered into with hybris.
- */
-package com.hybris.backoffice.jalo;
-
-import static org.junit.Assert.assertTrue;
-
-import de.hybris.platform.testframework.HybrisJUnit4TransactionalTest;
-
-import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-/**
- * JUnit Tests for the Ybackoffice extension
- */
-public class YbackofficeTest extends HybrisJUnit4TransactionalTest
-{
- /** Edit the local|project.properties to change logging behaviour (properties log4j.*). */
- @SuppressWarnings("unused")
- private static final Logger LOG = Logger.getLogger(YbackofficeTest.class.getName());
-
- @Before
- public void setUp()
- {
- // implement here code executed before each test
- }
-
- @After
- public void tearDown()
- {
- // implement here code executed after each test
- }
-
- /**
- * This is a sample test method.
- */
- @Test
- public void testYbackoffice()
- {
- final boolean testTrue = true;
- assertTrue("true is not true", testTrue);
- }
-}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/checkout/steps/validation/WorldpayCheckoutStepValidator.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/checkout/steps/validation/WorldpayCheckoutStepValidator.java
index 82341098..fb1dca84 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/checkout/steps/validation/WorldpayCheckoutStepValidator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/checkout/steps/validation/WorldpayCheckoutStepValidator.java
@@ -4,12 +4,13 @@
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.AbstractCheckoutStepValidator;
import de.hybris.platform.acceleratorstorefrontcommons.checkout.steps.validation.ValidationResults;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
public class WorldpayCheckoutStepValidator extends AbstractCheckoutStepValidator {
- private static final Logger LOG = Logger.getLogger(WorldpayCheckoutStepValidator.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpayCheckoutStepValidator.class);
/**
* {@inheritDoc}
@@ -19,7 +20,7 @@ public ValidationResults validateOnEnter(RedirectAttributes redirectAttributes)
final CheckoutPciOptionEnum subscriptionPciOption = getCheckoutFlowFacade().getSubscriptionPciOption();
if (!CheckoutPciOptionEnum.HOP.equals(subscriptionPciOption)) {
- LOG.error("unexpected PCI option for worldpay [" + subscriptionPciOption + "]");
+ LOG.error("unexpected PCI option for worldpay [{}]", subscriptionPciOption);
return ValidationResults.REDIRECT_TO_CART;
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/AbstractWorldpayDirectCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/AbstractWorldpayDirectCheckoutStepController.java
index f2902bd6..90734140 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/AbstractWorldpayDirectCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/AbstractWorldpayDirectCheckoutStepController.java
@@ -23,6 +23,9 @@ public abstract class AbstractWorldpayDirectCheckoutStepController extends World
protected static final String THREEDSECURE_FLEX_DDC_URL = "threeDSecureDDCUrl";
protected static final String THREED_SECURE_FLEX_FLOW = "3D-Secure-Flex-Flow";
protected static final String THREED_SECURE_FLOW = "3D-Secure-Flow";
+ protected static final String BIRTH_DAY_DATE_FORMAT = "dd/MM/yyyy";
+ protected static final String BIRTHDAY_DATE = "birthdayDate";
+ protected static final String DEVICE_SESSION = "DEVICE_SESSION";
@Resource
protected WorldpayAddonEndpointService worldpayAddonEndpointService;
@@ -66,9 +69,9 @@ public String handleDirectResponse(final Model model, final DirectResponseData d
public void setDDCIframeData(final Model model) {
final String ddcUrl = Optional.ofNullable(worldpayMerchantConfigDataFacade.getCurrentSiteMerchantConfigData())
- .map(WorldpayMerchantConfigData::getThreeDSFlexJsonWebTokenSettings)
- .map(ThreeDSFlexJsonWebTokenCredentials::getDdcUrl)
- .orElse(null);
+ .map(WorldpayMerchantConfigData::getThreeDSFlexJsonWebTokenSettings)
+ .map(ThreeDSFlexJsonWebTokenCredentials::getDdcUrl)
+ .orElse(null);
model.addAttribute(THREEDSECURE_FLEX_DDC_URL, ddcUrl);
model.addAttribute(THREEDSECURE_JWT_FLEX_DDC, worldpayDDCFacade.createJsonWebTokenForDDC());
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepController.java
index d07a3658..3d61e43a 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepController.java
@@ -33,8 +33,11 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.List;
+import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.BIRTH_DAY_DATE_FORMAT;
import static org.apache.commons.lang.StringUtils.EMPTY;
import static org.apache.commons.lang.StringUtils.isNotBlank;
@@ -48,6 +51,8 @@ public class WorldpayChoosePaymentMethodCheckoutStepController extends AbstractW
protected static final String PAYMENT_INFOS = "paymentInfos";
protected static final String CHOOSE_PAYMENT_METHOD = "choose-payment-method";
protected static final String SAVED_CARD_SELECTED_ATTRIBUTE = "savedCardSelected";
+ protected static final String CURRENT_DATE = "currentDate";
+ protected static final String IS_FS_ENABLED = "isFSEnabled";
protected static final String CHECKOUT_MULTI_PAYMENT_METHOD_BREADCRUMB = "checkout.multi.paymentMethod.breadcrumb";
protected static final String TEXT_ACCOUNT_PROFILE_PAYMENT_CART_REMOVED = "text.account.profile.paymentCart.removed";
@@ -102,6 +107,9 @@ public String enterStep(final Model model, final RedirectAttributes redirectAttr
setupAddPaymentPage(model);
setupPaymentDetailsForm(model);
+ model.addAttribute(IS_FS_ENABLED, worldpayPaymentCheckoutFacade.isFSEnabled());
+ final SimpleDateFormat dateFormat = new SimpleDateFormat(BIRTH_DAY_DATE_FORMAT);
+ model.addAttribute(CURRENT_DATE, dateFormat.format(new Date()));
setCheckoutStepLinksForModel(model, getCheckoutStep());
return getViewForPage(model);
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepController.java
index e5c63582..0a704b32 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepController.java
@@ -17,7 +17,8 @@
import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages;
import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException;
import de.hybris.platform.cms2.model.pages.ContentPageModel;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@@ -26,15 +27,17 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
import java.util.List;
+import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.BIRTHDAY_DATE;
import static de.hybris.platform.acceleratorstorefrontcommons.constants.WebConstants.BREADCRUMBS_KEY;
@Controller
@RequestMapping(value = "/checkout/multi/worldpay/payment-method")
public class WorldpayPaymentMethodCheckoutStepController extends AbstractWorldpayPaymentMethodCheckoutStepController {
- private static final Logger LOGGER = Logger.getLogger(WorldpayPaymentMethodCheckoutStepController.class);
+ private static final Logger LOGGER = LogManager.getLogger(WorldpayPaymentMethodCheckoutStepController.class);
protected static final String HOP_DEBUG_MODE_CONFIG = "hop.debug.mode";
protected static final String CHECKOUT_MULTI_PAYMENT_METHOD_BREADCRUMB = "checkout.multi.paymentMethod.breadcrumb";
@@ -166,6 +169,10 @@ public List getKlarnaPayments() {
}
protected WorldpayAdditionalInfoData createWorldpayAdditionalInfo(final Model model) {
- return worldpayAdditionalInfoFacade.createWorldpayAdditionalInfoData((HttpServletRequest) model.asMap().get(REQUEST));
+ final WorldpayAdditionalInfoData worldpayAdditionalInfoData = worldpayAdditionalInfoFacade.createWorldpayAdditionalInfoData((HttpServletRequest) model.asMap().get(REQUEST));
+ if (worldpayPaymentCheckoutFacade.isFSEnabled()) {
+ worldpayAdditionalInfoData.setDateOfBirth((Date) model.asMap().get(BIRTHDAY_DATE));
+ }
+ return worldpayAdditionalInfoData;
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepController.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepController.java
index 1ff10222..47506244 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepController.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepController.java
@@ -1,6 +1,6 @@
package com.worldpay.controllers.pages.checkout.steps;
-import com.worldpay.facades.WorldpayCartFacade;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.PaymentDetailsForm;
import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn;
import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException;
@@ -14,12 +14,14 @@
import javax.annotation.Resource;
import javax.validation.Valid;
+import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.BIRTHDAY_DATE;
+
@Controller
@RequestMapping(value = "/checkout/multi/worldpay/redirect")
public class WorldpayRedirectCheckoutStepController extends WorldpayChoosePaymentMethodCheckoutStepController {
@Resource
- private WorldpayCartFacade worldpayCartFacade;
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacade;
/**
* Validates and saves form details on submit of the payment details form for the HOP payment flow and redirects to Worldpay payment pages
@@ -52,6 +54,9 @@ public String addPaymentDetails(final Model model, @Valid final PaymentDetailsFo
}
redirectAttrs.addFlashAttribute(SAVE_PAYMENT_INFO, paymentDetailsForm.getSaveInAccount());
redirectAttrs.addFlashAttribute(PAYMENT_METHOD_PARAM, paymentDetailsForm.getPaymentMethod());
+ if (worldpayPaymentCheckoutFacade.isFSEnabled()) {
+ redirectAttrs.addFlashAttribute(BIRTHDAY_DATE, paymentDetailsForm.getDateOfBirth());
+ }
return getRedirectToPaymentMethod();
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/CSEPaymentForm.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/CSEPaymentForm.java
index 9a6bc32c..e209a549 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/CSEPaymentForm.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/CSEPaymentForm.java
@@ -1,5 +1,9 @@
package com.worldpay.forms;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
public class CSEPaymentForm {
private boolean termsCheck;
@@ -12,6 +16,10 @@ public class CSEPaymentForm {
private String expiryMonth;
private String referenceId;
private String windowSizePreference;
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private Date dateOfBirth;
+ private String deviceSession;
+ private boolean dobRequired;
public String getCseToken() {
return cseToken;
@@ -92,4 +100,28 @@ public String getSecurityCode() {
public void setSecurityCode(final String securityCode) {
this.securityCode = securityCode;
}
+
+ public Date getDateOfBirth() {
+ return dateOfBirth;
+ }
+
+ public void setDateOfBirth(final Date dateOfBirth) {
+ this.dateOfBirth = dateOfBirth;
+ }
+
+ public String getDeviceSession() {
+ return deviceSession;
+ }
+
+ public void setDeviceSession(final String deviceSession) {
+ this.deviceSession = deviceSession;
+ }
+
+ public boolean isDobRequired() {
+ return dobRequired;
+ }
+
+ public void setDobRequired(final boolean dobRequired) {
+ this.dobRequired = dobRequired;
+ }
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/PaymentDetailsForm.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/PaymentDetailsForm.java
index b4671dbe..05d4c88c 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/PaymentDetailsForm.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/PaymentDetailsForm.java
@@ -1,6 +1,9 @@
package com.worldpay.forms;
import de.hybris.platform.acceleratorstorefrontcommons.forms.AddressForm;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
public class PaymentDetailsForm {
@@ -10,6 +13,9 @@ public class PaymentDetailsForm {
private String paymentMethod;
private AddressForm billingAddress;
private String shopperBankCode;
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private Date dateOfBirth;
+ private boolean dobRequired;
public String getPaymentMethod() {
return paymentMethod;
@@ -60,4 +66,19 @@ public void setShopperBankCode(String shopperBankCode) {
this.shopperBankCode = shopperBankCode;
}
+ public Date getDateOfBirth() {
+ return dateOfBirth;
+ }
+
+ public void setDateOfBirth(final Date dateOfBirth) {
+ this.dateOfBirth = dateOfBirth;
+ }
+
+ public boolean isDobRequired() {
+ return dobRequired;
+ }
+
+ public void setDobRequired(final boolean dobRequired) {
+ this.dobRequired = dobRequired;
+ }
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/validation/PaymentDetailsFormValidator.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/validation/PaymentDetailsFormValidator.java
index 6db5da6c..70fa8559 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/validation/PaymentDetailsFormValidator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/forms/validation/PaymentDetailsFormValidator.java
@@ -1,6 +1,7 @@
package com.worldpay.forms.validation;
import com.worldpay.core.services.APMConfigurationLookupService;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.PaymentDetailsForm;
import com.worldpay.model.WorldpayAPMConfigurationModel;
import com.worldpay.service.apm.APMAvailabilityService;
@@ -13,16 +14,18 @@
import org.springframework.validation.Validator;
import javax.annotation.Resource;
+import java.util.Date;
import static com.worldpay.service.model.payment.PaymentType.ONLINE;
import static java.lang.Boolean.FALSE;
-@Component ("paymentDetailsFormValidator")
+@Component("paymentDetailsFormValidator")
public class PaymentDetailsFormValidator implements Validator {
protected static final String GLOBAL_MISSING_DELIVERY_ADDRESS = "checkout.multi.paymentMethod.createSubscription.billingAddress.noneSelectedMsg";
protected static final String CHECKOUT_ERROR_TERMS_NOT_ACCEPTED = "checkout.error.terms.not.accepted";
+ protected static final String CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY = "checkout.error.fraudSight.dob.mandatory";
protected static final String FIELD_PAYMENT_METHOD = "paymentMethod";
protected static final String FIELD_SHOPPER_BANK_CODE = "shopperBankCode";
@@ -44,9 +47,12 @@ public class PaymentDetailsFormValidator implements Validator {
@Resource
private APMAvailabilityService apmAvailabilityService;
- @Resource (name = "worldpayCheckoutFacade")
+ @Resource(name = "worldpayCheckoutFacade")
private AcceleratorCheckoutFacade checkoutFacade;
+ @Resource
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacade;
+
/**
* {@inheritDoc}
*/
@@ -91,6 +97,18 @@ public void validate(final Object object, final Errors errors) {
validateField(errors, FIELD_BILLING_ADDRESS_POSTCODE, "address.postcode.invalid");
validateField(errors, FIELD_BILLING_ADDRESS_COUNTRY_ISO, "address.country.invalid");
}
+
+ if (worldpayPaymentCheckoutFacade.isFSEnabled() && form.isDobRequired() && !isValidDate(form.getDateOfBirth())) {
+ errors.reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+ }
+
+ protected boolean isValidDate(final Date birthdayDate) {
+ if (birthdayDate == null) {
+ return false;
+ }
+
+ return birthdayDate.before(new Date());
}
protected void validateTermsCheck(final Errors errors, final PaymentDetailsForm form) {
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandler.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandler.java
index 77635bb8..962ab67e 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandler.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/src/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandler.java
@@ -1,25 +1,40 @@
package com.worldpay.interceptors.beforeview;
+import com.worldpay.config.Environment;
+import com.worldpay.service.payment.WorldpayFraudSightStrategy;
import de.hybris.platform.acceleratorservices.config.SiteConfigService;
import de.hybris.platform.acceleratorservices.storefront.data.JavaScriptVariableData;
import de.hybris.platform.addonsupport.config.javascript.JavaScriptVariableDataFactory;
import de.hybris.platform.addonsupport.interceptors.BeforeViewHandlerAdaptee;
+import org.apache.commons.lang3.BooleanUtils;
import org.springframework.ui.ModelMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import static com.worldpay.config.Environment.PROD;
+
public class WorldpayJsVariablesBeforeViewHandler implements BeforeViewHandlerAdaptee {
private static final int SECONDS = 2;
private static final String PAYMENT_STATUS = "paymentStatus";
+ private static final String ORGANIZATION_ID = "organizationId";
+ private static final String PROFILING_DOMAIN = "profilingDomain";
private static final String HOP_DECLINE_MESSAGE_WAIT_TIMER_SECONDS = "hop.decline.message.wait.timer.seconds";
private static final String WORLDPAY_DECLINE_MESSAGE_WAIT_TIMER_SECONDS = "worldpayDeclineMessageWaitTimerSeconds";
+ private static final String WORLDPAY_CONFIG_ENVIRONMENT = "worldpay.config.environment";
+ private static final String WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD = "worldpay.config.profile.domain.prod";
+ private static final String WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST = "worldpay.config.profile.domain.test";
+ private static final String WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID = "worldpay.merchant.organization.id";
+ private static final String IS_FS_ENABLED = "isFSEnabled";
protected final SiteConfigService siteConfigService;
+ protected final WorldpayFraudSightStrategy worldpayFraudSightStrategy;
- public WorldpayJsVariablesBeforeViewHandler(final SiteConfigService siteConfigService) {
+ public WorldpayJsVariablesBeforeViewHandler(final SiteConfigService siteConfigService,
+ final WorldpayFraudSightStrategy worldpayFraudSightStrategy) {
this.siteConfigService = siteConfigService;
+ this.worldpayFraudSightStrategy = worldpayFraudSightStrategy;
}
/**
@@ -32,6 +47,26 @@ public String beforeView(final HttpServletRequest request, final HttpServletResp
JavaScriptVariableDataFactory.getVariables(model).add(worldpayDeclineMessageWaitTimerSeconds);
final JavaScriptVariableData javaScriptVariableData = JavaScriptVariableDataFactory.create(PAYMENT_STATUS, (String) model.get(PAYMENT_STATUS));
JavaScriptVariableDataFactory.getVariables(model).add(javaScriptVariableData);
+
+ final Boolean isFSEnabled = worldpayFraudSightStrategy.isFraudSightEnabled();
+ final JavaScriptVariableData javaScriptFSEnabledVariableData = JavaScriptVariableDataFactory.create(IS_FS_ENABLED, isFSEnabled.toString());
+ JavaScriptVariableDataFactory.getVariables(model).add(javaScriptFSEnabledVariableData);
+
+ if (BooleanUtils.isTrue(isFSEnabled)) {
+ final String environment = siteConfigService.getProperty(WORLDPAY_CONFIG_ENVIRONMENT);
+ final JavaScriptVariableData javaScriptProfilingDomainVariableData;
+ if (PROD == Environment.valueOf(environment)) {
+ javaScriptProfilingDomainVariableData = JavaScriptVariableDataFactory.create(PROFILING_DOMAIN, siteConfigService.getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD));
+ } else {
+ javaScriptProfilingDomainVariableData = JavaScriptVariableDataFactory.create(PROFILING_DOMAIN, siteConfigService.getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST));
+ }
+ JavaScriptVariableDataFactory.getVariables(model).add(javaScriptProfilingDomainVariableData);
+
+ final JavaScriptVariableData javaScriptOrgIdVariableData = JavaScriptVariableDataFactory.create(ORGANIZATION_ID,
+ siteConfigService.getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID));
+ JavaScriptVariableDataFactory.getVariables(model).add(javaScriptOrgIdVariableData);
+ }
+
return viewName;
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepControllerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepControllerTest.java
index b83d8891..d2e9e961 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepControllerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayChoosePaymentMethodCheckoutStepControllerTest.java
@@ -85,6 +85,8 @@ public class WorldpayChoosePaymentMethodCheckoutStepControllerTest {
private static final String PHONE_NUMBER = "+44 (0) 123-123-123";
private static final String PAYMENT_STATUS = "paymentStatus";
private static final String SAVED_CARD_SELECTED_ATTRIBUTE = "savedCardSelected";
+ private static final String CURRENT_DATE = "currentDate";
+ private static final String IS_FS_ENABLED = "isFSEnabled";
@Spy
@InjectMocks
@@ -316,18 +318,21 @@ public void shouldReturnTheTermsAndConditionsUrl() {
}
@Test
- public void shouldSetupAndRedirectToChoosePaymentPage() throws CMSItemNotFoundException {
+ public void enterStep_WhenNoPaymentStatusInTheModel_shouldSetupAndRedirectToChoosePaymentPage() throws CMSItemNotFoundException {
when(modelMock.asMap().get(PAYMENT_STATUS_PARAMETER_NAME)).thenReturn(null);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
testObj.enterStep(modelMock, redirectAttrsMock);
verify(testObj).setupAddPaymentPage(modelMock);
verify(modelMock).addAttribute(eq(PAYMENT_DETAILS_FORM), any(PaymentDetailsForm.class));
+ verify(modelMock).addAttribute(IS_FS_ENABLED, true);
+ verify(modelMock).addAttribute(eq(CURRENT_DATE), any(String.class));
verify(modelMock, never()).addAttribute(eq(ERROR_MESSAGES_HOLDER), any());
}
@Test
- public void shouldAddErrorWhenThereIsAPaymentStatusInTheModel() throws CMSItemNotFoundException {
+ public void enterStep_WhenThereIsAPaymentStatusInTheModel_ShouldAddError() throws CMSItemNotFoundException {
when(modelMock.asMap().get(PAYMENT_STATUS_PARAMETER_NAME)).thenReturn(PAYMENT_STATUS);
testObj.enterStep(modelMock, redirectAttrsMock);
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepControllerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepControllerTest.java
index 9a405e49..93be6278 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepControllerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayPaymentMethodCheckoutStepControllerTest.java
@@ -4,6 +4,7 @@
import com.worldpay.data.BankTransferAdditionalAuthInfo;
import com.worldpay.exception.WorldpayException;
import com.worldpay.facades.WorldpayBankConfigurationFacade;
+import com.worldpay.facades.WorldpayCartFacade;
import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.facades.payment.WorldpayAdditionalInfoFacade;
import com.worldpay.facades.payment.direct.WorldpayDirectOrderFacade;
@@ -37,8 +38,11 @@
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
+import java.util.Calendar;
+import java.util.Date;
import java.util.Map;
+import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.BIRTHDAY_DATE;
import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayPaymentMethodCheckoutStepController.*;
import static com.worldpay.controllers.pages.checkout.steps.WorldpayPaymentMethodCheckoutStepController.REDIRECT_URL_CHOOSE_PAYMENT_METHOD;
import static com.worldpay.controllers.pages.checkout.steps.WorldpayPaymentMethodCheckoutStepController.*;
@@ -63,6 +67,7 @@ public class WorldpayPaymentMethodCheckoutStepControllerTest {
private static final String KLARNA_RESPONSE = "klarnaContent";
private static final String KLARNA_RESPONSE_PAGE_DATA_PARAM = "KLARNA_VIEW_DATA";
private static final String KLARNA_RESPONSE_PAGE = "pages/klarna/klarnaResponseContentPage";
+ private static final Date BIRTHDAY_DATE_VALUE = new Date(1990, Calendar.MAY, 17);
@Spy
@InjectMocks
@@ -121,6 +126,8 @@ public class WorldpayPaymentMethodCheckoutStepControllerTest {
private AdditionalAuthInfo additionalAuthInfoMock;
@Mock
private CMSPreviewService cmsPreviewServiceMock;
+ @Mock
+ private WorldpayCartFacade worldpayCartFacadeMock;
@Before
public void setUp() throws Exception {
@@ -141,6 +148,8 @@ public void setUp() throws Exception {
when(worldpayAdditionalInfoFacadeMock.createWorldpayAdditionalInfoData(httpServletRequestMock)).thenReturn(worldpayAdditionalInfoDataMock);
when(siteConfigServiceMock.getBoolean(HOP_DEBUG_MODE_CONFIG, false)).thenReturn(false);
when(worldpayAddonEndpointServiceMock.getHostedOrderPostPage()).thenReturn(HOSTED_ORDER_PAGE);
+ when(modelMock.asMap().get(BIRTHDAY_DATE)).thenReturn(BIRTHDAY_DATE_VALUE);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
}
@Test
@@ -159,6 +168,7 @@ public void testEnterStepForCard() throws CMSItemNotFoundException {
verify(modelMock).addAttribute(HOP_DEBUG_MODE_PARAM, false);
verify(paymentDataParametersMock, never()).put(eq(PREFERRED_PAYMENT_METHOD_PARAM), any());
assertEquals(HOSTED_ORDER_PAGE, result);
+ verify(worldpayAdditionalInfoDataMock).setDateOfBirth(BIRTHDAY_DATE_VALUE);
}
@Test
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepControllerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepControllerTest.java
index aa87a813..3d086d84 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepControllerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/controllers/pages/checkout/steps/WorldpayRedirectCheckoutStepControllerTest.java
@@ -2,6 +2,7 @@
import com.worldpay.core.services.APMConfigurationLookupService;
import com.worldpay.facades.WorldpayCartFacade;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.PaymentDetailsForm;
import com.worldpay.forms.validation.PaymentDetailsFormValidator;
import de.hybris.bootstrap.annotations.UnitTest;
@@ -20,6 +21,10 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import java.util.Calendar;
+import java.util.Date;
+
+import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayDirectCheckoutStepController.BIRTHDAY_DATE;
import static com.worldpay.controllers.pages.checkout.steps.AbstractWorldpayPaymentMethodCheckoutStepController.*;
import static com.worldpay.service.model.payment.PaymentType.ONLINE;
import static java.lang.Boolean.FALSE;
@@ -33,14 +38,14 @@
@RunWith(MockitoJUnitRunner.class)
public class WorldpayRedirectCheckoutStepControllerTest {
- @Spy
- @InjectMocks
- private WorldpayRedirectCheckoutStepController testObj = new WorldpayRedirectCheckoutStepController();
-
private static final String BILLING_ERROR_VIEW = "billingErrorView";
private static final String BANK_CODE = "bankCode";
private static final String PAYMENT_METHOD = "paymentMethod";
+ private static final Date BIRTHDAY_DATE_VALUE = new Date(1990, Calendar.MAY, 17);
+ @Spy
+ @InjectMocks
+ private WorldpayRedirectCheckoutStepController testObj = new WorldpayRedirectCheckoutStepController();
@Mock
private PaymentDetailsForm paymentDetailsFormMock;
@Mock
@@ -59,6 +64,8 @@ public class WorldpayRedirectCheckoutStepControllerTest {
private APMConfigurationLookupService apmConfigurationServiceMock;
@Mock
private WorldpayCartFacade worldpayCartFacadeMock;
+ @Mock
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacadeMock;
@Before
public void setUp() {
@@ -69,12 +76,31 @@ public void setUp() {
when(paymentDetailsFormMock.getSaveInAccount()).thenReturn(true);
when(paymentDetailsFormMock.getPaymentMethod()).thenReturn(ONLINE.getMethodCode());
when(paymentDetailsFormMock.getBillingAddress()).thenReturn(addressFormMock);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(BIRTHDAY_DATE_VALUE);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
+ }
+
+ @Test
+ public void addPaymentDetails_WhenCustomerIsAnonymousAndBillingAddressIsDifferentFromShippingAddressAndWhenFSEnabled_ShouldSaveTheAddressAndAddTheDOBRedirectAttribute() throws CMSItemNotFoundException {
+ when(paymentDetailsFormMock.getUseDeliveryAddress()).thenReturn(FALSE);
+ when(userFacadeMock.isAnonymousUser()).thenReturn(TRUE);
+
+ testObj.addPaymentDetails(modelMock, paymentDetailsFormMock, bindingResultMock, redirectAttrsMock);
+
+ verify(paymentDetailsFormValidatorMock).validate(paymentDetailsFormMock, bindingResultMock);
+ verify(worldpayCartFacadeMock).resetDeclineCodeAndShopperBankOnCart(null);
+ verify(testObj).handleAndSaveAddresses(paymentDetailsFormMock);
+
+ verify(redirectAttrsMock).addFlashAttribute(SAVE_PAYMENT_INFO, true);
+ verify(redirectAttrsMock).addFlashAttribute(PAYMENT_METHOD_PARAM, ONLINE.getMethodCode());
+ verify(redirectAttrsMock).addFlashAttribute(BIRTHDAY_DATE, BIRTHDAY_DATE_VALUE);
}
@Test
- public void addressShouldBeSavedIfCustomerIsAnonymousAndBillingAddressIsDifferentFromShippingAddress() throws CMSItemNotFoundException {
+ public void addPaymentDetails_WhenCustomerIsAnonymousAndBillingAddressIsDifferentFromShippingAddressAndWhenFSDisabled_ShouldSaveTheAddressAndNotAddTheDOBRedirectAttribute() throws CMSItemNotFoundException {
when(paymentDetailsFormMock.getUseDeliveryAddress()).thenReturn(FALSE);
when(userFacadeMock.isAnonymousUser()).thenReturn(TRUE);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(false);
testObj.addPaymentDetails(modelMock, paymentDetailsFormMock, bindingResultMock, redirectAttrsMock);
@@ -84,6 +110,7 @@ public void addressShouldBeSavedIfCustomerIsAnonymousAndBillingAddressIsDifferen
verify(redirectAttrsMock).addFlashAttribute(SAVE_PAYMENT_INFO, true);
verify(redirectAttrsMock).addFlashAttribute(PAYMENT_METHOD_PARAM, ONLINE.getMethodCode());
+ verify(redirectAttrsMock, never()).addFlashAttribute(BIRTHDAY_DATE, BIRTHDAY_DATE_VALUE);
}
@Test
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/CsePaymentDetailsFormValidatorTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/CsePaymentDetailsFormValidatorTest.java
index 2f6e0d5f..a3867718 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/CsePaymentDetailsFormValidatorTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/CsePaymentDetailsFormValidatorTest.java
@@ -1,7 +1,9 @@
package com.worldpay.forms.validation;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.PaymentDetailsForm;
import de.hybris.bootstrap.annotations.UnitTest;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
@@ -26,6 +28,14 @@ public class CsePaymentDetailsFormValidatorTest {
private PaymentDetailsForm paymentDetailsFormMock;
@Mock
private Errors errorsMock;
+ @Mock
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacadeMock;
+
+ @Before
+ public void setUp() {
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(false);
+ when(paymentDetailsFormMock.isDobRequired()).thenReturn(false);
+ }
@Test
public void shouldNotAddErrorsOnTermsAndConditionsIfPaymentMethodIsOnline() throws Exception {
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/PaymentDetailsFormValidatorTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/PaymentDetailsFormValidatorTest.java
index e019a2ca..a0dae4dc 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/PaymentDetailsFormValidatorTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/forms/validation/PaymentDetailsFormValidatorTest.java
@@ -1,6 +1,7 @@
package com.worldpay.forms.validation;
import com.worldpay.core.services.APMConfigurationLookupService;
+import com.worldpay.facades.order.WorldpayPaymentCheckoutFacade;
import com.worldpay.forms.PaymentDetailsForm;
import com.worldpay.model.WorldpayAPMConfigurationModel;
import com.worldpay.service.apm.APMAvailabilityService;
@@ -20,34 +21,21 @@
import org.mockito.verification.VerificationMode;
import org.springframework.validation.Errors;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.CHECKOUT_ERROR_TERMS_NOT_ACCEPTED;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_COUNTRY_ISO;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_FIRST_NAME;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_LAST_NAME;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_LINE1;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_POSTCODE;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_BILLING_ADDRESS_TOWN_CITY;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_PAYMENT_METHOD;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.FIELD_SHOPPER_BANK_CODE;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.GLOBAL_MISSING_DELIVERY_ADDRESS;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.WORLDPAY_PAYMENT_METHOD_INVALID;
-import static com.worldpay.forms.validation.PaymentDetailsFormValidator.WORLDPAY_PAYMENT_METHOD_NO_SHOPPER_BANK_CODE;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+import static com.worldpay.forms.validation.PaymentDetailsFormValidator.*;
import static com.worldpay.service.model.payment.PaymentType.ONLINE;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import static org.mockito.Matchers.*;
+import static org.mockito.Mockito.*;
@UnitTest
-@RunWith (MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class PaymentDetailsFormValidatorTest {
private static final String APM_PAYMENT_METHOD = "apmPaymentMethod";
private static final String BANK_CODE = "bankCode";
+ private static final String BIRTH_DAY_DATE_FORMAT = "dd/MM/yyyy";
@Spy
@InjectMocks
@@ -73,6 +61,8 @@ public class PaymentDetailsFormValidatorTest {
private AddressData deliveryAddressMock;
@Mock
private CartData checkoutCartMock;
+ @Mock
+ private WorldpayPaymentCheckoutFacade worldpayPaymentCheckoutFacadeMock;
@Before
public void setUp() {
@@ -82,6 +72,8 @@ public void setUp() {
when(checkoutFacadeMock.getCheckoutCart()).thenReturn(checkoutCartMock);
when(checkoutCartMock.getDeliveryAddress()).thenReturn(deliveryAddressMock);
when(paymentDetailsFormMock.isTermsCheck()).thenReturn(true);
+ when(paymentDetailsFormMock.isDobRequired()).thenReturn(true);
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(true);
}
@Test
@@ -201,6 +193,44 @@ public void validateAddGlobalErrorWhenNoPaymentMethodIsSelectedAndValueIsNull()
verify(errorsMock).reject(WORLDPAY_PAYMENT_METHOD_INVALID);
}
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNull_ShouldAddTheError() {
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(paymentDetailsFormMock, errorsMock);
+
+ verify(errorsMock).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNotInThePast_ShouldAddTheError() throws ParseException {
+ final SimpleDateFormat df = new SimpleDateFormat(BIRTH_DAY_DATE_FORMAT);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(df.parse("21/10/2100"));
+
+ testObj.validate(paymentDetailsFormMock, errorsMock);
+
+ verify(errorsMock).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsDisabledAndBirthdayDateNull_ShouldNotAddTheError() {
+ when(worldpayPaymentCheckoutFacadeMock.isFSEnabled()).thenReturn(false);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(paymentDetailsFormMock, errorsMock);
+
+ verify(errorsMock, never()).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
+
+ @Test
+ public void validate_WhenFSIsEnabledAndBirthdayDateNullAndDobNotRequired_ShouldNotAddTheError() {
+ when(paymentDetailsFormMock.isDobRequired()).thenReturn(false);
+ when(paymentDetailsFormMock.getDateOfBirth()).thenReturn(null);
+
+ testObj.validate(paymentDetailsFormMock, errorsMock);
+
+ verify(errorsMock, never()).reject(CHECKOUT_ERROR_FRAUDSIGHT_DOB_MANDATORY);
+ }
protected void verifyBillingAddressValidation(VerificationMode verificationMode) {
verify(testObj, verificationMode).validateField(eq(errorsMock), eq(FIELD_BILLING_ADDRESS_FIRST_NAME), anyString());
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandlerTest.java b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandlerTest.java
index 2b7bb817..3d775111 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandlerTest.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/commonweb/testsrc/com/worldpay/interceptors/beforeview/WorldpayJsVariablesBeforeViewHandlerTest.java
@@ -1,5 +1,6 @@
package com.worldpay.interceptors.beforeview;
+import com.worldpay.service.payment.WorldpayFraudSightStrategy;
import de.hybris.bootstrap.annotations.UnitTest;
import de.hybris.platform.acceleratorservices.config.SiteConfigService;
import org.junit.Before;
@@ -14,14 +15,21 @@
import javax.servlet.http.HttpServletResponse;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
@UnitTest
@RunWith(MockitoJUnitRunner.class)
public class WorldpayJsVariablesBeforeViewHandlerTest {
private static final int SECONDS = 2;
+ private static final String ORGANIZATION_ID_VALUE = "5fd9e78c09c50b2d408f6805";
+ private static final String PROFILING_DOMAIN_PROD = "ddc.worldpay.com";
+ private static final String PROFILING_DOMAIN_TEST = "ddc-test.worldpay.com";
private static final String HOP_DECLINE_MESSAGE_WAIT_TIMER_SECONDS = "hop.decline.message.wait.timer.seconds";
+ private static final String WORLDPAY_CONFIG_ENVIRONMENT = "worldpay.config.environment";
+ private static final String WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD = "worldpay.config.profile.domain.prod";
+ private static final String WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST = "worldpay.config.profile.domain.test";
+ private static final String WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID = "worldpay.merchant.organization.id";
private static final String PAYMENT_STATUS = "paymentStatus";
private static final String VIEW_NAME = "viewName";
private static final String PAYMENT_VALUE = "payment value";
@@ -32,6 +40,8 @@ public class WorldpayJsVariablesBeforeViewHandlerTest {
@Mock
private SiteConfigService siteConfigServiceMock;
@Mock
+ private WorldpayFraudSightStrategy worldpayFraudSightStrategyMock;
+ @Mock
private HttpServletRequest requestMock;
@Mock
private HttpServletResponse responseMock;
@@ -40,14 +50,55 @@ public class WorldpayJsVariablesBeforeViewHandlerTest {
@Before
public void setUp() {
+ when(worldpayFraudSightStrategyMock.isFraudSightEnabled()).thenReturn(true);
when(siteConfigServiceMock.getInt(HOP_DECLINE_MESSAGE_WAIT_TIMER_SECONDS, SECONDS)).thenReturn(5);
when(modelMock.getAttribute(PAYMENT_STATUS)).thenReturn(PAYMENT_VALUE);
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_ENVIRONMENT)).thenReturn("TEST");
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD)).thenReturn(PROFILING_DOMAIN_PROD);
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST)).thenReturn(PROFILING_DOMAIN_TEST);
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID)).thenReturn(ORGANIZATION_ID_VALUE);
+ }
+
+ @Test
+ public void beforeView_WhenTestEnvAndFraudSightEnabled_ShouldReturnTheViewNameAndSetFSProperties() {
+ final String result = testObj.beforeView(requestMock, responseMock, modelMock, VIEW_NAME);
+
+ assertThat(result).isEqualTo(VIEW_NAME);
+ verify(siteConfigServiceMock).getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST);
+ verify(siteConfigServiceMock).getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID);
+ }
+
+ @Test
+ public void beforeView_WhenTestProdAndFraudSightEnabled_ShouldReturnTheViewNameAndSetFSProperties() {
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_ENVIRONMENT)).thenReturn("PROD");
+
+ final String result = testObj.beforeView(requestMock, responseMock, modelMock, VIEW_NAME);
+
+ assertThat(result).isEqualTo(VIEW_NAME);
+ verify(siteConfigServiceMock).getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD);
+ verify(siteConfigServiceMock).getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID);
}
@Test
- public void beforeView_ShouldReturnTheViewName() {
+ public void beforeView_WhenTestEnvAndFraudSightDisabled_ShouldReturnTheViewName() {
+ when(worldpayFraudSightStrategyMock.isFraudSightEnabled()).thenReturn(false);
+
+ final String result = testObj.beforeView(requestMock, responseMock, modelMock, VIEW_NAME);
+
+ assertThat(result).isEqualTo(VIEW_NAME);
+ verify(siteConfigServiceMock, never()).getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_TEST);
+ verify(siteConfigServiceMock, never()).getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID);
+ }
+
+ @Test
+ public void beforeView_WhenTestProdAndFraudSightDisabled_ShouldReturnTheViewName() {
+ when(worldpayFraudSightStrategyMock.isFraudSightEnabled()).thenReturn(false);
+ when(siteConfigServiceMock.getProperty(WORLDPAY_CONFIG_ENVIRONMENT)).thenReturn("PROD");
+
final String result = testObj.beforeView(requestMock, responseMock, modelMock, VIEW_NAME);
assertThat(result).isEqualTo(VIEW_NAME);
+ verify(siteConfigServiceMock, never()).getProperty(WORLDPAY_CONFIG_PROFILE_DOMAIN_PROD);
+ verify(siteConfigServiceMock, never()).getProperty(WORLDPAY_CONFIG_MERCHANT_ORGANIZATION_ID);
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/localization/worldpayaddoncommons-locales_en.properties b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/localization/worldpayaddoncommons-locales_en.properties
index f20f49ff..4b643f10 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/localization/worldpayaddoncommons-locales_en.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/localization/worldpayaddoncommons-locales_en.properties
@@ -1,18 +1 @@
-
-# put localizations of item types into this file
-# Note that you can also add special locatizations which
-# can be retrieved with the
-#
-# ...tools.localization.Localization.getLocalizedString(...)
-#
-# methods.
-#
-# syntax for type localizations:
-#
-# type..name=XY
-# type...name=XY
-# type..description=XY
-# type...description=XY
-#
-# yourcustomlocalekey=value
-
+checkout.error.fraudSight.dob.mandatory = Date of birth is mandatory and must be in the past
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/worldpayaddoncommons.build.number b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/worldpayaddoncommons.build.number
index b309915d..c8d7beff 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/worldpayaddoncommons.build.number
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayaddoncommons/resources/worldpayaddoncommons.build.number
@@ -1,11 +1,11 @@
#Ant properties
-#Mon Jan 18 14:19:09 UTC 2021
-version.api=2011
+#Wed Sep 29 10:46:25 UTC 2021
+version.api=2105
vendor=hybris
group.id=de.hybris.platform
name=worldpayaddoncommons
description=worldpayaddoncommons
-builddate=20210118 1419
-releasedate=20201208 1801
-version=2011.1
+builddate=20210929 1046
+releasedate=20210721 0907
+version=2105.0
module.name=platform-module
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/.classpath b/hybris/bin/y-ext/ext-worldpay/worldpayapi/.classpath
index d0ce2098..5ad02c04 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/.classpath
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/.classpath
@@ -7,11 +7,21 @@
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/buildcallbacks.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/buildcallbacks.xml
index 181af8fd..c5eb99b1 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/buildcallbacks.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/buildcallbacks.xml
@@ -1,97 +1,34 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/ant-contrib-1.0b3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/ant-contrib-1.0b3.jar
new file mode 100644
index 00000000..06253766
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/ant-contrib-1.0b3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-runtime-4.0.0.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-runtime-4.0.0.jar
new file mode 100644
index 00000000..66f9d42d
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-runtime-4.0.0.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-tools-4.0.0.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-tools-4.0.0.jar
new file mode 100644
index 00000000..10cd4c08
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/istack-commons-tools-4.0.0.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.activation-api-1.2.2.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.activation-api-1.2.2.jar
new file mode 100644
index 00000000..3cc969d8
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.activation-api-1.2.2.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.xml.bind-api-2.3.3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.xml.bind-api-2.3.3.jar
new file mode 100644
index 00000000..b8c7dc1e
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jakarta.xml.bind-api-2.3.3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-api-2.3.1.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-api-2.3.1.jar
new file mode 100644
index 00000000..45658654
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-api-2.3.1.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-core-2.3.0.1.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-core-2.3.0.1.jar
new file mode 100644
index 00000000..a5d3b65a
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-core-2.3.0.1.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-jxc-2.3.3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-jxc-2.3.3.jar
new file mode 100644
index 00000000..e104936d
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-jxc-2.3.3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-runtime-2.3.3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-runtime-2.3.3.jar
new file mode 100644
index 00000000..f950209c
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-runtime-2.3.3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-xjc-2.3.3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-xjc-2.3.3.jar
new file mode 100644
index 00000000..c0638b08
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/jaxb-xjc-2.3.3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/txw2-2.3.3.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/txw2-2.3.3.jar
new file mode 100644
index 00000000..363dd1b6
Binary files /dev/null and b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/dtd-conversion/txw2-2.3.3.jar differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/worldpay-core-2.8.jar b/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/worldpay-core-2.8.jar
deleted file mode 100644
index d366ffa7..00000000
Binary files a/hybris/bin/y-ext/ext-worldpay/worldpayapi/lib/worldpay-core-2.8.jar and /dev/null differ
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/project.properties b/hybris/bin/y-ext/ext-worldpay/worldpayapi/project.properties
index aab835b6..957b0403 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/project.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/project.properties
@@ -1,5 +1,5 @@
# Specifies the location of the spring context file putted automatically to the global platform application context.
-worldpayapi.application-context = worldpayapi-spring.xml
+worldpayapi.application-context = worldpayapi-spring.xml,worldpayfraudsighttest-spring.xml,worldpaylevel23test-spring.xml
#WorldpayCreditCardTypesMap
worldpay.creditCard.mappings.VISA-SSL = visa
@@ -32,13 +32,6 @@ worldpay.creditCard.mappings.CARD-SSL = card
worldpay.APM.minutes.before.inquiring.timeout = 15
worldpay.APM.days.before.stop.inquiring.timeout = 5
-worldpaymerchantconfig = worldpayMerchantConfiguration
-worldpaymerchantconfig.electronics-spa = worldpayMerchantConfiguration
-worldpaymerchantconfig.electronics = worldpayMerchantConfiguration
-worldpaymerchantconfig.apparel-de = worldpayMerchantConfiguration
-worldpaymerchantconfig.apparel-uk = worldpayMerchantConfiguration
-worldpaymerchantconfig.powertools = worldpayMerchantConfiguration
-
worldpay.support.email.address = plugins@worldpay.com
worldpay.support.email.display.name = Worldpay Support
worldpay.support.email.subject = Support Information
@@ -78,15 +71,6 @@ worldpay.merchant.token.enabled = false
#spring.profiles.active=applepay
worldpay.addon.version = a591c6d3
-worldpay.config.3dsecureflex.jwt.iss = 5bd9e0e4444dce153428c940
-worldpay.config.3dsecureflex.jwt.jwtmackey = fa2daee2-1fbb-45ff-4444-52805d5cd9e0
-worldpay.config.3dsecureflex.jwt.orgunitid = 5bd9b55e4444761ac0af1c80
-worldpay.config.3dsecureflex.jwt.alg = hs256
-worldpay.config.3dsecureflex.jwt.challengeurl = https://secure-test.worldpay.com/shopper/3ds/challenge.html
-worldpay.config.3dsecureflex.jwt.ddcurl = https://secure-test.worldpay.com/shopper/3ds/ddc.html
-worldpay.config.3dsecureflex.jwt.returnurl = /checkout/multi/worldpay/3dsecureflex/sop/response
-worldpay.config.3dsecureflex.challengepreference = nopreference
-worldpay.config.3dsecureflex.secondauthorisation.submit.url = /checkout/multi/worldpay/3dsecureflex/sop/response/autosubmit
worldpay.config.successURL = /checkout/multi/worldpay/hop-response
worldpay.config.pendingURL = /checkout/multi/worldpay/hop-pending
@@ -98,3 +82,9 @@ worldpay.orderCode.encryption.key = Gr3hIZGUPpOG1aEpXH
worldpay.restconfig.http.connectTimeout = 500
worldpay.restconfig.http.readTimeout = 1500
+
+# Organization id to be moved after the merchant configuration refactoring
+worldpay.merchant.organization.id = 5fd9e78c09c50b2d408f6805
+
+worldpay.config.profile.domain.test = ddc-test.worldpay.com
+worldpay.config.profile.domain.prod = ddc.worldpay.com
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1.dtd b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1.dtd
new file mode 100644
index 00000000..505df33a
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1.dtd
@@ -0,0 +1,2896 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1_wp_original.dtd b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1_wp_original.dtd
new file mode 100644
index 00000000..a4d706f9
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/dtd/paymentService_v1_wp_original.dtd
@@ -0,0 +1,2895 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_de.properties b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_de.properties
index f20f49ff..fb41bce4 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_de.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_de.properties
@@ -1,18 +1,19 @@
-
-# put localizations of item types into this file
-# Note that you can also add special locatizations which
-# can be retrieved with the
-#
-# ...tools.localization.Localization.getLocalizedString(...)
-#
-# methods.
-#
-# syntax for type localizations:
-#
-# type..name=XY
-# type...name=XY
-# type..description=XY
-# type...description=XY
-#
-# yourcustomlocalekey=value
-
+
+# put localizations of item types into this file
+# Note that you can also add special locatizations which
+# can be retrieved with the
+#
+# ...tools.localization.Localization.getLocalizedString(...)
+#
+# methods.
+#
+# syntax for type localizations:
+#
+# type..name=XY
+# type...name=XY
+# type..description=XY
+# type...description=XY
+#
+# yourcustomlocalekey=value
+
+type.WorldpayRiskScore.name =
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_en.properties b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_en.properties
index 85cac4bc..8ac4ad7e 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_en.properties
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/localization/worldpayapi-locales_en.properties
@@ -1,188 +1,356 @@
-type.WorldpayRiskScore.name = Worldpay risk score
-type.WorldpayRiskScore.description = Risk score from worldpay. Contains either worldpay risk scores, or RiskGuardian scores if applicable
-type.WorldpayRiskScore.code.name = code
-type.WorldpayRiskScore.code.description = Unique identifier in hybris.
-type.WorldpayRiskScore.value.name = Worldpay risk score
-type.WorldpayRiskScore.value.description = Risk score from worldpay - not applicable if RiskGuardian is used.
-type.WorldpayRiskScore.provider.name = Provider
-type.WorldpayRiskScore.provider.description = The system used to screen the transaction (RiskGuardian or RiskManagement Service).
-type.WorldpayRiskScore.id.name = Worldpay id
-type.WorldpayRiskScore.id.description = Internal reference number in worldpay
-type.WorldpayRiskScore.finalScore.name = Final score
-type.WorldpayRiskScore.rgid.name = RiskGuardian id
-type.WorldpayRiskScore.rgid.description = Internal reference number in RiskGuardian
-type.WorldpayRiskScore.tScore.name = Transaction score
-type.WorldpayRiskScore.tScore.description = RiskGuardian score applied to the transaction requested
-type.WorldpayRiskScore.tRisk.name = Threshold score
-type.WorldpayRiskScore.tRisk.description = Threshold score between 1-100 at the time of the transaction
-type.WorldpayRiskScore.message.name = Message
-type.WorldpayRiskScore.extendedResponse.name = Extended response
-
-type.Cart.shopperBankCode.name = Bank name
-type.Cart.shopperBankCode.description = Bank chosen in the checkout for an APM through bank transfer
-
-type.PaymentInfo.worldpayOrderCode.name = Worldpay Order Code
-type.PaymentInfo.worldpayOrderCode.description = Stores the Order Code sent to Worldpay
-type.PaymentInfo.transactionIdentifier.name = Transaction Identifier
-type.PaymentInfo.transactionIdentifier.description = Transaction Identifier for Stored Credentials
-
-type.PaymentTransaction.name = Payment transaction
-type.PaymentTransaction.description = Payment transaction
-type.PaymentTransaction.riskScore.name = Worldpay risk score
-type.PaymentTransaction.riskScore.description = Risk score from worldpay. Contains either worldpay risk scores, or RiskGuardian scores if applicable
-type.PaymentTransaction.apmOpen.name = APM in open state
-type.PaymentTransaction.apmOpen.description = Indicates if the APM is Waiting for the asynchronous message from Worldpay
-type.PaymentTransaction.worldpayBank.name = Bank name
-type.PaymentTransaction.worldpayBank.description = Bank chosen in the checkout for an APM through bank transfer
-
-type.PaymentTransactionEntry.pending.name = Pending
-type.PaymentTransactionEntry.pending.description = Indicates whether the transaction is pending processing at Worldpay
-type.PaymentTransactionEntry.aavResponse.name = Worldpay AAV response
-type.PaymentTransactionEntry.aavResponse.description = American Express Advanced Verification received from Worldpay.
-
-type.WorldpayPaymentPage.name = Worldpay Payment Page
-type.WorldpayPaymentPage.description = The customer pays through Worldpay, the world's leading payment service provider.
-
-
-type.worldpayapmconfigurationtocountrycountriescoll.name = Enabled countries
-type.worldpayapmconfigurationtocountrycountriescoll.description = List of enabled countries for this APM
-
-typeworldpayapmconfigurationtocurrencycurrenciescoll.name = Enabled currencies
-type.worldpayapmconfigurationtocurrencycurrenciescoll.description = List of enabled currencies for this APM
-
-type.apmauthorisationtype.name = Authorisation Type
-type.apmauthorisationtype.description = Type of authorisation for the APM
-
-type.apmflowtype.name = Flow Type
-type.apmflowtype.description = Type of interaction flow with the APM
-
-type.worldpayapmconfigurationtocountry.name = APM Countries
-type.worldpayapmconfigurationtocountry.description = List of countries where the APM is applicable
-
-type.worldpayapmconfigurationtocurrency.name = APM Currencies
-type.worldpayapmconfigurationtocurrency.description = List of currencies where the APM is applicable
-
-type.worldpayapmconfigurationtocurrencyrange.name = APM currency range
-type.worldpayapmconfigurationtocurrencyrange.description = Currency range applicable to the APM
-
-type.worldpayapmconfiguration.name = Alternative Payment Method
-type.worldpayapmconfiguration.description = Alternative Payment Method
-
-type.worldpayapmconfiguration.authorisationtype.name = Authorisation Type
-type.worldpayapmconfiguration.authorisationtype.description = Type of Authorisation supported by the APM
-type.worldpayapmconfiguration.code.name = Code
-type.worldpayapmconfiguration.code.description = Worldpay APM code
-type.worldpayapmconfiguration.countries.name = Countries
-type.worldpayapmconfiguration.countries.description = List of countries where the APM is applicable
-type.worldpayapmconfiguration.currencies.name = Currencies
-type.worldpayapmconfiguration.currencies.description = List of currencies where the APM is applicable
-type.worldpayapmconfiguration.currencyRanges.name = Currency ranges
-type.worldpayapmconfiguration.currencyRanges.description = Currency range applicable to the APM
-type.worldpayapmconfiguration.description.name = Description
-type.worldpayapmconfiguration.description.description = Description
-type.worldpayapmconfiguration.flowtype.name = Flow type
-type.worldpayapmconfiguration.flowtype.description = Type of interaction flow with the APM
-type.worldpayapmconfiguration.name.name = Name
-type.worldpayapmconfiguration.name.description = Name of the Alternative Payment Method
-type.worldpayapmconfiguration.bank.name = Bank Transfer
-type.worldpayapmconfiguration.bank.description = This is a Bank Transfer APM
-type.worldpayapmconfiguration.autocancelpendingtimeoutinminutes.name = Auto-cancel pending timeout in minutes
-type.worldpayapmconfiguration.autocancelpendingtimeoutinminutes.description = Timeout in minutes before the order is auto-cancelled
-type.worldpayapmconfiguration.automaticRefunds.name = Automatic Refund
-type.worldpayapmconfiguration.automaticRefunds.description = This APM allows automatic refunds
-type.worldpayapmconfiguration.bankTransferRefunds.name = Bank Transfer Refund
-type.worldpayapmconfiguration.bankTransferRefunds.description = This APM needs to be refunded through Shopper Web Form.
-
-type.worldpaycurrencyrange.name = Currency range
-type.worldpaycurrencyrange.description = Currency range
-
-type.worldpaycurrencyrange.currency.name = Currency
-type.worldpaycurrencyrange.currency.description = Currency
-type.worldpaycurrencyrange.max.name = Maximum
-type.worldpaycurrencyrange.max.description = Maximum allowed amount of the currency
-type.worldpaycurrencyrange.min.name = Minimum
-type.worldpaycurrencyrange.min.description = Minimum allowed amount of the currency
-type.worldpaycurrencyrange.worldpayapmconfiguration.name = APM
-type.worldpaycurrencyrange.worldpayapmconfiguration.description = APM
-
-type.country.worldpayapmconfiguration.name = Alternative Payment Method
-type.country.worldpayapmconfiguration.description = Alternative Payment Method
-
-type.currency.worldpayapmconfiguration.name = Alternative Payment Method
-type.currency.worldpayapmconfiguration.description = Alternative Payment Method
-
-type.worldpayapmpaymentinfo.name = Worldpay APM Payment Info
-type.worldpayapmpaymentinfo.description = Worldpay APM Payment Info
-type.worldpayapmpaymentinfo.apmconfiguration.name = APM Configuration
-type.worldpayapmpaymentinfo.apmconfiguration.description = Worldpay APM Configuration
-type.worldpayapmpaymentinfo.timeoutdate.name = Timeout Date
-type.worldpayapmpaymentinfo.timeoutdate.description = Timeout Date
-type.worldpayapmpaymentinfo.subscriptionId.name = Payment Token
-type.worldpayapmpaymentinfo.subscriptionId.description = Payment Token
-type.worldpayapmpaymentinfo.obfuscatedCardNumber.name = Obfuscated Card Number
-type.WorldpayAPMPaymentInfo.klarnaPaymentType.name = Klarna Payment Type
-type.WorldpayAPMPaymentInfo.klarnaPaymentType.type = Klarna Payment Type
-type.WorldpayAPMPaymentInfo.expiryMonth.name = Card expiry month
-type.WorldpayAPMPaymentInfo.expiryYear.name = Card expiry year
-
-type.paymentinfo.paymenttype.name = Payment type
-type.paymentinfo.paymenttype.description = Payment type
-type.paymentinfo.isApm.name = Is APM
-type.paymentinfo.isApm.description = Shows if the payment was made through an APM or not
-type.paymentinfo.authenticatedShopperID.name = Authenticated Shopper Id
-type.paymentinfo.authenticatedShopperID.description = Contains a unique user reference to the customer
-type.paymentinfo.eventReference.name = Token Event Reference
-type.paymentinfo.eventReference.description = Identifier used to match the token to a transaction
-type.paymentinfo.expiryDate.name = Token Expiry Date
-type.paymentinfo.expiryDate.description = Token Expiry Date
-type.paymentinfo.merchantId.name = Merchant id
-type.paymentinfo.merchantId.description = Merchant id
-
-type.OrderStatus.PAYMENT_PENDING.name = Pending payment notification
-orderStatusDisplay.PAYMENT_PENDING = Awaiting Payment
-
-type.WorldpayAavResponse.name = Worldpay AAV response
-type.WorldpayAavResponse.description = American Express Advanced Verification received from Worldpay.
-
-type.WorldpayAavResponse.code.name = code
-type.WorldpayAavResponse.code.description = Unique identifier in hybris
-type.WorldpayAavResponse.aavAddressResultCode.name = AAV Address Result Code
-type.WorldpayAavResponse.aavAddressResultCode.description = American Express Advanced Verification addressResultCode received from Worldpay
-type.WorldpayAavResponse.aavCardholderNameResultCode.name = AAV Cardholder Name Result Code
-type.WorldpayAavResponse.aavCardholderNameResultCode.description = American Express Advanced Verification cardholderNameResultCode received from Worldpay
-type.WorldpayAavResponse.aavEmailResultCode.name = AAV Email Result Code
-type.WorldpayAavResponse.aavEmailResultCode.description = American Express Advanced Verification emailResultCode received from Worldpay
-type.WorldpayAavResponse.aavPostcodeResultCode.name = AAV Postcode Result Code
-type.WorldpayAavResponse.aavPostcodeResultCode.description = American Express Advanced Verification postcodeResultCode received from Worldpay
-type.WorldpayAavResponse.aavTelephoneResultCode.name = AAV Telephone Result Code
-type.WorldpayAavResponse.aavTelephoneResultCode.description = American Express Advanced Verification telephoneResultCode received from Worldpay
-
-type.WorldpayBankConfiguration.name = Worldpay Bank Configurations
-type.WorldpayBankConfiguration.description = Contains the banks used in the Bank Transfer APMs.
-
-type.WorldpayBankConfiguration.code.name = Bank code
-type.WorldpayBankConfiguration.code.description = Represents the bank code
-type.WorldpayBankConfiguration.apm.name = APM related to the bank.
-type.WorldpayBankConfiguration.apm.description = The APM has a list of banks
-type.WorldpayBankConfiguration.name.name = Name of the bank
-type.WorldpayBankConfiguration.name.description = Name of the bank
-type.WorldpayBankConfiguration.description.name = Bank description
-type.WorldpayBankConfiguration.description.description = Bank description
-type.WorldpayBankConfiguration.active.name = Active
-type.WorldpayBankConfiguration.active.description = Bank is active. And can be chosen on the front-end.
-
-type.ReturnRequest.paymentTransactionEntry.name = Payment Transaction Entry
-type.ReturnRequest.paymentTransactionEntry.description = Payment transaction entry representing the refund.
-
-type.GooglePayPaymentInfo.name = Payment info for transactions made using Google Pay
-type.GooglePayPaymentInfo.protocolVersion.name = Protocol version
-type.GooglePayPaymentInfo.protocolVersion.description = Encryption protocol
-type.GooglePayPaymentInfo.signature.name = Signature
-type.GooglePayPaymentInfo.signature.description = Signature of the encrypted signed message
-type.GooglePayPaymentInfo.signedMessage.name = Signed Message
-type.GooglePayPaymentInfo.signedMessage.description = Contains the information for Worldpay to decrypt.
-
-type.ApplePayPaymentInfo.name = ApplePay payment info for transactions made using Apple Pay
-type.ApplePayPaymentInfo.transactionId.name = Transaction ID
-type.ApplePayPaymentInfo.version.name = Version
+type.WorldpayRiskScore.name = Worldpay risk score
+type.WorldpayRiskScore.description = Risk score from worldpay. Contains either worldpay risk scores, or RiskGuardian scores if applicable
+type.WorldpayRiskScore.code.name = code
+type.WorldpayRiskScore.code.description = Unique identifier in hybris.
+type.WorldpayRiskScore.value.name = Worldpay risk score
+type.WorldpayRiskScore.value.description = Risk score from worldpay - not applicable if RiskGuardian is used.
+type.WorldpayRiskScore.provider.name = Provider
+type.WorldpayRiskScore.provider.description = The system used to screen the transaction (RiskGuardian or RiskManagement Service).
+type.WorldpayRiskScore.id.name = Worldpay id
+type.WorldpayRiskScore.id.description = Internal reference number in worldpay
+type.WorldpayRiskScore.finalScore.name = Final score
+type.WorldpayRiskScore.rgid.name = RiskGuardian id
+type.WorldpayRiskScore.rgid.description = Internal reference number in RiskGuardian
+type.WorldpayRiskScore.tScore.name = Transaction score
+type.WorldpayRiskScore.tScore.description = RiskGuardian score applied to the transaction requested
+type.WorldpayRiskScore.tRisk.name = Threshold score
+type.WorldpayRiskScore.tRisk.description = Threshold score between 1-100 at the time of the transaction
+type.WorldpayRiskScore.message.name = Message
+type.WorldpayRiskScore.extendedResponse.name = Extended response
+type.Cart.shopperBankCode.name = Bank name
+type.Cart.shopperBankCode.description = Bank chosen in the checkout for an APM through bank transfer
+type.Cart.threeDSChallengeSession.name = 3DS Challenge session data
+type.Cart.threeDSChallengeSession.description = 3DS Challenge session data
+
+type.Product.commodityCode.name = Commodity code for the product
+type.Product.commodityCode.description = Commodity code defined by the National Institute of Governmental Purchasing
+
+type.AbstractOrder.isPrimeRouteAuth.name = Authorised with Prime Routing?
+type.AbstractOrder.isPrimeRouteAuth.description = Determines if the transaction is done using Prime Routing
+type.AbstractOrder.requestsPayload.name = Worldpay Requests Payload
+type.AbstractOrder.requestsPayload.description = Worldpay Requests Payload
+type.AbstractOrder.responsesPayload.name = Worldpay Responses Payload
+type.AbstractOrder.responsesPayload.description = Worldpay Responses Payload
+
+type.Payload.name = Worldpay Payment Payload
+type.Payload.description = Worldpay Payment Payload
+type.Payload.payload.name = Request/Response Payload
+type.Payload.payload.description = Request/Response Payload
+
+type.PaymentInfo.worldpayOrderCode.name = Worldpay Order Code
+type.PaymentInfo.worldpayOrderCode.description = Stores the Order Code sent to Worldpay
+type.PaymentInfo.transactionIdentifier.name = Transaction Identifier
+type.PaymentInfo.transactionIdentifier.description = Transaction Identifier for Stored Credentials
+
+type.PaymentTransaction.name = Payment transaction
+type.PaymentTransaction.description = Payment transaction
+type.PaymentTransaction.riskScore.name = Worldpay risk score
+type.PaymentTransaction.riskScore.description = Risk score from worldpay. Contains either worldpay risk scores, or RiskGuardian scores if applicable
+type.PaymentTransaction.fraudSight.name = Worldpay Fraud Sight
+type.PaymentTransaction.fraudSight.description = Fraud Sight from worldpay. Contains worldpay fraud score, the risk decision and the reasons
+type.PaymentTransaction.apmOpen.name = APM in open state
+type.PaymentTransaction.apmOpen.description = Indicates if the APM is Waiting for the asynchronous message from Worldpay
+type.PaymentTransaction.worldpayBank.name = Bank name
+type.PaymentTransaction.worldpayBank.description = Bank chosen in the checkout for an APM through bank transfer
+
+type.PaymentTransactionEntry.pending.name = Pending
+type.PaymentTransactionEntry.pending.description = Indicates whether the transaction is pending processing at Worldpay
+type.PaymentTransactionEntry.aavResponse.name = Worldpay AAV response
+type.PaymentTransactionEntry.aavResponse.description = American Express Advanced Verification received from Worldpay.
+
+type.WorldpayPaymentPage.name = Worldpay Payment Page
+type.WorldpayPaymentPage.description = The customer pays through Worldpay, the world's leading payment service provider.
+
+
+type.worldpayapmconfigurationtocountrycountriescoll.name = Enabled countries
+type.worldpayapmconfigurationtocountrycountriescoll.description = List of enabled countries for this APM
+
+typeworldpayapmconfigurationtocurrencycurrenciescoll.name = Enabled currencies
+type.worldpayapmconfigurationtocurrencycurrenciescoll.description = List of enabled currencies for this APM
+
+type.apmauthorisationtype.name = Authorisation Type
+type.apmauthorisationtype.description = Type of authorisation for the APM
+
+type.apmflowtype.name = Flow Type
+type.apmflowtype.description = Type of interaction flow with the APM
+
+type.worldpayapmconfigurationtocountry.name = APM Countries
+type.worldpayapmconfigurationtocountry.description = List of countries where the APM is applicable
+
+type.worldpayapmconfigurationtocurrency.name = APM Currencies
+type.worldpayapmconfigurationtocurrency.description = List of currencies where the APM is applicable
+
+type.worldpayapmconfigurationtocurrencyrange.name = APM currency range
+type.worldpayapmconfigurationtocurrencyrange.description = Currency range applicable to the APM
+
+type.worldpayapmconfiguration.name = Alternative Payment Method
+type.worldpayapmconfiguration.description = Alternative Payment Method
+
+type.worldpayapmconfiguration.authorisationtype.name = Authorisation Type
+type.worldpayapmconfiguration.authorisationtype.description = Type of Authorisation supported by the APM
+type.worldpayapmconfiguration.code.name = Code
+type.worldpayapmconfiguration.code.description = Worldpay APM code
+type.worldpayapmconfiguration.countries.name = Countries
+type.worldpayapmconfiguration.countries.description = List of countries where the APM is applicable
+type.worldpayapmconfiguration.currencies.name = Currencies
+type.worldpayapmconfiguration.currencies.description = List of currencies where the APM is applicable
+type.worldpayapmconfiguration.currencyRanges.name = Currency ranges
+type.worldpayapmconfiguration.currencyRanges.description = Currency range applicable to the APM
+type.worldpayapmconfiguration.description.name = Description
+type.worldpayapmconfiguration.description.description = Description
+type.worldpayapmconfiguration.flowtype.name = Flow type
+type.worldpayapmconfiguration.flowtype.description = Type of interaction flow with the APM
+type.worldpayapmconfiguration.name.name = Name
+type.worldpayapmconfiguration.name.description = Name of the Alternative Payment Method
+type.worldpayapmconfiguration.bank.name = Bank Transfer
+type.worldpayapmconfiguration.bank.description = This is a Bank Transfer APM
+type.worldpayapmconfiguration.autocancelpendingtimeoutinminutes.name = Auto-cancel pending timeout in minutes
+type.worldpayapmconfiguration.autocancelpendingtimeoutinminutes.description = Timeout in minutes before the order is auto-cancelled
+type.worldpayapmconfiguration.automaticRefunds.name = Automatic Refund
+type.worldpayapmconfiguration.automaticRefunds.description = This APM allows automatic refunds
+type.worldpayapmconfiguration.bankTransferRefunds.name = Bank Transfer Refund
+type.worldpayapmconfiguration.bankTransferRefunds.description = This APM needs to be refunded through Shopper Web Form.
+
+type.worldpaycurrencyrange.name = Currency range
+type.worldpaycurrencyrange.description = Currency range
+
+type.worldpaycurrencyrange.currency.name = Currency
+type.worldpaycurrencyrange.currency.description = Currency
+type.worldpaycurrencyrange.max.name = Maximum
+type.worldpaycurrencyrange.max.description = Maximum allowed amount of the currency
+type.worldpaycurrencyrange.min.name = Minimum
+type.worldpaycurrencyrange.min.description = Minimum allowed amount of the currency
+type.worldpaycurrencyrange.worldpayapmconfiguration.name = APM
+type.worldpaycurrencyrange.worldpayapmconfiguration.description = APM
+
+type.country.worldpayapmconfiguration.name = Alternative Payment Method
+type.country.worldpayapmconfiguration.description = Alternative Payment Method
+
+type.currency.worldpayapmconfiguration.name = Alternative Payment Method
+type.currency.worldpayapmconfiguration.description = Alternative Payment Method
+
+type.worldpayapmpaymentinfo.name = Worldpay APM Payment Info
+type.worldpayapmpaymentinfo.description = Worldpay APM Payment Info
+type.worldpayapmpaymentinfo.apmconfiguration.name = APM Configuration
+type.worldpayapmpaymentinfo.apmconfiguration.description = Worldpay APM Configuration
+type.worldpayapmpaymentinfo.timeoutdate.name = Timeout Date
+type.worldpayapmpaymentinfo.timeoutdate.description = Timeout Date
+type.worldpayapmpaymentinfo.subscriptionId.name = Payment Token
+type.worldpayapmpaymentinfo.subscriptionId.description = Payment Token
+type.worldpayapmpaymentinfo.obfuscatedCardNumber.name = Obfuscated Card Number
+type.WorldpayAPMPaymentInfo.klarnaPaymentType.name = Klarna Payment Type
+type.WorldpayAPMPaymentInfo.klarnaPaymentType.type = Klarna Payment Type
+type.WorldpayAPMPaymentInfo.expiryMonth.name = Card expiry month
+type.WorldpayAPMPaymentInfo.expiryYear.name = Card expiry year
+
+type.paymentinfo.paymenttype.name = Payment type
+type.paymentinfo.paymenttype.description = Payment type
+type.paymentinfo.isApm.name = Is APM
+type.paymentinfo.isApm.description = Shows if the payment was made through an APM or not
+type.paymentinfo.authenticatedShopperID.name = Authenticated Shopper Id
+type.paymentinfo.authenticatedShopperID.description = Contains a unique user reference to the customer
+type.paymentinfo.eventReference.name = Token Event Reference
+type.paymentinfo.eventReference.description = Identifier used to match the token to a transaction
+type.paymentinfo.expiryDate.name = Token Expiry Date
+type.paymentinfo.expiryDate.description = Token Expiry Date
+type.paymentinfo.merchantId.name = Merchant id
+type.paymentinfo.merchantId.description = Merchant id
+
+type.OrderStatus.PAYMENT_PENDING.name = Pending payment notification
+orderStatusDisplay.PAYMENT_PENDING = Awaiting Payment
+
+type.WorldpayAavResponse.name = Worldpay AAV response
+type.WorldpayAavResponse.description = American Express Advanced Verification received from Worldpay.
+
+type.WorldpayAavResponse.code.name = code
+type.WorldpayAavResponse.code.description = Unique identifier in hybris
+type.WorldpayAavResponse.aavAddressResultCode.name = AAV Address Result Code
+type.WorldpayAavResponse.aavAddressResultCode.description = American Express Advanced Verification addressResultCode received from Worldpay
+type.WorldpayAavResponse.aavCardholderNameResultCode.name = AAV Cardholder Name Result Code
+type.WorldpayAavResponse.aavCardholderNameResultCode.description = American Express Advanced Verification cardholderNameResultCode received from Worldpay
+type.WorldpayAavResponse.aavEmailResultCode.name = AAV Email Result Code
+type.WorldpayAavResponse.aavEmailResultCode.description = American Express Advanced Verification emailResultCode received from Worldpay
+type.WorldpayAavResponse.aavPostcodeResultCode.name = AAV Postcode Result Code
+type.WorldpayAavResponse.aavPostcodeResultCode.description = American Express Advanced Verification postcodeResultCode received from Worldpay
+type.WorldpayAavResponse.aavTelephoneResultCode.name = AAV Telephone Result Code
+type.WorldpayAavResponse.aavTelephoneResultCode.description = American Express Advanced Verification telephoneResultCode received from Worldpay
+
+type.WorldpayBankConfiguration.name = Worldpay Bank Configurations
+type.WorldpayBankConfiguration.description = Contains the banks used in the Bank Transfer APMs.
+
+type.WorldpayBankConfiguration.code.name = Bank code
+type.WorldpayBankConfiguration.code.description = Represents the bank code
+type.WorldpayBankConfiguration.apm.name = APM related to the bank.
+type.WorldpayBankConfiguration.apm.description = The APM has a list of banks
+type.WorldpayBankConfiguration.name.name = Name of the bank
+type.WorldpayBankConfiguration.name.description = Name of the bank
+type.WorldpayBankConfiguration.description.name = Bank description
+type.WorldpayBankConfiguration.description.description = Bank description
+type.WorldpayBankConfiguration.active.name = Active
+type.WorldpayBankConfiguration.active.description = Bank is active. And can be chosen on the front-end.
+
+type.ReturnRequest.paymentTransactionEntry.name = Payment Transaction Entry
+type.ReturnRequest.paymentTransactionEntry.description = Payment transaction entry representing the refund.
+
+type.GooglePayPaymentInfo.name = Payment info for transactions made using Google Pay
+type.GooglePayPaymentInfo.protocolVersion.name = Protocol version
+type.GooglePayPaymentInfo.protocolVersion.description = Encryption protocol
+type.GooglePayPaymentInfo.signature.name = Signature
+type.GooglePayPaymentInfo.signature.description = Signature of the encrypted signed message
+type.GooglePayPaymentInfo.signedMessage.name = Signed Message
+type.GooglePayPaymentInfo.signedMessage.description = Contains the information for Worldpay to decrypt.
+
+type.ApplePayPaymentInfo.name = ApplePay payment info for transactions made using Apple Pay
+type.ApplePayPaymentInfo.transactionId.name = Transaction ID
+type.ApplePayPaymentInfo.version.name = Version
+
+### Localization for type BaseSite
+type.BaseSite.webMerchantConfiguration.name = Web Merchant Configuration
+type.BaseSite.webMerchantConfiguration.description = Merchant Configuration for Web uses
+type.BaseSite.asmMerchantConfiguration.name = ASM Merchant Configuration
+type.BaseSite.asmMerchantConfiguration.description = Merchant Configuration for ASM uses
+type.BaseSite.replenishmentMerchantConfiguration.name = Replenishment Merchant Configuration
+type.BaseSite.replenishmentMerchantConfiguration.description = Merchant Configuration for Replenishment uses
+type.BaseSite.enableFS.name = Is FraudSight enabled?
+type.BaseSite.enableFS.description = Determines whether the FraudSight is enabled
+type.BaseSite.enablePR.name = Is Prime Routing enabled?
+type.BaseSite.enablePR.description = Determines whether the Prime Routing is enabled
+type.BaseSite.enableLevel2.name = Is Level 2 enabled?
+type.BaseSite.enableLevel2.description = Determines whether the Level 2 is enabled
+type.BaseSite.enableLevel3.name = Is Level 3 enabled?
+type.BaseSite.enableLevel3.description = Determines whether the Level 3 is enabled
+
+### Localization for type WorldpayMerchantConfiguration
+type.WorldpayMerchantConfiguration.name = Merchant Configuration
+type.WorldpayMerchantConfiguration.description = Merchant Configuration for Worldpay
+type.WorldpayMerchantConfiguration.identifier.name = Identifier
+type.WorldpayMerchantConfiguration.identifier.description = Unique identifier for the merchant configuration
+type.WorldpayMerchantConfiguration.code.name = Merchant Code
+type.WorldpayMerchantConfiguration.code.description = Code for the merchant
+type.WorldpayMerchantConfiguration.password.name = Password
+type.WorldpayMerchantConfiguration.password.description = The valid password of your account
+type.WorldpayMerchantConfiguration.macValidation.name = Is Mac Validation enabled?
+type.WorldpayMerchantConfiguration.macValidation.description = Determines whether the Mac Validation is enabled
+type.WorldpayMerchantConfiguration.macSecret.name = Mac Secret
+type.WorldpayMerchantConfiguration.macSecret.description = Mac Secret provided in the Worldpay console
+type.WorldpayMerchantConfiguration.csePublicKey.name = CSE Public Key
+type.WorldpayMerchantConfiguration.csePublicKey.description = The account CSE Public Key
+type.WorldpayMerchantConfiguration.installationId.name = Installation Id
+type.WorldpayMerchantConfiguration.installationId.description = The merchant installation id
+type.WorldpayMerchantConfiguration.statementNarrative.name = Statement Narrative
+type.WorldpayMerchantConfiguration.statementNarrative.description = The statement narrative for the merchant
+type.WorldpayMerchantConfiguration.orderContent.name = Order Content
+type.WorldpayMerchantConfiguration.orderContent.description = The order content value
+type.WorldpayMerchantConfiguration.applePayConfiguration.name = ApplePay Configuration
+type.WorldpayMerchantConfiguration.applePayConfiguration.description = The configuration for ApplePay
+type.WorldpayMerchantConfiguration.googlePayConfiguration.name = GooglePay Configuration
+type.WorldpayMerchantConfiguration.googlePayConfiguration.description = The configuration for GooglePay
+type.WorldpayMerchantConfiguration.threeDSFlexJsonWebTokenSettings.name = The 3DS2 Configuration
+type.WorldpayMerchantConfiguration.threeDSFlexJsonWebTokenSettings.description = The configuration for 3DS2
+type.WorldpayMerchantConfiguration.threeDSFlexChallengePreference.name = 3DS Flex Challenge Preference
+type.WorldpayMerchantConfiguration.threeDSFlexChallengePreference.description = The 3DS flex challenge preference
+type.WorldpayMerchantConfiguration.excludedPaymentTypes.name = Excluded payment types
+type.WorldpayMerchantConfiguration.excludedPaymentTypes.description = The excluded payment types
+type.WorldpayMerchantConfiguration.includedPaymentTypes.name = Included payment types
+type.WorldpayMerchantConfiguration.includedPaymentTypes.description = The included payment types
+type.WorldpayMerchantConfiguration.cardAcceptorTaxID.name = Card Acceptor Tax ID for Level 2/3 Data
+type.WorldpayMerchantConfiguration.cardAcceptorTaxID.description = Card Acceptor Tax ID for Level 2/3 Data
+
+### Localization for type WorldpayApplePayConfiguration
+type.WorldpayApplePayConfiguration.name = ApplePay Configuration
+type.WorldpayApplePayConfiguration.description = The Worldpay configuration for ApplePay
+type.WorldpayApplePayConfiguration.identifier.name = Identifier
+type.WorldpayApplePayConfiguration.identifier.description = Unique Identifier of ApplePay Configuration
+type.WorldpayApplePayConfiguration.merchantId.name = Merchant identifier
+type.WorldpayApplePayConfiguration.merchantId.description = The merchant identifier you registered with Apple for use with ApplePay.
+type.WorldpayApplePayConfiguration.merchantName.name = Merchant Name
+type.WorldpayApplePayConfiguration.merchantName.description = Merchant Name for ApplePay
+type.WorldpayApplePayConfiguration.countryCode.name = Country Code
+type.WorldpayApplePayConfiguration.countryCode.description = The merchant’s two-letter country code.
+type.WorldpayApplePayConfiguration.supportedNetworks.name = Payment networks
+type.WorldpayApplePayConfiguration.supportedNetworks.description = The payment networks supported by the merchant.
+type.WorldpayApplePayConfiguration.merchantCapabilities.name = Payment capabilities
+type.WorldpayApplePayConfiguration.merchantCapabilities.description = The payment capabilities, such as credit or debit, supported by the merchant.
+
+### Localization for type WorldpayGooglePayConfiguration
+type.WorldpayGooglePayConfiguration.name = GooglePay Configuration
+type.WorldpayGooglePayConfiguration.description = The Worldpay configuration for GooglePay
+type.WorldpayGooglePayConfiguration.identifier.name = Identifier
+type.WorldpayGooglePayConfiguration.identifier.description = Unique Identifier of GooglePay Configuration
+type.WorldpayGooglePayConfiguration.merchantId.name = Merchant identifier
+type.WorldpayGooglePayConfiguration.merchantId.description = The merchant identifier you registered with Google for use with GooglePay.
+type.WorldpayGooglePayConfiguration.merchantName.name = Merchant Name
+type.WorldpayGooglePayConfiguration.merchantName.description = Merchant Name for GooglePay
+type.WorldpayGooglePayConfiguration.gatewayMerchantId.name = Gateway merchant ID
+type.WorldpayGooglePayConfiguration.gatewayMerchantId.description = Site's gateway merchant identifier
+type.WorldpayGooglePayConfiguration.environment.name = Environment
+type.WorldpayGooglePayConfiguration.environment.description = Used to return chargeable payment methods when a valid Google merchant ID is specified and configured for the domain
+type.WorldpayGooglePayConfiguration.cardType.name = Type
+type.WorldpayGooglePayConfiguration.cardType.description = Describe your site's support for the CARD payment method
+type.WorldpayGooglePayConfiguration.allowedCardNetworks.name = Allowed Card networks
+type.WorldpayGooglePayConfiguration.allowedCardNetworks.description = Card networks supported by your site and your gateway
+type.WorldpayGooglePayConfiguration.allowedAuthMethods.name = Allowed Card authentication methods
+type.WorldpayGooglePayConfiguration.allowedAuthMethods.description = Card authentication methods supported by your site and your gateway
+
+### Localization for type WorldpayThreeDS2JsonWebTokenConfiguration
+type.WorldpayThreeDS2JsonWebTokenConfiguration.name = 3DS2 Configuration
+type.WorldpayThreeDS2JsonWebTokenConfiguration.description = The Worldpay configuration for 3DS2
+type.WorldpayThreeDS2JsonWebTokenConfiguration.identifier.name = Identifier
+type.WorldpayThreeDS2JsonWebTokenConfiguration.identifier.description = Unique Identifier of ThreeDS2 Configuration
+type.WorldpayThreeDS2JsonWebTokenConfiguration.iss.name = ISS
+type.WorldpayThreeDS2JsonWebTokenConfiguration.iss.description = The issuer identifier
+type.WorldpayThreeDS2JsonWebTokenConfiguration.jwtMacKey.name = JWT Mac Key
+type.WorldpayThreeDS2JsonWebTokenConfiguration.jwtMacKey.description = The 3DS2 JWT mac key
+type.WorldpayThreeDS2JsonWebTokenConfiguration.orgUnitId.name = Organisation unit id
+type.WorldpayThreeDS2JsonWebTokenConfiguration.orgUnitId.description = The 3DS2 JWT organisation unit id
+type.WorldpayThreeDS2JsonWebTokenConfiguration.alg.name = ALG
+type.WorldpayThreeDS2JsonWebTokenConfiguration.alg.description = The 3DS2 JWT alg
+type.WorldpayThreeDS2JsonWebTokenConfiguration.eventOriginDomain.name = Event Origin Domain
+type.WorldpayThreeDS2JsonWebTokenConfiguration.eventOriginDomain.description = The domain origin as TEST, PROD, MOCK
+type.WorldpayThreeDS2JsonWebTokenConfiguration.challengeUrl.name = Challenge Url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.challengeUrl.description = The 3DS2 JWT challenge url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.ddcUrl.name = DDC Url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.ddcUrl.description = The 3DS2 JWT ddc url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.flowReturnUrl.name = 3DS2 flex flow return url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.flowReturnUrl.description = The 3DS2 flex flow return url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.authSubmit.name = 3DS2 flex auth submit
+type.WorldpayThreeDS2JsonWebTokenConfiguration.authSubmit.description = The 3DS2 flex auth submit
+type.WorldpayThreeDS2JsonWebTokenConfiguration.occFlowReturnUrl.name = 3DS2 flex occ flow return url
+type.WorldpayThreeDS2JsonWebTokenConfiguration.occFlowReturnUrl.description = The 3DS2 flex occ flow return url
+
+### Localization for type EnvironmentType
+type.EnvironmentType.name = Environment
+type.EnvironmentType.description = The Environment enumeration.
+
+# Localization for enum ApplePaySupportedNetworks
+type.ApplePaySupportedNetworks.name = ApplePay payment networks
+type.ApplePaySupportedNetworks.description = The payment networks supported by the merchant.
+
+# Localization for enum ApplePayMerchantCapabilities
+type.ApplePayMerchantCapabilities.name = ApplePay payment capabilities
+type.ApplePayMerchantCapabilities.description = The payment capabilities, such as credit or debit, supported by the merchant.
+
+# Localization for enum GooglePayCardNetworks
+type.GooglePayCardNetworks.name = GooglePay Card networks supported
+type.GooglePayCardNetworks.description = Card networks supported by your site and your gateway.
+
+# Localization for enum GooglePayCardAuthMethods
+type.GooglePayCardAuthMethods.name = GooglePay Card authentication methods
+type.GooglePayCardAuthMethods.description = Card authentication methods supported by your site and your gateway.
+
+# Localization for enum ChallengePreference
+type.ChallengePreference.name = 3DS Flex Challenge Preference
+type.ChallengePreference.description = The 3DS Flex Challenge Preference
+
+### Localization for type WorldpayFraudSight
+type.WorldpayFraudSight.name = Worldpay Fraud Sight
+type.WorldpayFraudSight.description = The Worldpay Fraud Sight information
+type.WorldpayFraudSight.id.name = Id
+type.WorldpayFraudSight.id.description = The unique identifier generated for the payment event
+type.WorldpayFraudSight.score.name = Score
+type.WorldpayFraudSight.score.description = The score returned by the FraudSight model
+type.WorldpayFraudSight.message.name = Message
+type.WorldpayFraudSight.message.description = FraudSight risk decision value
+type.WorldpayFraudSight.reasonCodes.name = Reason code values
+type.WorldpayFraudSight.reasonCodes.description = Risk reasons triggered by the FraudSight model
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants-distribution.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants-distribution.xml
deleted file mode 100644
index 5b70e267..00000000
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants-distribution.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PAN_ONLY
-
-
-
-
-
- AMEX
- DISCOVER
- JCB
- MASTERCARD
- VISA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- supportsCredit
- supportsDebit
- supports3DS
- supportsEMV
-
-
-
-
- amex
-
-
- discover
-
-
-
- jcb
- maestro
- masterCard
-
- visa
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants.xml
deleted file mode 100644
index 766618f0..00000000
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/merchants/merchants.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/schema/paymentService_v1.xsd b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/schema/paymentService_v1.xsd
new file mode 100644
index 00000000..33dfd1d7
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/schema/paymentService_v1.xsd
@@ -0,0 +1,7032 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-appenders-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-appenders-spring.xml
new file mode 100644
index 00000000..ed48d1eb
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-appenders-spring.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/applepay/worldpayapi-applepay-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-applepay-spring.xml
similarity index 99%
rename from hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/applepay/worldpayapi-applepay-spring.xml
rename to hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-applepay-spring.xml
index adcc081a..9747d45b 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/applepay/worldpayapi-applepay-spring.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-applepay-spring.xml
@@ -3,6 +3,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
profile="applepay">
+
@@ -17,4 +18,5 @@
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-commands-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-commands-spring.xml
new file mode 100644
index 00000000..a4536efd
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-commands-spring.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/converters/worldpayapi-converters-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-converters-spring.xml
similarity index 74%
rename from hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/converters/worldpayapi-converters-spring.xml
rename to hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-converters-spring.xml
index 15f615db..d705b536 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/converters/worldpayapi-converters-spring.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-converters-spring.xml
@@ -7,7 +7,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
@@ -40,6 +40,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -88,12 +101,12 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-daos-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-daos-spring.xml
new file mode 100644
index 00000000..93e63d8f
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-daos-spring.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-facades-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-facades-spring.xml
new file mode 100644
index 00000000..15a1c091
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-facades-spring.xml
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-factories-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-factories-spring.xml
new file mode 100644
index 00000000..b75ff0f7
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-factories-spring.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/gateway/worldpayapi-gateway-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-gateway-spring.xml
similarity index 79%
rename from hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/gateway/worldpayapi-gateway-spring.xml
rename to hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-gateway-spring.xml
index 1195ca9e..2b319d88 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/gateway/worldpayapi-gateway-spring.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-gateway-spring.xml
@@ -10,6 +10,8 @@
+
+
@@ -25,7 +27,10 @@
+ class="com.worldpay.service.response.transform.impl.DefaultServiceResponseTransformerHelper">
+
+
+
@@ -41,7 +46,9 @@
parent="abstractServiceResponseTransformer"/>
+ parent="abstractServiceResponseTransformer">
+
+
-
-
+
+
+
+
+
@@ -89,6 +100,7 @@
+
@@ -99,44 +111,55 @@
-
+
+
-
+
+
-
+
+
+
+
+
-
+
+
+
+
+
-
+
-
+
-
+
@@ -152,6 +175,7 @@
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-handlers-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-handlers-spring.xml
new file mode 100644
index 00000000..38d38d7f
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-handlers-spring.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-interceptors-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-interceptors-spring.xml
new file mode 100644
index 00000000..cf8a4a3f
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-interceptors-spring.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-internal-converters-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-internal-converters-spring.xml
new file mode 100644
index 00000000..17096cec
--- /dev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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/fulfilment/worldpayapi-order-actions-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-order-actions-spring.xml
similarity index 100%
rename from hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/fulfilment/worldpayapi-order-actions-spring.xml
rename to hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-order-actions-spring.xml
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-services-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-services-spring.xml
new file mode 100644
index 00000000..3270e99b
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-services-spring.xml
@@ -0,0 +1,364 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-strategies-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-strategies-spring.xml
new file mode 100644
index 00000000..5897cd44
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/spring/worldpayapi-strategies-spring.xml
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/test/integration/worldpayAPMComponentTest.impex b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/test/integration/worldpayAPMComponentTest.impex
new file mode 100644
index 00000000..3b599e51
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/test/integration/worldpayAPMComponentTest.impex
@@ -0,0 +1,31 @@
+$catalog1-id = testCatalog1
+$catalog1-version = Online
+$catalogversion1 = catalogversion(catalog(id), version)[unique=true, default=$catalog1-id:$catalog1-version]
+
+$catalog2-id = testCatalog2
+$catalog2-version = Online
+$catalogversion2 = catalogversion(catalog(id), version)[unique=true, default=$catalog2-id:$catalog2-version]
+
+INSERT_UPDATE Country; isocode[unique = true]; name[lang = en] ; active
+ ; DE ; Germany ; true
+ ; US ; United States of America ; true
+
+INSERT_UPDATE Currency; isocode[unique = true]; name[lang = en]; active; base ; conversion; digits; symbol; ;
+ ; EUR ; Euro ; true ; true ; 1 ; 2 ; E ; ;
+ ; USD ; US Dollar ; true ; false ; 1,38 ; 2 ; $ ; ;
+
+INSERT_UPDATE Catalog; id[unique = true]; name[lang = en]; defaultCatalog
+ ; $catalog1-id ; $catalog1-id ; true
+ ; $catalog2-id ; $catalog2-id ; true
+
+INSERT_UPDATE CatalogVersion; catalog(id)[unique = true]; version[unique = true]; active
+ ; $catalog1-id ; $catalog1-version ; true
+ ; $catalog2-id ; $catalog2-version ; true
+
+INSERT_UPDATE WorldpayAPMConfiguration; code[unique = true]; name[lang = en]; description[lang = en]; bank[default = false]; currencies(isocode); countries(isocode); automaticRefunds[default = false]; bankTransferRefunds[default = false]
+ ; GIROPAY-SSL ; GIROPAY ; GiroPay ; ; EUR ; DE ; true ;
+ ; IDEAL-SSL ; iDeal ; iDeal ; true ; USD ; US ; true ;
+
+INSERT_UPDATE WorldpayAPMComponent; uid[unique = true]; $catalogversion1[unique = true]; name ; apmConfiguration(code)
+ ; giropayComponent ; ; "Giropay" ; GIROPAY-SSL
+ ; idealComponent ; ; "iDeal" ; IDEAL-SSL
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-beans.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-beans.xml
index a2f74438..1e0173b3 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-beans.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-beans.xml
@@ -41,6 +41,7 @@
REFUND_WEBFORM_ISSUED
SHOPPER_REDIRECTED
FAILURE
+ VOIDED
@@ -52,6 +53,7 @@
LEGACY_FLOW
THREEDSFLEX_FLOW
+
NA
FIRST
@@ -86,6 +88,12 @@
ERROR_SPLIT_AUTH
+
+ PHYSICAL
+ DISCOUNT
+ SHIPPING_FEE
+
+
Used for recurring orders where no CartModel is provided
@@ -131,6 +139,8 @@
+
+
@@ -376,4 +386,591 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-items.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-items.xml
index 6fe134ed..4438bb5e 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-items.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-items.xml
@@ -2,14 +2,22 @@
+
+
+
+
+
+
+
@@ -23,6 +31,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -45,11 +126,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Extending Abstract Order to hold the worldpay order code
+ Extending Abstract Order to hold the worldpay attributes
@@ -59,6 +168,19 @@
Decline code of the transaction if it was refused
+
+
+ Determines if the transaction is done using Prime Routing
+ Boolean.FALSE
+
+
+ Worldpay api requests payload
+
+
+
+ Worldpay api responses payload
+
+
@@ -68,7 +190,7 @@
- Extending Cart to hold bank code
+ Extending Cart to worldpay attributes
@@ -82,6 +204,42 @@
+
+
+
+
+
+
+ HYBRIS.LONG_STRING
+
+
+ MEDIUMTEXT
+
+
+ CLOB
+
+
+ TEXT
+
+
+ NCLOB
+
+
+
+
+
+
+
+ Extending Product to hold the commodity code
+
+
+
+ Commodity code for the product
+
+
+
+
@@ -270,6 +428,10 @@
+
+
+
+
@@ -282,6 +444,37 @@
+
+
+
+
+
+
+ The unique identifier generated for the payment event
+
+
+
+
+ The score returned by the FraudSight model
+
+
+
+
+ FraudSight risk decision value
+
+
+
+
+ Risk reasons triggered by the FraudSight model
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unique Identifier of MerchantConfig
+
+
+
+
+ Code of MerchantConfig.
+
+
+
+ The valid password of your account.
+
+
+
+
+ java.lang.Boolean.FALSE
+ Determines whether the Mac Validation is enabled.
+
+
+
+ Mac Secret provided in the Worldpay console.
+
+
+
+
+ CLOB
+
+
+ nvarchar(max)
+
+
+ text
+
+
+ NCLOB
+
+
+ HYBRIS.LONG_STRING
+
+
+ The account CSE Public Key.
+
+
+
+ The merchant installation id.
+
+
+
+ The statement narrative for the merchant.
+
+
+
+
+ CLOB
+
+
+ nvarchar(max)
+
+
+ text
+
+
+ NCLOB
+
+
+ HYBRIS.LONG_STRING
+
+
+ The order content value.
+
+
+
+ The configuration for ApplePay.
+
+
+
+ The configuration for GooglePay.
+
+
+
+ The configuration for 3DS2.
+
+
+
+ The 3DS flex challenge preference.
+
+
+
+ The excluded payment types.
+
+
+
+ The included payment types.
+
+
+
+ Card Acceptor Tax ID for Level 2/3 data
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unique Identifier of ApplePay Configuration
+
+
+
+
+ Merchant identifier
+
+
+
+ Merchant Name
+
+
+
+ Country Code
+
+
+
+
+
+
+
+
+
+ Unique Identifier of GooglePay Configuration
+
+
+
+
+ Merchant identifier
+
+
+
+ Merchant Name
+
+
+
+ Gateway merchant ID, which is provided by the gateway
+
+
+
+ The Worldpay environment to which we is integrated.
+ test
+
+
+
+ Describe your site's support for the CARD payment method
+
+
+
+
+
+
+
+
+
+ Unique Identifier of ThreeDS2 Configuration
+
+
+
+
+ The 3DS2 jwt ISS
+
+
+
+ The 3DS2 jwt mac key
+
+
+
+ The 3DS2 jwt organisation unit id
+
+
+
+ The 3DS2 jwt alg
+ TEST
+
+
+
+ The domain origin as TEST, PROD, MOCK
+
+
+
+ The 3DS2 jwt challenge url
+
+
+
+ The 3DS2 jwt ddc url
+
+
+
+ The 3DS2 flex flow return url
+
+
+
+ The 3DS2 flex occ flow return url
+
+
+
+ The 3DS2 flex auth submit
+
+
+
+
+
+
+ Extending BaseSite type with additional attributes.
+
+
+
+
+ java.lang.Boolean.FALSE
+ Enables the Prime Routing
+
+
+ Web Merchant Configuration
+
+
+
+ ASM Merchant Configuration
+
+
+
+ Replenishment Merchant Configuration
+
+
+
+
+
+ java.lang.Boolean.FALSE
+ Enables the FraudSight
+
+
+
+
+ java.lang.Boolean.FALSE
+ Enables the Level 2 Data
+
+
+
+
+ java.lang.Boolean.FALSE
+ Enables the Level 3 Data
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-spring.xml
index 59121782..dcaca32f 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-spring.xml
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi-spring.xml
@@ -6,497 +6,20 @@
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi.build.number b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi.build.number
index d8005655..8ae4c4f0 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi.build.number
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayapi.build.number
@@ -1,11 +1,11 @@
#Ant properties
-#Mon Jan 18 14:19:09 UTC 2021
-version.api=2011
+#Wed Sep 29 10:46:25 UTC 2021
+version.api=2105
vendor=hybris
group.id=de.hybris.platform
name=worldpayapi
description=worldpayapi
-builddate=20210118 1419
-releasedate=20201208 1801
-version=2011.1
+builddate=20210929 1046
+releasedate=20210721 0907
+version=2105.0
module.name=platform-module
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayfraudsighttest-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayfraudsighttest-spring.xml
new file mode 100644
index 00000000..cb52484b
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpayfraudsighttest-spring.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpaylevel23test-spring.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpaylevel23test-spring.xml
new file mode 100644
index 00000000..34721111
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/resources/worldpaylevel23test-spring.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/schemagen-build.xml b/hybris/bin/y-ext/ext-worldpay/worldpayapi/schemagen-build.xml
new file mode 100644
index 00000000..5bade5f5
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/schemagen-build.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/attributehandlers/WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/attributehandlers/WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler.java
index 90022876..863390ff 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/attributehandlers/WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/attributehandlers/WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler.java
@@ -1,21 +1,28 @@
package com.worldpay.attributehandlers;
-import com.worldpay.klarna.WorldpayKlarnaUtils;
+import com.worldpay.service.payment.WorldpayKlarnaService;
import de.hybris.platform.core.model.order.payment.WorldpayAPMPaymentInfoModel;
import de.hybris.platform.servicelayer.model.attribute.DynamicAttributeHandler;
public class WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler implements DynamicAttributeHandler {
- private final WorldpayKlarnaUtils worldpayKlarnaUtils;
- public WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler(final WorldpayKlarnaUtils worldpayKlarnaUtils) {
- this.worldpayKlarnaUtils = worldpayKlarnaUtils;
+ private final WorldpayKlarnaService worldpayKlarnaService;
+
+ public WorldpayAPMPaymentInfoIsKlarnaPaymentTypeCodeDynamicAttributeHandler(final WorldpayKlarnaService worldpayKlarnaService) {
+ this.worldpayKlarnaService = worldpayKlarnaService;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public Boolean get(final WorldpayAPMPaymentInfoModel model) {
- return worldpayKlarnaUtils.isKlarnaPaymentType(model.getApmConfiguration().getCode());
+ return worldpayKlarnaService.isKlarnaPaymentType(model.getApmConfiguration().getCode());
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public void set(final WorldpayAPMPaymentInfoModel model, final Boolean paymentTypeCode) {
throw new UnsupportedOperationException("Attribute isKlarna is not writable");
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayCaptureCommand.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayCaptureCommand.java
index 69a9221d..76b19308 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayCaptureCommand.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayCaptureCommand.java
@@ -4,23 +4,24 @@
import com.worldpay.exception.WorldpayException;
import com.worldpay.merchant.WorldpayMerchantInfoService;
import com.worldpay.service.WorldpayServiceGateway;
-import com.worldpay.service.model.Amount;
-import com.worldpay.service.model.Date;
-import com.worldpay.service.model.MerchantInfo;
+import com.worldpay.data.Amount;
+import com.worldpay.data.Date;
+import com.worldpay.data.MerchantInfo;
import com.worldpay.service.payment.WorldpayOrderService;
import com.worldpay.service.request.CaptureServiceRequest;
import com.worldpay.service.response.CaptureServiceResponse;
import com.worldpay.transaction.WorldpayPaymentTransactionService;
+import com.worldpay.util.WorldpayInternalModelTransformerUtil;
import de.hybris.platform.core.model.order.OrderModel;
import de.hybris.platform.ordersplitting.model.ConsignmentModel;
import de.hybris.platform.payment.commands.CaptureCommand;
import de.hybris.platform.payment.commands.request.CaptureRequest;
import de.hybris.platform.payment.commands.result.CaptureResult;
import de.hybris.platform.servicelayer.dto.converter.Converter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
-import java.text.MessageFormat;
import java.time.LocalDateTime;
import java.util.Currency;
import java.util.List;
@@ -38,7 +39,7 @@
*
*/
public class DefaultWorldpayCaptureCommand extends WorldpayCommand implements CaptureCommand {
- private static final Logger LOG = Logger.getLogger(DefaultWorldpayCaptureCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultWorldpayCaptureCommand.class);
protected final Converter captureServiceResponseConverter;
protected final WorldpayHybrisOrderService worldpayHybrisOrderService;
@@ -64,7 +65,7 @@ public CaptureResult perform(final CaptureRequest request) {
final CaptureServiceRequest captureRequest = buildCaptureServiceRequest(orderCode, amount, currency, getShippingInfosFromOrder(orderCode));
return capture(captureRequest);
} catch (final WorldpayException e) {
- LOG.error(MessageFormat.format("Error during capture of payment with ordercode [{0}] to merchant [{1}]", orderCode, merchantCode), e);
+ LOG.error("Error during capture of payment with ordercode [{}] to merchant [{}]", orderCode, merchantCode, e);
return createErrorCaptureResult();
}
}
@@ -72,9 +73,9 @@ public CaptureResult perform(final CaptureRequest request) {
protected List getShippingInfosFromOrder(final String orderCode) {
final OrderModel orderModel = worldpayHybrisOrderService.findOrderByWorldpayOrderCode(orderCode);
return orderModel.getConsignments().stream()
- .map(ConsignmentModel::getTrackingID)
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
+ .map(ConsignmentModel::getTrackingID)
+ .filter(Objects::nonNull)
+ .collect(Collectors.toList());
}
private CaptureResult createErrorCaptureResult() {
@@ -111,7 +112,7 @@ private CaptureResult capture(final CaptureServiceRequest captureRequest) throws
*/
private CaptureServiceRequest buildCaptureServiceRequest(final String worldpayOrderCode, final BigDecimal captureAmount, final Currency currency, final List trackingIds) throws WorldpayException {
final Amount amount = getWorldpayOrderService().createAmount(currency, captureAmount.doubleValue());
- final Date date = new Date(LocalDateTime.now());
+ final Date date = WorldpayInternalModelTransformerUtil.newDateFromLocalDateTime(LocalDateTime.now());
final MerchantInfo merchantInfo = getMerchantInfo(worldpayOrderCode);
return CaptureServiceRequest.createCaptureRequest(merchantInfo, worldpayOrderCode, amount, date, trackingIds);
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayFollowOnRefundCommand.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayFollowOnRefundCommand.java
index 2df6b4f2..24459c85 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayFollowOnRefundCommand.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayFollowOnRefundCommand.java
@@ -4,8 +4,8 @@
import com.worldpay.exception.WorldpayException;
import com.worldpay.merchant.WorldpayMerchantInfoService;
import com.worldpay.service.WorldpayServiceGateway;
-import com.worldpay.service.model.Amount;
-import com.worldpay.service.model.MerchantInfo;
+import com.worldpay.data.Amount;
+import com.worldpay.data.MerchantInfo;
import com.worldpay.service.payment.WorldpayOrderService;
import com.worldpay.service.request.RefundServiceRequest;
import com.worldpay.service.response.RefundServiceResponse;
@@ -14,13 +14,13 @@
import de.hybris.platform.payment.commands.request.FollowOnRefundRequest;
import de.hybris.platform.payment.commands.result.RefundResult;
import de.hybris.platform.servicelayer.dto.converter.Converter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Currency;
import static de.hybris.platform.payment.dto.TransactionStatus.ERROR;
import static de.hybris.platform.payment.dto.TransactionStatusDetails.COMMUNICATION_PROBLEM;
-import static java.text.MessageFormat.format;
/**
@@ -31,7 +31,7 @@
*/
public class DefaultWorldpayFollowOnRefundCommand extends WorldpayCommand implements FollowOnRefundCommand {
- private static final Logger LOG = Logger.getLogger(DefaultWorldpayFollowOnRefundCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultWorldpayFollowOnRefundCommand.class);
protected final Converter refundServiceResponseConverter;
@@ -55,7 +55,7 @@ public RefundResult perform(final FollowOnRefundRequest request) {
final RefundServiceRequest refundServiceRequest = buildRefundRequest(request.getMerchantTransactionCode(), orderCode, amount, merchantInfo);
return refund(refundServiceRequest);
} catch (final WorldpayException e) {
- LOG.error(format("Exception raised while issuing a refundRequest: [{0}]", e.getMessage()), e);
+ LOG.error("Exception raised while issuing a refundRequest: [{}]", e.getMessage(), e);
return createErrorRefundResult();
}
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayTokenisedAuthorizationCommand.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayTokenisedAuthorizationCommand.java
index d9770f19..89f37bf9 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayTokenisedAuthorizationCommand.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayTokenisedAuthorizationCommand.java
@@ -6,9 +6,9 @@
import com.worldpay.merchant.WorldpayMerchantInfoService;
import com.worldpay.order.data.WorldpayAdditionalInfoData;
import com.worldpay.service.WorldpayServiceGateway;
-import com.worldpay.service.model.*;
-import com.worldpay.service.model.threeds2.Additional3DSData;
-import com.worldpay.service.model.token.Token;
+import com.worldpay.data.*;
+import com.worldpay.data.threeds2.Additional3DSData;
+import com.worldpay.data.token.Token;
import com.worldpay.service.payment.WorldpayOrderService;
import com.worldpay.service.payment.request.WorldpayRequestService;
import com.worldpay.service.request.AuthoriseRequestParameters;
@@ -21,7 +21,8 @@
import de.hybris.platform.payment.commands.result.AuthorizationResult;
import de.hybris.platform.payment.dto.BillingInfo;
import de.hybris.platform.servicelayer.dto.converter.Converter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Optional;
@@ -40,7 +41,7 @@
*/
public class DefaultWorldpayTokenisedAuthorizationCommand extends WorldpayCommand implements SubscriptionAuthorizationCommand {
- private static final Logger LOG = Logger.getLogger(DefaultWorldpayTokenisedAuthorizationCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultWorldpayTokenisedAuthorizationCommand.class);
private static final String UNKNOWN_MERCHANT_CODE = "unknownMerchantCode";
protected final Converter worldpayBillingInfoAddressConverter;
@@ -131,7 +132,8 @@ private DirectAuthoriseServiceRequest buildWorldpayRequest(final SubscriptionAut
final BasicOrderInfo orderInfo = getWorldpayOrderService().createBasicOrderInfo(worldpayOrderCode, worldpayOrderCode, amount);
final Session session = worldpayRequestService.createSession(additionalInfo);
final Browser browser = worldpayRequestService.createBrowser(additionalInfo);
- final Additional3DSData additional3DSData = new Additional3DSData(additionalInfo.getAdditional3DS2().getDfReferenceId());
+ final Additional3DSData additional3DSData = new Additional3DSData();
+ additional3DSData.setDfReferenceId(additionalInfo.getAdditional3DS2().getDfReferenceId());
final String customerEmail = additionalInfo.getCustomerEmail();
final String authenticatedShopperId = additionalInfo.getAuthenticatedShopperId();
final Shopper shopper = worldpayRequestService.createAuthenticatedShopper(customerEmail, authenticatedShopperId, session, browser);
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayVoidCommand.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayVoidCommand.java
index 86550e26..41668a0c 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayVoidCommand.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/commands/impl/DefaultWorldpayVoidCommand.java
@@ -1,19 +1,22 @@
-
package com.worldpay.commands.impl;
+import com.worldpay.core.services.WorldpayPrimeRoutingService;
import com.worldpay.exception.WorldpayException;
import com.worldpay.merchant.WorldpayMerchantInfoService;
import com.worldpay.service.WorldpayServiceGateway;
-import com.worldpay.service.model.MerchantInfo;
+import com.worldpay.data.MerchantInfo;
import com.worldpay.service.payment.WorldpayOrderService;
import com.worldpay.service.request.CancelServiceRequest;
+import com.worldpay.service.request.VoidSaleServiceRequest;
import com.worldpay.service.response.CancelServiceResponse;
+import com.worldpay.service.response.VoidSaleServiceResponse;
import com.worldpay.transaction.WorldpayPaymentTransactionService;
import de.hybris.platform.payment.commands.VoidCommand;
import de.hybris.platform.payment.commands.request.VoidRequest;
import de.hybris.platform.payment.commands.result.VoidResult;
import de.hybris.platform.servicelayer.dto.converter.Converter;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import static de.hybris.platform.payment.dto.TransactionStatus.ERROR;
import static de.hybris.platform.payment.dto.TransactionStatusDetails.COMMUNICATION_PROBLEM;
@@ -27,12 +30,20 @@
*/
public class DefaultWorldpayVoidCommand extends WorldpayCommand implements VoidCommand {
- private static final Logger LOG = Logger.getLogger(DefaultWorldpayVoidCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultWorldpayVoidCommand.class);
+
protected final Converter voidServiceResponseConverter;
+ protected final WorldpayPrimeRoutingService worldpayPrimeRoutingService;
- public DefaultWorldpayVoidCommand(final Converter voidServiceResponseConverter, final WorldpayMerchantInfoService worldpayMerchantInfoService, final WorldpayPaymentTransactionService worldpayPaymentTransactionService, final WorldpayOrderService worldpayOrderService, final WorldpayServiceGateway worldpayServiceGateway) {
+ public DefaultWorldpayVoidCommand(final Converter voidServiceResponseConverter,
+ final WorldpayMerchantInfoService worldpayMerchantInfoService,
+ final WorldpayPaymentTransactionService worldpayPaymentTransactionService,
+ final WorldpayOrderService worldpayOrderService,
+ final WorldpayServiceGateway worldpayServiceGateway,
+ final WorldpayPrimeRoutingService worldpayPrimeRoutingService) {
super(worldpayMerchantInfoService, worldpayPaymentTransactionService, worldpayOrderService, worldpayServiceGateway);
this.voidServiceResponseConverter = voidServiceResponseConverter;
+ this.worldpayPrimeRoutingService = worldpayPrimeRoutingService;
}
/**
@@ -42,9 +53,31 @@ public DefaultWorldpayVoidCommand(final Converter> paymentConverters;
+
+ public DefaultPaymentConverterStrategy(final Map> paymentConverters) {
+ this.paymentConverters = paymentConverters;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object convertPayment(final Payment payment) {
+ validateParameterNotNull(payment, "Payment must not be null!");
+
+ final PaymentType paymentType = PaymentType.getPaymentType(payment.getPaymentType());
+
+ if (paymentConverters.containsKey(paymentType)) {
+ return paymentConverters.get(paymentType).convert(payment);
+ } else {
+ throw new IllegalArgumentException("Payment converter with key [" + payment.getPaymentType() + "] not supported");
+ }
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMComponentPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMComponentPopulator.java
new file mode 100644
index 00000000..eed69910
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMComponentPopulator.java
@@ -0,0 +1,43 @@
+package com.worldpay.converters.populators;
+
+import com.worldpay.data.apm.WorldpayAPMConfigurationData;
+import com.worldpay.data.cms.WorldpayAPMComponentData;
+import com.worldpay.model.WorldpayAPMComponentModel;
+import com.worldpay.model.WorldpayAPMConfigurationModel;
+import de.hybris.platform.cmsfacades.data.MediaData;
+import de.hybris.platform.converters.Populator;
+import de.hybris.platform.core.model.media.MediaModel;
+import de.hybris.platform.servicelayer.dto.converter.ConversionException;
+import de.hybris.platform.servicelayer.dto.converter.Converter;
+
+import java.util.Optional;
+
+import static de.hybris.platform.servicelayer.util.ServicesUtil.validateParameterNotNull;
+
+/**
+ * Populates the {@link WorldpayAPMComponentData} from {@link WorldpayAPMComponentModel}
+ */
+public class WorldpayAPMComponentPopulator implements Populator {
+
+ protected final Converter worldpayAPMConfigurationConverter;
+ protected final Converter mediaModelConverter;
+
+ public WorldpayAPMComponentPopulator(final Converter worldpayAPMConfigurationConverter,
+ final Converter mediaModelConverter) {
+ this.worldpayAPMConfigurationConverter = worldpayAPMConfigurationConverter;
+ this.mediaModelConverter = mediaModelConverter;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void populate(final WorldpayAPMComponentModel source,
+ final WorldpayAPMComponentData target) throws ConversionException {
+ validateParameterNotNull(source, "source must not be null!");
+ validateParameterNotNull(target, "target must not be null!");
+
+ target.setApmConfiguration(worldpayAPMConfigurationConverter.convert(source.getApmConfiguration()));
+ Optional.ofNullable(source.getMedia()).ifPresent(mediaModel -> target.setMedia(mediaModelConverter.convert(mediaModel)));
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMConfigurationPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMConfigurationPopulator.java
new file mode 100644
index 00000000..1c8f6136
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAPMConfigurationPopulator.java
@@ -0,0 +1,38 @@
+package com.worldpay.converters.populators;
+
+import com.worldpay.data.apm.WorldpayAPMConfigurationData;
+import com.worldpay.facades.WorldpayBankConfigurationFacade;
+import com.worldpay.model.WorldpayAPMConfigurationModel;
+import de.hybris.platform.converters.Populator;
+
+import static de.hybris.platform.servicelayer.util.ServicesUtil.validateParameterNotNull;
+
+/**
+ * Populates the {@link WorldpayAPMConfigurationData} from {@link WorldpayAPMConfigurationModel}
+ */
+public class WorldpayAPMConfigurationPopulator implements Populator {
+
+ protected final WorldpayBankConfigurationFacade worldpayBankConfigurationFacade;
+
+ public WorldpayAPMConfigurationPopulator(final WorldpayBankConfigurationFacade worldpayBankConfigurationFacade) {
+ this.worldpayBankConfigurationFacade = worldpayBankConfigurationFacade;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void populate(final WorldpayAPMConfigurationModel source, final WorldpayAPMConfigurationData target) {
+ validateParameterNotNull(source, "source must not be null!");
+ validateParameterNotNull(target, "target must not be null!");
+
+ target.setCode(source.getCode());
+ target.setName(source.getName());
+ target.setDescription(source.getDescription());
+ target.setAutoCancelPendingTimeoutInMinutes(source.getAutoCancelPendingTimeoutInMinutes());
+ target.setBank(source.getBank());
+ target.setAutomaticRefunds(source.getAutomaticRefunds());
+ target.setBankTransferRefunds(source.getBankTransferRefunds());
+ target.setBankConfigurations(worldpayBankConfigurationFacade.getBankConfigurationForAPMCode(source.getCode()));
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAavResponsePopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAavResponsePopulator.java
index 793a70bb..b520f20e 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAavResponsePopulator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAavResponsePopulator.java
@@ -1,7 +1,7 @@
package com.worldpay.converters.populators;
import com.worldpay.model.WorldpayAavResponseModel;
-import com.worldpay.service.model.PaymentReply;
+import com.worldpay.data.PaymentReply;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAddressPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAddressPopulator.java
index b6e684e6..0d577b99 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAddressPopulator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAddressPopulator.java
@@ -1,6 +1,6 @@
package com.worldpay.converters.populators;
-import com.worldpay.service.model.Address;
+import com.worldpay.data.Address;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.core.model.user.AddressModel;
import org.apache.commons.lang.StringEscapeUtils;
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAuthorizationResultPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAuthorizationResultPopulator.java
index 6b365d34..1f9b1b0c 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAuthorizationResultPopulator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayAuthorizationResultPopulator.java
@@ -1,23 +1,27 @@
package com.worldpay.converters.populators;
import com.worldpay.service.WorldpayAuthorisationResultService;
-import com.worldpay.service.model.ErrorDetail;
-import com.worldpay.service.model.PaymentReply;
+import com.worldpay.data.ErrorDetail;
+import com.worldpay.data.PaymentReply;
import com.worldpay.service.response.DirectAuthoriseServiceResponse;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.payment.commands.result.AuthorizationResult;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Required;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Populator that fills the necessary details on a {@link AuthorizationResult} with the information of a {@link DirectAuthoriseServiceResponse}
*/
public class WorldpayAuthorizationResultPopulator implements Populator {
- private static final Logger LOG = Logger.getLogger(WorldpayAuthorizationResultPopulator.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpayAuthorizationResultPopulator.class);
- private WorldpayAuthorisationResultService worldpayAuthorisationResultService;
+ protected final WorldpayAuthorisationResultService worldpayAuthorisationResultService;
+
+ public WorldpayAuthorizationResultPopulator(final WorldpayAuthorisationResultService worldpayAuthorisationResultService) {
+ this.worldpayAuthorisationResultService = worldpayAuthorisationResultService;
+ }
/**
* Populates the data from the {@link DirectAuthoriseServiceResponse} to a {@link AuthorizationResult}
@@ -32,16 +36,11 @@ public void populate(final DirectAuthoriseServiceResponse source, final Authoriz
LOG.warn("No PaymentReply in response from worldpay");
final ErrorDetail errorDetail = source.getErrorDetail();
if (errorDetail != null) {
- LOG.error("Error message from Worldpay: " + errorDetail.getMessage());
+ LOG.error("Error message from Worldpay: {}", errorDetail.getMessage());
}
worldpayAuthorisationResultService.setAuthoriseResultAsError(target);
} else {
worldpayAuthorisationResultService.setAuthoriseResultByTransactionStatus(target, paymentReply.getAuthStatus(), source.getOrderCode());
}
}
-
- @Required
- public void setWorldpayAuthorisationResultService(final WorldpayAuthorisationResultService worldpayAuthorisationResultService) {
- this.worldpayAuthorisationResultService = worldpayAuthorisationResultService;
- }
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayBillingInfoAddressPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayBillingInfoAddressPopulator.java
index 4cba5ac7..73cf9fbb 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayBillingInfoAddressPopulator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayBillingInfoAddressPopulator.java
@@ -1,6 +1,6 @@
package com.worldpay.converters.populators;
-import com.worldpay.service.model.Address;
+import com.worldpay.data.Address;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.payment.dto.BillingInfo;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayFraudSightResponsePopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayFraudSightResponsePopulator.java
new file mode 100644
index 00000000..9318a8d4
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpayFraudSightResponsePopulator.java
@@ -0,0 +1,23 @@
+package com.worldpay.converters.populators;
+
+import com.worldpay.model.WorldpayFraudSightModel;
+import com.worldpay.data.FraudSightResponse;
+import de.hybris.platform.converters.Populator;
+
+/**
+ * Populator to transform a {@link FraudSightResponse} received from Worldpay to a {@link WorldpayFraudSightModel}
+ */
+public class WorldpayFraudSightResponsePopulator implements Populator {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void populate(final FraudSightResponse fraudSightResponse, final WorldpayFraudSightModel worldpayFraudSight) {
+ worldpayFraudSight.setId(fraudSightResponse.getId());
+ worldpayFraudSight.setScore(fraudSightResponse.getScore());
+ worldpayFraudSight.setMessage(fraudSightResponse.getMessage());
+
+ worldpayFraudSight.setReasonCodes(fraudSightResponse.getReasonCodes());
+ }
+}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpaySubscriptionAuthoriseResultPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpaySubscriptionAuthoriseResultPopulator.java
index 8a333d86..958d415b 100644
--- a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpaySubscriptionAuthoriseResultPopulator.java
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/WorldpaySubscriptionAuthoriseResultPopulator.java
@@ -3,25 +3,30 @@
import com.worldpay.commands.WorldpaySubscriptionAuthorizeResult;
import com.worldpay.enums.order.AuthorisedStatus;
import com.worldpay.service.WorldpayAuthorisationResultService;
-import com.worldpay.service.model.ErrorDetail;
-import com.worldpay.service.model.PaymentReply;
+import com.worldpay.data.ErrorDetail;
+import com.worldpay.data.PaymentReply;
import com.worldpay.service.response.DirectAuthoriseServiceResponse;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Required;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Populator that fills the necessary details on a {@link WorldpaySubscriptionAuthorizeResult} with the information of a {@link DirectAuthoriseServiceResponse}
*/
public class WorldpaySubscriptionAuthoriseResultPopulator implements Populator {
- private static final Logger LOG = Logger.getLogger(WorldpaySubscriptionAuthoriseResultPopulator.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WorldpaySubscriptionAuthoriseResultPopulator.class);
- private WorldpayAuthorisationResultService worldpayAuthorisationResultService;
+ protected final WorldpayAuthorisationResultService worldpayAuthorisationResultService;
+
+ public WorldpaySubscriptionAuthoriseResultPopulator(final WorldpayAuthorisationResultService worldpayAuthorisationResultService) {
+ this.worldpayAuthorisationResultService = worldpayAuthorisationResultService;
+ }
/**
* Populates the data from the {@link DirectAuthoriseServiceResponse} to a {@link WorldpaySubscriptionAuthorizeResult}
+ *
* @param source a {@link DirectAuthoriseServiceResponse} from Worldpay
* @param target a {@link WorldpaySubscriptionAuthorizeResult} in hybris.
* @throws ConversionException
@@ -39,7 +44,7 @@ public void populate(final DirectAuthoriseServiceResponse source, final Worldpay
LOG.warn("No PaymentReply in response from worldpay");
final ErrorDetail errorDetail = source.getErrorDetail();
if (errorDetail != null) {
- LOG.error("Error message from Worldpay: " + errorDetail.getMessage());
+ LOG.error("Error message from Worldpay: {}", errorDetail.getMessage());
}
worldpayAuthorisationResultService.setAuthoriseResultAsError(target);
}
@@ -48,9 +53,4 @@ public void populate(final DirectAuthoriseServiceResponse source, final Worldpay
worldpayAuthorisationResultService.setAuthoriseResultByTransactionStatus(target, status, orderCode);
}
}
-
- @Required
- public void setWorldpayAuthorisationResultService(final WorldpayAuthorisationResultService worldpayAuthorisationResultService) {
- this.worldpayAuthorisationResultService = worldpayAuthorisationResultService;
- }
}
diff --git a/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/internal/model/AddressPopulator.java b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/internal/model/AddressPopulator.java
new file mode 100644
index 00000000..7a0aaa15
--- /dev/null
+++ b/hybris/bin/y-ext/ext-worldpay/worldpayapi/src/com/worldpay/converters/populators/internal/model/AddressPopulator.java
@@ -0,0 +1,86 @@
+package com.worldpay.converters.populators.internal.model;
+
+import com.worldpay.internal.model.*;
+import com.worldpay.data.Address;
+import de.hybris.platform.converters.Populator;
+import de.hybris.platform.servicelayer.dto.converter.ConversionException;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.List;
+import java.util.Optional;
+
+import static de.hybris.platform.servicelayer.util.ServicesUtil.validateParameterNotNull;
+
+/**
+ * Populator that fills the necessary details on a {@link com.worldpay.internal.model.Address} with the information of a {@link Address}
+ */
+public class AddressPopulator implements Populator {
+
+ /**
+ * Populates the data from the {@link Address} to a {@link com.worldpay.internal.model.Address}
+ *
+ * @param source a {@link Address} from Worldpay
+ * @param target a {@link com.worldpay.internal.model.Address} in Worldpay.
+ * @throws ConversionException
+ */
+ @Override
+ public void populate(final Address source, final com.worldpay.internal.model.Address target) throws ConversionException {
+ validateParameterNotNull(source, "Source must not be null!");
+ validateParameterNotNull(target, "Target list must not be null!");
+
+ target.setFirstName(source.getFirstName());
+ target.setLastName(source.getLastName());
+ target.setPostalCode(source.getPostalCode());
+ target.setCity(source.getCity());
+ target.setState(source.getState());
+ target.setCountryCode(source.getCountryCode());
+
+ final List