Skip to content

Commit 814d6cd

Browse files
authored
Merge pull request #64 from Adyen/develop
Merge from develop for new release 1.2.1
2 parents 0ff1ca1 + b4f5f0d commit 814d6cd

File tree

9 files changed

+60
-15
lines changed

9 files changed

+60
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Add this dependency to your project's POM:
2323
<dependency>
2424
<groupId>com.adyen</groupId>
2525
<artifactId>adyen-java-api-library</artifactId>
26-
<version>1.2.0</version>
26+
<version>1.2.1</version>
2727
</dependency>
2828
```
2929

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.adyen</groupId>
55
<artifactId>adyen-java-api-library</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.2.0</version>
7+
<version>1.2.1</version>
88
<name>Adyen Java API Library</name>
99
<description>Adyen API Client Library for Java</description>
1010
<url>https://github.com/adyen/adyen-java-api-library</url>

src/main/java/com/adyen/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Client {
3535
public static final String HPP_LIVE = "https://live.adyen.com/hpp";
3636
public static final String API_VERSION = "v25";
3737
public static final String USER_AGENT_SUFFIX = "adyen-java-api-library/";
38-
public static final String LIB_VERSION = "1.2.0";
38+
public static final String LIB_VERSION = "1.2.1";
3939

4040
public Client() {
4141
this.config = new Config();

src/main/java/com/adyen/model/TokenDetails.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
package com.adyen.model;
2222

23+
import java.util.Map;
2324
import java.util.Objects;
2425
import com.google.gson.annotations.SerializedName;
2526

@@ -31,7 +32,7 @@ public class TokenDetails {
3132
private String tokenDataType = null;
3233

3334
@SerializedName("tokenData")
34-
private String tokenData = null;
35+
private Map<String, String> tokenData = null;
3536

3637
public TokenDetails tokenDataType(String tokenDataType) {
3738
this.tokenDataType = tokenDataType;
@@ -50,24 +51,23 @@ public void setTokenDataType(String tokenDataType) {
5051
this.tokenDataType = tokenDataType;
5152
}
5253

53-
public TokenDetails tokenData(String tokenData) {
54+
public TokenDetails tokenData(Map<String,String> tokenData) {
5455
this.tokenData = tokenData;
5556
return this;
5657
}
5758

58-
/**
59+
/**
5960
* Get tokenData
6061
* @return tokenData
61-
**/
62-
public String getTokenData() {
62+
*/
63+
public Map<String, String> getTokenData() {
6364
return tokenData;
6465
}
6566

66-
public void setTokenData(String tokenData) {
67+
public void setTokenData(Map<String, String> tokenData) {
6768
this.tokenData = tokenData;
6869
}
6970

70-
7171
@Override
7272
public boolean equals(Object o) {
7373
if (this == o) {

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

src/test/java/com/adyen/RecurringTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public void testListRecurringDetails() throws Exception {
6060
RecurringDetailsRequest request = createRecurringDetailsRequest();
6161

6262
RecurringDetailsResult result = recurring.listRecurringDetails(request);
63-
assertEquals(1, result.getDetails().size());
64-
assertEquals(1, result.getRecurringDetails().size());
63+
assertEquals(2, result.getDetails().size());
64+
assertEquals(2, result.getRecurringDetails().size());
6565

6666
RecurringDetail recurringDetail = result.getRecurringDetails().get(0);
6767
assertEquals("recurringReference", recurringDetail.getRecurringDetailReference());

src/test/resources/mocks/recurring/listRecurringDetails-success.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,36 @@
2525
"recurringDetailReference": "recurringReference",
2626
"variant": "visa"
2727
}
28+
},
29+
{
30+
"RecurringDetail": {
31+
"acquirer": "PayPalSandbox",
32+
"acquirerAccount": "TestPmmAcquirerAccount",
33+
"billingAddress": {
34+
"city": "City",
35+
"country": "NL",
36+
"houseNumberOrName": "1",
37+
"postalCode": "2312aa",
38+
"stateOrProvince": "NA",
39+
"street": "Street"
40+
},
41+
"contractTypes": [
42+
"RECURRING"
43+
],
44+
"creationDate": "2017-10-10T08:50:02+02:00",
45+
"firstPspReference": "8515076181707110",
46+
"paymentMethodVariant": "paypal",
47+
"recurringDetailReference": "8315076181982020",
48+
"tokenDetails": {
49+
"tokenData": {
50+
"EmailId": "tedtest@test.nl",
51+
"PayPal.PayerId": "H95EPL8B2KFE6",
52+
"BillingAgreementId": "B-7MA42752FE774625C"
53+
},
54+
"tokenDataType": "PayPal"
55+
},
56+
"variant": "paypal"
57+
}
2858
}
2959
],
3060
"shopperReference": "test-123",

0 commit comments

Comments
 (0)