Skip to content

Commit 883c1f8

Browse files
Release version 2.5.0 (#229)
* Fix response for Terminal API Abort Requests * PaymentsRequest browserInfo printed in toString method * Add test for abortRequest * Fix travis.yml * Removing unused fields from payment request payload * Restoring personalDetails * Added merchantName to ThreeDS2RequestData * Adding missing fields on PaymentInstrumentData * Fix ForceEntryMode fields / InstalmentType json name * Fix Instalment and CheckData typo * Update currency code list * Removing MRO currency * Fix currency test * RecurringDetail missing fields * Add RecurringDetail mock test * [PW-1398] Fix AuthenticationMethodType.OnlinePIN (#226) * Fix AuthenticationMethodType.OnlinePIN * Add OnlinePIN tests * Bump to version 2.5.0
1 parent 2636667 commit 883c1f8

29 files changed

+1488
-246
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: java
22

3+
dist: trusty
4+
35
jdk:
46
- oraclejdk8
57
- openjdk7

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Add this dependency to your project's POM:
3737
<dependency>
3838
<groupId>com.adyen</groupId>
3939
<artifactId>adyen-java-api-library</artifactId>
40-
<version>2.4.1</version>
40+
<version>2.5.0</version>
4141
</dependency>
4242
```
4343

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>2.4.1</version>
7+
<version>2.5.0</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
@@ -41,7 +41,7 @@ public class Client {
4141
public static final String MARKETPAY_FUND_API_VERSION = "v3";
4242
public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v1";
4343
public static final String LIB_NAME = "adyen-java-api-library";
44-
public static final String LIB_VERSION = "2.4.1";
44+
public static final String LIB_VERSION = "2.5.0";
4545
public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout";
4646
public static final String CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
4747
public static final String CHECKOUT_API_VERSION = "v49";

src/main/java/com/adyen/Util/Util.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,31 +102,28 @@ public static Amount createAmount(BigDecimal amount, String currency) {
102102

103103
public static int getDecimalPlaces(String currency) {
104104
switch (currency) {
105-
case "JPY":
106-
case "IDR":
107-
case "KRW":
108-
case "BYR":
109-
case "VND":
110105
case "CVE":
111106
case "DJF":
112107
case "GNF":
108+
case "IDR":
109+
case "JPY":
110+
case "KMF":
111+
case "KRW":
113112
case "PYG":
114113
case "RWF":
115114
case "UGX":
115+
case "VND":
116116
case "VUV":
117117
case "XAF":
118118
case "XOF":
119119
case "XPF":
120-
case "GHC":
121-
case "KMF":
122120
return 0;
123-
case "MRO":
124-
return 1;
125121
case "BHD":
122+
case "IQD":
126123
case "JOD":
127124
case "KWD":
128-
case "OMR":
129125
case "LYD":
126+
case "OMR":
130127
case "TND":
131128
return 3;
132129
default:

src/main/java/com/adyen/httpclient/HttpURLConnectionClient.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ public String request(String requestUrl, String requestBody, Config config, bool
105105

106106
private static String getResponseBody(InputStream responseStream) throws IOException {
107107
//\A is the beginning of the stream boundary
108-
Scanner scanner = new Scanner(responseStream, CHARSET);
109-
String rBody = scanner.useDelimiter("\\A").next();
108+
Scanner scanner = new Scanner(responseStream, CHARSET).useDelimiter("\\A");
109+
110+
String rBody = null;
111+
if (scanner.hasNext()) {
112+
rBody = scanner.next();
113+
}
114+
110115
scanner.close();
111116
responseStream.close();
117+
112118
return rBody;
113119
}
114120

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ public ChallengeIndicatorEnum read(final JsonReader jsonReader) throws IOExcepti
144144
@SerializedName("mcc")
145145
private String mcc = null;
146146

147+
@SerializedName("merchantName")
148+
private String merchantName;
149+
147150
public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) {
148151
this.authenticationOnly = authenticationOnly;
149152
return this;
@@ -441,6 +444,26 @@ public ThreeDS2RequestData mcc(String mcc) {
441444
return this;
442445
}
443446

447+
/**
448+
* Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchant name that the
449+
* issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters.
450+
* Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to
451+
* override the merchant name already configured on your account.
452+
* @return merchantName
453+
*/
454+
public String getMerchantName() {
455+
return merchantName;
456+
}
457+
458+
public void setMerchantName(String merchantName) {
459+
this.merchantName = merchantName;
460+
}
461+
462+
public ThreeDS2RequestData merchantName(String merchantName) {
463+
this.merchantName = merchantName;
464+
return this;
465+
}
466+
444467
@Override
445468
public boolean equals(java.lang.Object o) {
446469
if (this == o) {
@@ -469,7 +492,8 @@ public boolean equals(java.lang.Object o) {
469492
&& Objects.equals(this.threeDSRequestorName, threeDS2RequestData.threeDSRequestorName)
470493
&& Objects.equals(this.acquirerBIN, threeDS2RequestData.acquirerBIN)
471494
&& Objects.equals(this.acquirerMerchantID, threeDS2RequestData.acquirerMerchantID)
472-
&& Objects.equals(this.mcc, threeDS2RequestData.mcc);
495+
&& Objects.equals(this.mcc, threeDS2RequestData.mcc)
496+
&& Objects.equals(this.merchantName, threeDS2RequestData.merchantName);
473497
}
474498

475499
@Override
@@ -493,7 +517,8 @@ public int hashCode() {
493517
threeDSRequestorName,
494518
acquirerBIN,
495519
acquirerMerchantID,
496-
mcc);
520+
mcc,
521+
merchantName);
497522
}
498523

499524
@Override
@@ -521,6 +546,7 @@ public String toString() {
521546
sb.append(" acquirerBIN: ").append(toIndentedString(acquirerBIN)).append("\n");
522547
sb.append(" acquirerMerchantID: ").append(toIndentedString(acquirerMerchantID)).append("\n");
523548
sb.append(" mcc: ").append(toIndentedString(mcc)).append("\n");
549+
sb.append(" merchantName: ").append(toIndentedString(merchantName)).append("\n");
524550
sb.append("}");
525551
return sb.toString();
526552
}

src/main/java/com/adyen/model/checkout/DefaultPaymentMethodDetails.java

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
package com.adyen.model.checkout;
2323

2424
import java.util.Objects;
25-
import com.adyen.model.Address;
25+
2626
import com.google.gson.annotations.SerializedName;
2727

2828
public class DefaultPaymentMethodDetails implements PaymentMethodDetails {
@@ -42,10 +42,6 @@ public class DefaultPaymentMethodDetails implements PaymentMethodDetails {
4242
private String installmentConfigurationKey;
4343
@SerializedName("personalDetails")
4444
private PersonalDetails personalDetails;
45-
@SerializedName("billingAddress")
46-
private Address billingAddress;
47-
@SerializedName("deliveryAddress")
48-
private Address deliveryAddress;
4945
@SerializedName("encryptedCardNumber")
5046
private String encryptedCardNumber;
5147
@SerializedName("encryptedExpiryMonth")
@@ -171,32 +167,6 @@ public DefaultPaymentMethodDetails personalDetails(PersonalDetails personalDetai
171167
return this;
172168
}
173169

174-
public Address getBillingAddress() {
175-
return billingAddress;
176-
}
177-
178-
public void setBillingAddress(Address billingAddress) {
179-
this.billingAddress = billingAddress;
180-
}
181-
182-
public DefaultPaymentMethodDetails billingAddress(Address billingAddress) {
183-
this.billingAddress = billingAddress;
184-
return this;
185-
}
186-
187-
public Address getDeliveryAddress() {
188-
return deliveryAddress;
189-
}
190-
191-
public void setDeliveryAddress(Address deliveryAddress) {
192-
this.deliveryAddress = deliveryAddress;
193-
}
194-
195-
public DefaultPaymentMethodDetails deliveryAddress(Address deliveryAddress) {
196-
this.deliveryAddress = deliveryAddress;
197-
return this;
198-
}
199-
200170
public String getEncryptedCardNumber() {
201171
return encryptedCardNumber;
202172
}
@@ -317,14 +287,10 @@ public boolean equals(Object o) {
317287
&& Objects.equals(number, that.number)
318288
&& Objects.equals(expiryMonth, that.expiryMonth)
319289
&& Objects.equals(expiryYear, that.expiryYear)
320-
&& Objects.equals(holderName,
321-
that.holderName)
290+
&& Objects.equals(holderName, that.holderName)
322291
&& Objects.equals(cvc, that.cvc)
323292
&& Objects.equals(installmentConfigurationKey, that.installmentConfigurationKey)
324-
&& Objects.equals(personalDetails,
325-
that.personalDetails)
326-
&& Objects.equals(billingAddress, that.billingAddress)
327-
&& Objects.equals(deliveryAddress, that.deliveryAddress)
293+
&& Objects.equals(personalDetails, that.personalDetails)
328294
&& Objects.equals(encryptedCardNumber, that.encryptedCardNumber)
329295
&& Objects.equals(encryptedExpiryMonth, that.encryptedExpiryMonth)
330296
&& Objects.equals(encryptedExpiryYear, that.encryptedExpiryYear)
@@ -339,22 +305,20 @@ public boolean equals(Object o) {
339305
@Override
340306
public int hashCode() {
341307
return Objects.hash(type,
342-
number,
343-
expiryMonth,
344-
expiryYear,
345-
holderName,
346-
cvc,
347-
installmentConfigurationKey,
348-
personalDetails,
349-
billingAddress,
350-
deliveryAddress,
351-
encryptedCardNumber,
352-
encryptedExpiryMonth,
353-
encryptedExpiryYear,
354-
encryptedSecurityCode,
355-
recurringDetailReference,
356-
storeDetails,
357-
idealIssuer);
308+
number,
309+
expiryMonth,
310+
expiryYear,
311+
holderName,
312+
cvc,
313+
installmentConfigurationKey,
314+
personalDetails,
315+
encryptedCardNumber,
316+
encryptedExpiryMonth,
317+
encryptedExpiryYear,
318+
encryptedSecurityCode,
319+
recurringDetailReference,
320+
storeDetails,
321+
idealIssuer);
358322
}
359323

360324
@Override
@@ -377,10 +341,6 @@ public String toString() {
377341
+ '\''
378342
+ ", personalDetails="
379343
+ personalDetails
380-
+ ", billingAddress="
381-
+ billingAddress
382-
+ ", deliveryAddress="
383-
+ deliveryAddress
384344
+ ", encryptedExpiryMonth='"
385345
+ encryptedExpiryMonth
386346
+ '\''

src/main/java/com/adyen/model/checkout/PaymentsRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@ public String toString() {
13601360
+ " merchantAccount: " + toIndentedString(merchantAccount) + "\n"
13611361
+ " merchantOrderReference: " + toIndentedString(merchantOrderReference) + "\n"
13621362
+ " metadata: " + toIndentedString(metadata) + "\n"
1363+
+ " browserInfo: " + toIndentedString(browserInfo) + "\n"
13631364
+ " orderReference: " + toIndentedString(orderReference) + "\n"
13641365
+ " paymentMethod: " + toIndentedString(paymentMethod) + "\n"
13651366
+ " reference: " + toIndentedString(reference) + "\n"

0 commit comments

Comments
 (0)