From ffc570ce51fcbac2879891371c5abcef5b1d6def Mon Sep 17 00:00:00 2001 From: rajni Date: Thu, 4 Jul 2019 16:36:30 +0200 Subject: [PATCH 01/12] [PW-1286]: Updated boleto paymentrequest creation logic to use truncated state code. --- .../adyen/v6/factory/AdyenRequestFactory.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/adyenv6core/src/com/adyen/v6/factory/AdyenRequestFactory.java b/adyenv6core/src/com/adyen/v6/factory/AdyenRequestFactory.java index 19df5b01d..08e303602 100644 --- a/adyenv6core/src/com/adyen/v6/factory/AdyenRequestFactory.java +++ b/adyenv6core/src/com/adyen/v6/factory/AdyenRequestFactory.java @@ -451,6 +451,7 @@ private Address setAddressData(AddressData addressData) { } if (addressData.getRegion() != null && ! addressData.getRegion().getIsocode().isEmpty()) { + //State value will be updated later for boleto in boleto specific method. address.setStateOrProvince(addressData.getRegion().getIsocode()); } @@ -745,6 +746,21 @@ private void setBoletoData(PaymentsRequest paymentsRequest, CartData cartData) { shopperName.setFirstName(cartData.getAdyenFirstName()); shopperName.setLastName(cartData.getAdyenLastName()); paymentsRequest.setShopperName(shopperName); + + if (paymentsRequest.getBillingAddress() != null) { + String stateOrProvinceBilling = paymentsRequest.getBillingAddress().getStateOrProvince(); + if (! StringUtils.isEmpty(stateOrProvinceBilling) && stateOrProvinceBilling.length() > 2) { + String shortStateOrProvince = stateOrProvinceBilling.substring(stateOrProvinceBilling.length() - 2); + paymentsRequest.getBillingAddress().setStateOrProvince(shortStateOrProvince); + } + } + if (paymentsRequest.getDeliveryAddress() != null) { + String stateOrProvinceDelivery = paymentsRequest.getDeliveryAddress().getStateOrProvince(); + if (! StringUtils.isEmpty(stateOrProvinceDelivery) && stateOrProvinceDelivery.length() > 2) { + String shortStateOrProvince = stateOrProvinceDelivery.substring(stateOrProvinceDelivery.length() - 2); + paymentsRequest.getDeliveryAddress().setStateOrProvince(shortStateOrProvince); + } + } } /** From fca9014586eb9e0e05f4d39ebd92077c43194caa Mon Sep 17 00:00:00 2001 From: rajni Date: Fri, 5 Jul 2019 14:55:30 +0200 Subject: [PATCH 02/12] [PW-1369]: Upgraded to checkout component version 3.0.0 --- .../pages/AdyenSummaryCheckoutStepController.java | 4 ++++ .../pages/checkout/multi/3ds2_payment.jsp | 10 +++++----- .../checkout/multi/selectPaymentMethodPage.jsp | 6 +++--- .../_ui/responsive/common/js/adyen.checkout.js | 14 +++++++------- .../com/adyen/v6/facades/AdyenCheckoutFacade.java | 5 +++++ .../v6/facades/DefaultAdyenCheckoutFacade.java | 11 +++++++++++ 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/pages/AdyenSummaryCheckoutStepController.java b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/pages/AdyenSummaryCheckoutStepController.java index c21db4b6a..0388a29cf 100644 --- a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/pages/AdyenSummaryCheckoutStepController.java +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/pages/AdyenSummaryCheckoutStepController.java @@ -82,6 +82,7 @@ import static com.adyen.v6.constants.Adyenv6coreConstants.PAYMENT_METHOD_MULTIBANCO; import static com.adyen.v6.facades.DefaultAdyenCheckoutFacade.MODEL_CHECKOUT_SHOPPER_HOST; import static com.adyen.v6.facades.DefaultAdyenCheckoutFacade.MODEL_ORIGIN_KEY; +import static com.adyen.v6.facades.DefaultAdyenCheckoutFacade.MODEL_ENVIRONMENT_MODE; @Controller @RequestMapping(value = AdyenControllerConstants.SUMMARY_CHECKOUT_PREFIX) @@ -210,6 +211,7 @@ public String placeOrder(@ModelAttribute("placeOrderForm") final PlaceOrderForm if (IDENTIFYSHOPPER == paymentsResponse.getResultCode()) { if (adyenPaymentMethod.equals(PAYMENT_METHOD_CC)|| adyenPaymentMethod.indexOf(PAYMENT_METHOD_ONECLICK) == 0) { model.addAttribute(MODEL_CHECKOUT_SHOPPER_HOST, adyenCheckoutFacade.getCheckoutShopperHost()); + model.addAttribute(MODEL_ENVIRONMENT_MODE, adyenCheckoutFacade.getEnvironmentMode()); model.addAttribute(SHOPPER_LOCALE, adyenCheckoutFacade.getShopperLocale()); model.addAttribute(MODEL_ORIGIN_KEY, adyenCheckoutFacade.getOriginKey()); model.addAttribute(PAYMENT_DATA, paymentsResponse.getPaymentData()); @@ -220,6 +222,7 @@ public String placeOrder(@ModelAttribute("placeOrderForm") final PlaceOrderForm if (CHALLENGESHOPPER == paymentsResponse.getResultCode()) { if (adyenPaymentMethod.equals(PAYMENT_METHOD_CC)|| adyenPaymentMethod.indexOf(PAYMENT_METHOD_ONECLICK) == 0) { model.addAttribute(MODEL_CHECKOUT_SHOPPER_HOST, adyenCheckoutFacade.getCheckoutShopperHost()); + model.addAttribute(MODEL_ENVIRONMENT_MODE, adyenCheckoutFacade.getEnvironmentMode()); model.addAttribute(SHOPPER_LOCALE, adyenCheckoutFacade.getShopperLocale()); model.addAttribute(MODEL_ORIGIN_KEY, adyenCheckoutFacade.getOriginKey()); model.addAttribute(PAYMENT_DATA, paymentsResponse.getPaymentData()); @@ -251,6 +254,7 @@ public String authorise3DS2Payment(final Model model, PaymentsResponse paymentsResponse = e.getPaymentsResponse(); if (paymentsResponse != null && paymentsResponse.getResultCode() == CHALLENGESHOPPER) { model.addAttribute(MODEL_CHECKOUT_SHOPPER_HOST, adyenCheckoutFacade.getCheckoutShopperHost()); + model.addAttribute(MODEL_ENVIRONMENT_MODE, adyenCheckoutFacade.getEnvironmentMode()); model.addAttribute(SHOPPER_LOCALE, adyenCheckoutFacade.getShopperLocale()); model.addAttribute(MODEL_ORIGIN_KEY, adyenCheckoutFacade.getOriginKey()); model.addAttribute(PAYMENT_DATA, paymentsResponse.getPaymentData()); diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi/3ds2_payment.jsp b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi/3ds2_payment.jsp index 57b307413..11841d413 100644 --- a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi/3ds2_payment.jsp +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi/3ds2_payment.jsp @@ -3,15 +3,15 @@ - - + + - + - +