diff --git a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/components/payment/Payment.tsx b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/components/payment/Payment.tsx index 2043b7e5..516acf99 100644 --- a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/components/payment/Payment.tsx +++ b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/components/payment/Payment.tsx @@ -137,7 +137,8 @@ class Payment extends React.Component { enableStoreDetails: this.props.adyenConfig.showRememberTheseDetails, clickToPayConfiguration: { merchantDisplayName: this.props.adyenConfig.merchantDisplayName, - shopperEmail: this.props.adyenConfig.shopperEmail + shopperEmail: this.props.adyenConfig.shopperEmail, + locale: this.props.adyenConfig.clickToPayLocale, } } } diff --git a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/reducers/adyenConfigReducer.ts b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/reducers/adyenConfigReducer.ts index c260fe30..4c910e47 100644 --- a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/reducers/adyenConfigReducer.ts +++ b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/reducers/adyenConfigReducer.ts @@ -29,6 +29,7 @@ export const adyenConfigInitialState : AdyenConfigData = { storedPaymentMethodList: [], merchantDisplayName: "", shopperEmail: "", + clickToPayLocale: "", } export function adyenConfigReducer(adyenConfig: AdyenConfigData, action: RootAction): AdyenConfigData { diff --git a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/types/adyenConfigData.ts b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/types/adyenConfigData.ts index 8b3d1a61..3b993261 100644 --- a/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/types/adyenConfigData.ts +++ b/adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout/src/types/adyenConfigData.ts @@ -28,6 +28,7 @@ export interface AdyenConfigData { sepaDirectDebit: boolean; merchantDisplayName: string, shopperEmail: string, + clickToPayLocale: string, } interface SessionData { diff --git a/adyenv6backoffice/resources/adyenv6backoffice-backoffice-config.xml b/adyenv6backoffice/resources/adyenv6backoffice-backoffice-config.xml index a614c056..e3761a47 100644 --- a/adyenv6backoffice/resources/adyenv6backoffice-backoffice-config.xml +++ b/adyenv6backoffice/resources/adyenv6backoffice-backoffice-config.xml @@ -67,6 +67,9 @@ + + + diff --git a/adyenv6core/resources/adyenv6core-items.xml b/adyenv6core/resources/adyenv6core-items.xml index 251c15c7..9e9c30dc 100644 --- a/adyenv6core/resources/adyenv6core-items.xml +++ b/adyenv6core/resources/adyenv6core-items.xml @@ -349,6 +349,10 @@ Configuration for express payment methods + + Click to Pay Locale in form eq. en_US + + diff --git a/adyenv6core/resources/localization/adyenv6core-locales_en.properties b/adyenv6core/resources/localization/adyenv6core-locales_en.properties index 106c4322..9e30d720 100644 --- a/adyenv6core/resources/localization/adyenv6core-locales_en.properties +++ b/adyenv6core/resources/localization/adyenv6core-locales_en.properties @@ -63,7 +63,9 @@ type.basestore.amazonpayRegion.description=The region of the Amazon Seller shop type.basestore.adyenMerchantConfig.name=Adyen Merchant Config type.basestore.adyenMerchantConfig.description=List of merchants that can be used for payments type.basestore.l2L3ESDEnabled.name=L2/L3 Enhanced Data Support -type.BaseStore.l2L3ESDEnabled.description=Enable or disable L2/L3 EDS for US MasterCard and Visa transactions (only for US merchants) +type.basestore.l2L3ESDEnabled.description=Enable or disable L2/L3 EDS for US MasterCard and Visa transactions (only for US merchants) +type.basestore.clickToPayLocale.name = Click to Pay locale +type.basestore.clickToPayLocale.description = Provide locale in shape for eq. en_US for Click to Pay component type.ExpressPaymentConfig.name=Express Payment Config diff --git a/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTO.java b/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTO.java index 017f1957..a2923d67 100644 --- a/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTO.java +++ b/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTO.java @@ -37,13 +37,14 @@ public class CheckoutConfigDTO { private boolean showComboCard; private boolean showPos; private boolean immediateCapture; - private String countryCode; + private String countryCode; private boolean cardHolderNameRequired; private boolean sepaDirectDebit; private BigDecimal amountDecimal; private ExpressPaymentConfigDto expressPaymentConfig; private String merchantDisplayName; private String shopperEmail; + private String clickToPayLocale; // Getters and setters for the new field public ExpressPaymentConfigDto getExpressPaymentConfig() { @@ -54,9 +55,6 @@ public void setExpressPaymentConfig(ExpressPaymentConfigDto expressPaymentConfig this.expressPaymentConfig = expressPaymentConfigDto; } - - - public List getAlternativePaymentMethods() { return alternativePaymentMethods; } @@ -288,4 +286,12 @@ public String getShopperEmail() { public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; } + + public String getClickToPayLocale() { + return clickToPayLocale; + } + + public void setClickToPayLocale(String clickToPayLocale) { + this.clickToPayLocale = clickToPayLocale; + } } \ No newline at end of file diff --git a/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTOBuilder.java b/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTOBuilder.java index aff81b9f..9736bb6d 100644 --- a/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTOBuilder.java +++ b/adyenv6core/src/com/adyen/v6/dto/CheckoutConfigDTOBuilder.java @@ -169,6 +169,10 @@ public CheckoutConfigDTOBuilder setShopperEmail(String shopperEmail) { return this; } + public CheckoutConfigDTOBuilder setClickToPayLocale(String clickToPayLocale) { + checkoutConfigDTO.setClickToPayLocale(clickToPayLocale); + return this; + } public CheckoutConfigDTO build() { return checkoutConfigDTO; diff --git a/adyenv6core/src/com/adyen/v6/facades/impl/DefaultAdyenCheckoutFacade.java b/adyenv6core/src/com/adyen/v6/facades/impl/DefaultAdyenCheckoutFacade.java index 03827917..e7eb9df6 100644 --- a/adyenv6core/src/com/adyen/v6/facades/impl/DefaultAdyenCheckoutFacade.java +++ b/adyenv6core/src/com/adyen/v6/facades/impl/DefaultAdyenCheckoutFacade.java @@ -117,7 +117,17 @@ import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.math.BigDecimal; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -225,7 +235,7 @@ public class DefaultAdyenCheckoutFacade implements AdyenCheckoutFacade { public static final String MODEL_CONNECTED_TERMINAL_LIST = "connectedTerminalList"; public static final String MODEL_ENVIRONMENT_MODE = "environmentMode"; public static final String MODEL_AMOUNT = "amount"; - public static final String MODEL_AMOUNT_DECIMAL= "amountDecimal"; + public static final String MODEL_AMOUNT_DECIMAL = "amountDecimal"; public static final String MODEL_IMMEDIATE_CAPTURE = "immediateCapture"; public static final String MODEL_PAYPAL_MERCHANT_ID = "paypalMerchantId"; public static final String MODEL_COUNTRY_CODE = "countryCode"; @@ -433,7 +443,7 @@ public OrderData authorisePayment(final HttpServletRequest request, final CartDa RequestInfo requestInfo = new RequestInfo(request); requestInfo.setShopperLocale(getShopperLocale()); - PaymentResponse paymentResponse = getAdyenPaymentService().processPaymentRequest(cartData,null, requestInfo, customer); + PaymentResponse paymentResponse = getAdyenPaymentService().processPaymentRequest(cartData, null, requestInfo, customer); PaymentResponse.ResultCodeEnum resultCode = paymentResponse.getResultCode(); PaymentResponseAction action = paymentResponse.getAction(); @@ -765,7 +775,7 @@ public CheckoutConfigDTO getReactCheckoutConfig() throws ApiException { CheckoutConfigDTOBuilder checkoutConfigDTOBuilder = new CheckoutConfigDTOBuilder(); - checkoutConfigDTOBuilder + checkoutConfigDTOBuilder .setPaymentMethods(paymentMethods) .setConnectedTerminalList(connectedTerminalList) .setStoredPaymentMethodList(storedPaymentMethodList) @@ -789,7 +799,8 @@ public CheckoutConfigDTO getReactCheckoutConfig() throws ApiException { .setCardHolderNameRequired(getHolderNameRequired()) .setAmountDecimal(cartData.getTotalPriceWithTax().getValue()) .setMerchantDisplayName(baseStore.getName()) - .setShopperEmail(customerModel.getContactEmail()); + .setShopperEmail(customerModel.getContactEmail()) + .setClickToPayLocale(baseStore.getClickToPayLocale()); ExpressPaymentConfigModel expressPaymentConfigModel = baseStore.getExpressPaymentConfig(); if (expressPaymentConfigModel != null) { @@ -935,7 +946,8 @@ public CheckoutConfigDTO getCheckoutConfig() throws ApiException { .setSepaDirectDebit(sepaDirectDebit) .setAmountDecimal(cartData.getTotalPriceWithTax().getValue()) .setMerchantDisplayName(baseStore.getName()) - .setShopperEmail(customerModel.getContactEmail()); + .setShopperEmail(customerModel.getContactEmail()) + .setClickToPayLocale(baseStore.getClickToPayLocale()); ExpressPaymentConfigModel expressPaymentConfigModel = baseStore.getExpressPaymentConfig(); if (expressPaymentConfigModel != null) { @@ -1031,7 +1043,7 @@ protected Map getApplePayConfigFromPaymentMethods(List