Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/adyen/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ public class Client {
public static final String HPP_LIVE = "https://live.adyen.com/hpp";
public static final String MARKETPAY_ENDPOINT_TEST = "https://cal-test.adyen.com/cal/services";
public static final String MARKETPAY_ENDPOINT_LIVE = "https://cal-live.adyen.com/cal/services";
public static final String API_VERSION = "v30";
public static final String API_VERSION = "v40";
public static final String RECURRING_API_VERSION = "v25";
public static final String MARKETPAY_ACCOUNT_API_VERSION = "v4";
public static final String MARKETPAY_FUND_API_VERSION = "v3";
public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v1";
public static final String USER_AGENT_SUFFIX = "adyen-java-api-library/";
public static final String LIB_NAME = "adyen-java-api-library";
public static final String LIB_VERSION = "1.6.0";
public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout";
public static final String CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
public static final String CHECKOUT_API_VERSION = "v32";
public static final String CHECKOUT_API_VERSION = "v40";
public static final String CHECKOUT_UTILITY_API_VERSION = "v1";
public static final String ENDPOINT_PROTOCOL = "https://";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private HttpURLConnection createRequest(String requestUrl, String applicationNam
httpConnection.setRequestMethod(METHOD_POST);

httpConnection.setRequestProperty(ACCEPT_CHARSET, CHARSET);
httpConnection.setRequestProperty(USER_AGENT, String.format("%s %s%s", applicationName, Client.USER_AGENT_SUFFIX, Client.LIB_VERSION));
httpConnection.setRequestProperty(USER_AGENT, String.format("%s %s/%s", applicationName, Client.LIB_NAME, Client.LIB_VERSION));
if (requestOptions != null && requestOptions.getIdempotencyKey() != null) {
httpConnection.setRequestProperty(IDEMPOTENCY_KEY, requestOptions.getIdempotencyKey());
}
Expand Down
34 changes: 33 additions & 1 deletion src/main/java/com/adyen/model/PaymentRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
import com.adyen.model.additionalData.InvoiceLine;
import com.adyen.model.additionalData.SplitPayment;
import com.adyen.model.additionalData.SplitPaymentItem;
import com.adyen.model.applicationinfo.ApplicationInfo;
import com.adyen.model.applicationinfo.CommonField;
import com.google.gson.annotations.SerializedName;
import static com.adyen.Client.LIB_NAME;
import static com.adyen.Client.LIB_VERSION;

/**
* PaymentRequest
Expand All @@ -47,6 +51,18 @@ public class PaymentRequest extends AbstractPaymentRequest<PaymentRequest> {
@SerializedName("store")
private String store = null;

@SerializedName("applicationInfo")
private ApplicationInfo applicationInfo;

public PaymentRequest() {
CommonField adyenLibrary = new CommonField();
adyenLibrary.setName(LIB_NAME);
adyenLibrary.setVersion(LIB_VERSION);

this.applicationInfo = new ApplicationInfo();
this.applicationInfo.setAdyenLibrary(adyenLibrary);
}

/**
* how the shopper interacts with the system
*/
Expand Down Expand Up @@ -287,6 +303,19 @@ public void setStore(String store) {
this.store = store;
}

public ApplicationInfo getApplicationInfo() {
return applicationInfo;
}

public void setApplicationInfo(ApplicationInfo applicationInfo) {
this.applicationInfo = applicationInfo;
}

public PaymentRequest applicationInfo(ApplicationInfo applicationInfo) {
this.applicationInfo = applicationInfo;
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -299,7 +328,9 @@ public boolean equals(Object o) {
return super.equals(paymentRequest)
&& Objects.equals(this.card, paymentRequest.card)
&& Objects.equals(this.mpiData, paymentRequest.mpiData)
&& Objects.equals(this.bankAccount, paymentRequest.bankAccount)
&& Objects.equals(this.bankAccount,
paymentRequest.bankAccount)
&& Objects.equals(this.applicationInfo, paymentRequest.applicationInfo)
&& Objects.equals(this.store, paymentRequest.store);
}

Expand All @@ -317,6 +348,7 @@ public String toString() {
sb.append(" mpiData: ").append(toIndentedString(mpiData)).append("\n");
sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n");
sb.append(" recurringProcessingModel: ").append(toIndentedString(recurringProcessingModel)).append("\n");
sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
109 changes: 109 additions & 0 deletions src/main/java/com/adyen/model/applicationinfo/ApplicationInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2017 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.model.applicationinfo;

import com.google.gson.annotations.SerializedName;

public class ApplicationInfo {
@SerializedName("adyenLibrary")
private CommonField adyenLibrary;

@SerializedName("adyenPaymentSource")
private CommonField adyenPaymentSource;

@SerializedName("merchantApplication")
private CommonField merchantApplication;

@SerializedName("merchantDevice")
private MerchantDevice merchantDevice;

@SerializedName("externalPlatform")
private ExternalPlatform externalPlatform;

@SerializedName("shopperInteractionDevice")
private ShopperInteractionDevice shopperInteractionDevice;

public CommonField getAdyenLibrary() {
return adyenLibrary;
}

public void setAdyenLibrary(CommonField adyenLibrary) {
this.adyenLibrary = adyenLibrary;
}

public CommonField getAdyenPaymentSource() {
return adyenPaymentSource;
}

public void setAdyenPaymentSource(CommonField adyenPaymentSource) {
this.adyenPaymentSource = adyenPaymentSource;
}

public CommonField getMerchantApplication() {
return merchantApplication;
}

public void setMerchantApplication(CommonField merchantApplication) {
this.merchantApplication = merchantApplication;
}

public MerchantDevice getMerchantDevice() {
return merchantDevice;
}

public void setMerchantDevice(MerchantDevice merchantDevice) {
this.merchantDevice = merchantDevice;
}

public ExternalPlatform getExternalPlatform() {
return externalPlatform;
}

public void setExternalPlatform(ExternalPlatform externalPlatform) {
this.externalPlatform = externalPlatform;
}

public ShopperInteractionDevice getShopperInteractionDevice() {
return shopperInteractionDevice;
}

public void setShopperInteractionDevice(ShopperInteractionDevice shopperInteractionDevice) {
this.shopperInteractionDevice = shopperInteractionDevice;
}

@Override
public String toString() {
return "ApplicationInfo{"
+ "adyenLibrary="
+ adyenLibrary
+ ", adyenPaymentSource="
+ adyenPaymentSource
+ ", merchantApplication="
+ merchantApplication
+ ", merchantDevice="
+ merchantDevice
+ ", externalPlatform="
+ externalPlatform
+ ", shopperInteractionDevice="
+ shopperInteractionDevice
+ '}';
}
}
52 changes: 52 additions & 0 deletions src/main/java/com/adyen/model/applicationinfo/CommonField.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2017 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.model.applicationinfo;

import com.google.gson.annotations.SerializedName;

public class CommonField {
@SerializedName("name")
private String name;

@SerializedName("version")
private String version;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}

@Override
public String toString() {
return "CommonField{" + "name='" + name + '\'' + ", version='" + version + '\'' + '}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2017 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.model.applicationinfo;

import com.google.gson.annotations.SerializedName;

public class ExternalPlatform extends CommonField {
@SerializedName("integrator")
private String integrator;

public String getIntegrator() {
return integrator;
}

public void setIntegrator(String integrator) {
this.integrator = integrator;
}

@Override
public String toString() {
return "ExternalPlatform{" + "integrator='" + integrator + '\'' + "} extends " + super.toString();
}
}
63 changes: 63 additions & 0 deletions src/main/java/com/adyen/model/applicationinfo/MerchantDevice.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Java API Library
*
* Copyright (c) 2017 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
package com.adyen.model.applicationinfo;

import com.google.gson.annotations.SerializedName;

public class MerchantDevice {
@SerializedName("os")
private String os;

@SerializedName("osVersion")
private String osVersion;

@SerializedName("reference")
private String reference;

public String getOs() {
return os;
}

public void setOs(String os) {
this.os = os;
}

public String getOsVersion() {
return osVersion;
}

public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}

public String getReference() {
return reference;
}

public void setReference(String reference) {
this.reference = reference;
}

@Override
public String toString() {
return "MerchantDevice{" + "os='" + os + '\'' + ", osVersion='" + osVersion + '\'' + ", reference='" + reference + '\'' + '}';
}
}
Loading