diff --git a/src/main/java/com/adyen/model/hpp/DirectoryLookupRequest.java b/src/main/java/com/adyen/model/hpp/DirectoryLookupRequest.java index 0cd5a8b44..ecabd0b71 100644 --- a/src/main/java/com/adyen/model/hpp/DirectoryLookupRequest.java +++ b/src/main/java/com/adyen/model/hpp/DirectoryLookupRequest.java @@ -1,4 +1,4 @@ -/** +/* * ###### * ###### * ############ ####( ###### #####. ###### ############ ############ @@ -31,7 +31,7 @@ public class DirectoryLookupRequest { private String skinCode; private String merchantAccount; private String hmacKey; - + private String shopperLocale; public DirectoryLookupRequest() { sessionValidity = Util.calculateSessionValidity(); @@ -108,4 +108,13 @@ public DirectoryLookupRequest setHmacKey(String hmacKey) { this.hmacKey = hmacKey; return this; } + + public String getShopperLocale() { + return shopperLocale; + } + + public DirectoryLookupRequest setShopperLocale(String shopperLocale) { + this.shopperLocale = shopperLocale; + return this; + } } diff --git a/src/main/java/com/adyen/service/HostedPaymentPages.java b/src/main/java/com/adyen/service/HostedPaymentPages.java index 6de069a65..079b194df 100644 --- a/src/main/java/com/adyen/service/HostedPaymentPages.java +++ b/src/main/java/com/adyen/service/HostedPaymentPages.java @@ -45,6 +45,7 @@ import static com.adyen.constants.HPPConstants.Fields.PAYMENT_AMOUNT; import static com.adyen.constants.HPPConstants.Fields.SESSION_VALIDITY; import static com.adyen.constants.HPPConstants.Fields.SKIN_CODE; +import static com.adyen.constants.HPPConstants.Response.SHOPPER_LOCALE; public class HostedPaymentPages extends Service { public HostedPaymentPages(Client client) { @@ -83,6 +84,7 @@ public SortedMap getPostParametersFromDLRequest(DirectoryLookupR postParameters.put(MERCHANT_REFERENCE, request.getMerchantReference()); postParameters.put(SESSION_VALIDITY, request.getSessionValidity()); postParameters.put(COUNTRY_CODE, request.getCountryCode()); + postParameters.put(SHOPPER_LOCALE, request.getShopperLocale()); HMACValidator hmacValidator = new HMACValidator(); diff --git a/src/test/java/com/adyen/DirectoryLookupTest.java b/src/test/java/com/adyen/DirectoryLookupTest.java index 2b9fcff02..9348ccc0b 100644 --- a/src/test/java/com/adyen/DirectoryLookupTest.java +++ b/src/test/java/com/adyen/DirectoryLookupTest.java @@ -44,7 +44,11 @@ */ public class DirectoryLookupTest extends BaseTest { private DirectoryLookupRequest createDirectoryLookupRequest() { - DirectoryLookupRequest directoryLookupRequest = new DirectoryLookupRequest().setCountryCode("NL").setMerchantReference("test:\\'test").setPaymentAmount("1000").setCurrencyCode("EUR"); + DirectoryLookupRequest directoryLookupRequest = new DirectoryLookupRequest().setCountryCode("NL") + .setMerchantReference("test:\\'test") + .setPaymentAmount("1000") + .setCurrencyCode("EUR") + .setShopperLocale("en_GB"); return directoryLookupRequest; }