Skip to content

Commit 347bdde

Browse files
Merge pull request #148 from Adyen/PW-666-CheckoutPaymentV40
Pw 666 checkout payment v40 and Application info
2 parents 064e15c + b8c49b5 commit 347bdde

File tree

65 files changed

+5667
-759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+5667
-759
lines changed

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

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ public Client(String username, String password, Environment environment, String
7070
}
7171

7272
/**
73-
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
73+
* @param username your merchant account Username
74+
* @param password your merchant accont Password
75+
* @param environment This defines the payment enviroment live or test
76+
* @param connectionTimeoutMillis Provide the time to time out
77+
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link
78+
* com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
7479
*/
7580
@Deprecated
7681
public Client(String username, String password, Environment environment, int connectionTimeoutMillis) {
@@ -80,7 +85,13 @@ public Client(String username, String password, Environment environment, int con
8085
}
8186

8287
/**
83-
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
88+
* @param username your merchant account Username
89+
* @param password your merchant accont Password
90+
* @param environment This defines the payment enviroment live or test
91+
* @param connectionTimeoutMillis Provide the time to time out
92+
* @param liveEndpointUrlPrefix provide the merchant specific url
93+
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link
94+
* com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
8495
*/
8596
@Deprecated
8697
public Client(String username, String password, Environment environment, int connectionTimeoutMillis, String liveEndpointUrlPrefix) {
@@ -100,7 +111,11 @@ public Client(String apiKey, Environment environment, String liveEndpointUrlPref
100111
}
101112

102113
/**
103-
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
114+
* @param apiKey Defines the api key that can be retrieved by back office
115+
* @param environment This defines the payment enviroment live or test
116+
* @param connectionTimeoutMillis Provide the time to time out
117+
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link
118+
* com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
104119
*/
105120
@Deprecated
106121
public Client(String apiKey, Environment environment, int connectionTimeoutMillis) {
@@ -110,7 +125,12 @@ public Client(String apiKey, Environment environment, int connectionTimeoutMilli
110125
}
111126

112127
/**
113-
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
128+
* @param apiKey Defines the api key that can be retrieved by back office
129+
* @param environment This defines the payment enviroment live or test
130+
* @param connectionTimeoutMillis Provide the time to time out
131+
* @param liveEndpointUrlPrefix provide the merchant specific url
132+
* @deprecated As of library version 1.6.1, timeouts should be set by {@link #setTimeouts(int connectionTimeoutMillis, int readTimeoutMillis)} or directly by {@link
133+
* com.adyen.Config#setConnectionTimeoutMillis(int connectionTimeoutMillis)}.
114134
*/
115135
@Deprecated
116136
public Client(String apiKey, Environment environment, int connectionTimeoutMillis, String liveEndpointUrlPrefix) {
@@ -120,6 +140,7 @@ public Client(String apiKey, Environment environment, int connectionTimeoutMilli
120140
}
121141

122142
/**
143+
* @param environment This defines the payment enviroment live or test
123144
* @deprecated As of library version 1.5.4, replaced by {@link #setEnvironment(Environment environment, String liveEndpointUrlPrefix)}.
124145
*/
125146
@Deprecated
@@ -128,7 +149,7 @@ public void setEnvironment(Environment environment) {
128149
}
129150

130151
/**
131-
* @param environment
152+
* @param environment This defines the payment enviroment live or test
132153
* @param liveEndpointUrlPrefix Provide the unique live url prefix from the "API URLs and Response" menu in the Adyen Customer Area
133154
*/
134155
public void setEnvironment(Environment environment, String liveEndpointUrlPrefix) {

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public static <T> String implode(String glue, List<T> list) {
7373
/**
7474
* Returns an Amount struct to use on requests
7575
*
76-
* @param amount
77-
* @param currency
78-
* @return
76+
* @param amount Defines the amount
77+
* @param currency Defines the amount currency
78+
* @return amount
7979
*/
8080
public static Amount createAmount(String amount, String currency) {
8181
return createAmount(new BigDecimal(amount), currency);
@@ -84,9 +84,9 @@ public static Amount createAmount(String amount, String currency) {
8484
/**
8585
* Returns an Amount struct to use on requests
8686
*
87-
* @param amount
88-
* @param currency
89-
* @return
87+
* @param amount Defines the amount
88+
* @param currency Defines the amount currency
89+
* @return amount
9090
*/
9191
public static Amount createAmount(BigDecimal amount, String currency) {
9292
Amount amountData = new Amount();
@@ -138,6 +138,8 @@ public static int getDecimalPlaces(String currency) {
138138
/**
139139
* Convert the given object to string with each line indented by 4 spaces
140140
* (except the first line).
141+
* @param o string
142+
* @return string target "\n" replacement with "\n "
141143
*/
142144
public static String toIndentedString(Object o) {
143145
if (o == null) {

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

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
import java.util.Map;
2828
import java.util.Objects;
2929
import com.adyen.constants.ApiConstants;
30+
import com.adyen.model.applicationinfo.ApplicationInfo;
3031
import com.adyen.model.recurring.Recurring;
3132
import com.adyen.serializer.DateSerializer;
3233
import com.adyen.serializer.DateTimeGMTSerializer;
3334
import com.google.gson.annotations.JsonAdapter;
3435
import com.google.gson.annotations.SerializedName;
3536

3637
/**
37-
* AbstractPaymentRequest
38-
* Base for PaymentRequest and PaymentRequest3D
38+
* AbstractPaymentRequest Base for PaymentRequest and PaymentRequest3D
3939
*/
4040
public abstract class AbstractPaymentRequest<T extends AbstractPaymentRequest<T>> {
4141
@SerializedName("amount")
@@ -60,14 +60,11 @@ public abstract class AbstractPaymentRequest<T extends AbstractPaymentRequest<T>
6060
* how the shopper interacts with the system
6161
*/
6262
public enum ShopperInteractionEnum {
63-
@SerializedName("Ecommerce")
64-
ECOMMERCE("Ecommerce"),
63+
@SerializedName("Ecommerce") ECOMMERCE("Ecommerce"),
6564

66-
@SerializedName("ContAuth")
67-
CONTAUTH("ContAuth"),
65+
@SerializedName("ContAuth") CONTAUTH("ContAuth"),
6866

69-
@SerializedName("Moto")
70-
MOTO("Moto");
67+
@SerializedName("Moto") MOTO("Moto");
7168

7269
private String value;
7370

@@ -161,8 +158,20 @@ public String toString() {
161158
@SerializedName("metadata")
162159
private Map<String, String> metadata = null;
163160

161+
@SerializedName("applicationInfo")
162+
private ApplicationInfo applicationInfo;
163+
164+
public AbstractPaymentRequest() {
165+
if (this.applicationInfo == null) {
166+
applicationInfo = new ApplicationInfo();
167+
}
168+
}
169+
164170
/**
165171
* Set browser data
172+
* @param userAgent http header
173+
* @param acceptHeader http header
174+
* @return browser data
166175
*/
167176
public T setBrowserInfoData(String userAgent, String acceptHeader) {
168177
BrowserInfo browserInfo = new BrowserInfo();
@@ -174,10 +183,9 @@ public T setBrowserInfoData(String userAgent, String acceptHeader) {
174183
}
175184

176185
/**
177-
* get additionalData map
178-
* Create the map if doesn't exists
186+
* get additionalData map Create the map if doesn't exists
179187
*
180-
* @return
188+
* @return additional data
181189
*/
182190
public Map<String, String> getOrCreateAdditionalData() {
183191
if (this.getAdditionalData() == null) {
@@ -745,6 +753,14 @@ public T metadata(Map<String, String> metadata) {
745753
return (T) this;
746754
}
747755

756+
public ApplicationInfo getApplicationInfo() {
757+
return applicationInfo;
758+
}
759+
760+
public void setApplicationInfo(ApplicationInfo applicationInfo) {
761+
this.applicationInfo = applicationInfo;
762+
}
763+
748764
/**
749765
* a map of key/value pairs of metadata sent by merchant
750766
*
@@ -799,7 +815,8 @@ public boolean equals(Object o) {
799815
&& Objects.equals(this.dateOfBirth, paymentRequest.dateOfBirth)
800816
&& Objects.equals(this.telephoneNumber, paymentRequest.telephoneNumber)
801817
&& Objects.equals(this.mcc, paymentRequest.mcc)
802-
&& Objects.equals(this.metadata, paymentRequest.metadata);
818+
&& Objects.equals(this.metadata, paymentRequest.metadata)
819+
&& Objects.equals(this.applicationInfo, paymentRequest.applicationInfo);
803820
}
804821

805822
@Override
@@ -835,7 +852,8 @@ public int hashCode() {
835852
dateOfBirth,
836853
telephoneNumber,
837854
mcc,
838-
metadata);
855+
metadata,
856+
applicationInfo);
839857
}
840858

841859

@@ -875,6 +893,7 @@ public String toString() {
875893
sb.append(" telephoneNumber: ").append(toIndentedString(telephoneNumber)).append("\n");
876894
sb.append(" mcc: ").append(toIndentedString(mcc)).append("\n");
877895
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
896+
sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
878897

879898
return sb.toString();
880899
}
@@ -901,8 +920,7 @@ private String stringifyAdditionalData() {
901920
}
902921

903922
/**
904-
* Convert the given object to string with each line indented by 4 spaces
905-
* (except the first line).
923+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
906924
*/
907925
private String toIndentedString(Object o) {
908926
if (o == null) {

0 commit comments

Comments
 (0)