Skip to content

Commit c3900ab

Browse files
authored
Merge pull request #63 from Adyen/fix-token-details
#61 tokenData should be a Map of <String,String> rather then a string.
2 parents 3f97943 + a5dd46d commit c3900ab

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

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/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)