Skip to content

Commit 3f97943

Browse files
authored
Merge pull request #62 from Adyen/shopperlocale
Add shopperLocale to directory lookup call
2 parents e1014e6 + 495eb7d commit 3f97943

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/main/java/com/adyen/model/hpp/DirectoryLookupRequest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* ######
33
* ######
44
* ############ ####( ###### #####. ###### ############ ############
@@ -31,7 +31,7 @@ public class DirectoryLookupRequest {
3131
private String skinCode;
3232
private String merchantAccount;
3333
private String hmacKey;
34-
34+
private String shopperLocale;
3535

3636
public DirectoryLookupRequest() {
3737
sessionValidity = Util.calculateSessionValidity();
@@ -108,4 +108,13 @@ public DirectoryLookupRequest setHmacKey(String hmacKey) {
108108
this.hmacKey = hmacKey;
109109
return this;
110110
}
111+
112+
public String getShopperLocale() {
113+
return shopperLocale;
114+
}
115+
116+
public DirectoryLookupRequest setShopperLocale(String shopperLocale) {
117+
this.shopperLocale = shopperLocale;
118+
return this;
119+
}
111120
}

src/main/java/com/adyen/service/HostedPaymentPages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import static com.adyen.constants.HPPConstants.Fields.PAYMENT_AMOUNT;
4646
import static com.adyen.constants.HPPConstants.Fields.SESSION_VALIDITY;
4747
import static com.adyen.constants.HPPConstants.Fields.SKIN_CODE;
48+
import static com.adyen.constants.HPPConstants.Response.SHOPPER_LOCALE;
4849

4950
public class HostedPaymentPages extends Service {
5051
public HostedPaymentPages(Client client) {
@@ -83,6 +84,7 @@ public SortedMap<String, String> getPostParametersFromDLRequest(DirectoryLookupR
8384
postParameters.put(MERCHANT_REFERENCE, request.getMerchantReference());
8485
postParameters.put(SESSION_VALIDITY, request.getSessionValidity());
8586
postParameters.put(COUNTRY_CODE, request.getCountryCode());
87+
postParameters.put(SHOPPER_LOCALE, request.getShopperLocale());
8688

8789
HMACValidator hmacValidator = new HMACValidator();
8890

src/test/java/com/adyen/DirectoryLookupTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
*/
4545
public class DirectoryLookupTest extends BaseTest {
4646
private DirectoryLookupRequest createDirectoryLookupRequest() {
47-
DirectoryLookupRequest directoryLookupRequest = new DirectoryLookupRequest().setCountryCode("NL").setMerchantReference("test:\\'test").setPaymentAmount("1000").setCurrencyCode("EUR");
47+
DirectoryLookupRequest directoryLookupRequest = new DirectoryLookupRequest().setCountryCode("NL")
48+
.setMerchantReference("test:\\'test")
49+
.setPaymentAmount("1000")
50+
.setCurrencyCode("EUR")
51+
.setShopperLocale("en_GB");
4852
return directoryLookupRequest;
4953
}
5054

0 commit comments

Comments
 (0)