Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/main/java/com/adyen/constants/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ interface RequestProperty {
String API_KEY = "x-api-key";
String APPLICATION_JSON_TYPE = "application/json";
String REQUESTED_VERIFICATION_CODE_HEADER = "x-requested-verification-code";
String WWW_AUTHENTICATE_HEADER = "WWW-Authenticate";
}

interface ThreeDS2Property {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/adyen/httpclient/AdyenHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static com.adyen.constants.ApiConstants.RequestProperty.IDEMPOTENCY_KEY;
import static com.adyen.constants.ApiConstants.RequestProperty.REQUESTED_VERIFICATION_CODE_HEADER;
import static com.adyen.constants.ApiConstants.RequestProperty.USER_AGENT;
import static com.adyen.constants.ApiConstants.RequestProperty.WWW_AUTHENTICATE_HEADER;

import com.adyen.Client;
import com.adyen.Config;
Expand Down Expand Up @@ -199,6 +200,10 @@ private void setHeaders(
REQUESTED_VERIFICATION_CODE_HEADER,
requestOptions.getRequestedVerificationCodeHeader());
}
if (requestOptions.getWwwAuthenticateHeader() != null) {
httpUriRequest.addHeader(
WWW_AUTHENTICATE_HEADER, requestOptions.getWwwAuthenticateHeader());
}

if (requestOptions.getAdditionalServiceHeaders() != null) {
requestOptions.getAdditionalServiceHeaders().forEach(httpUriRequest::addHeader);
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/adyen/model/RequestOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public class RequestOptions {
private String idempotencyKey;
private String requestedVerificationCodeHeader;
private String wwwAuthenticateHeader;
private HashMap<String, String> additionalServiceHeaders;

public RequestOptions idempotencyKey(String idempotencyKey) {
Expand All @@ -17,11 +18,24 @@ public RequestOptions requestedVerificationCodeHeader(String requestedVerificati
return this;
}

public RequestOptions wwwAuthenticateHeader(String wwwAuthenticateHeader) {
this.wwwAuthenticateHeader = wwwAuthenticateHeader;
return this;
}

public RequestOptions additionalServiceHeaders(HashMap<String, String> additionalServiceHeaders) {
this.additionalServiceHeaders = additionalServiceHeaders;
return this;
}

public RequestOptions addAdditionalServiceHeader(String key, String value) {
if (this.additionalServiceHeaders == null) {
this.additionalServiceHeaders = new HashMap<>();
}
this.additionalServiceHeaders.put(key, value);
return this;
}

public String getIdempotencyKey() {
return idempotencyKey;
}
Expand All @@ -46,6 +60,14 @@ public void setAdditionalServiceHeaders(HashMap<String, String> additionalServic
this.additionalServiceHeaders = additionalServiceHeaders;
}

public String getWwwAuthenticateHeader() {
return wwwAuthenticateHeader;
}

public void setWwwAuthenticateHeader(String wwwAuthenticateHeader) {
this.wwwAuthenticateHeader = wwwAuthenticateHeader;
}

@Override
public String toString() {
return "RequestOptions{"
Expand All @@ -55,6 +77,9 @@ public String toString() {
+ ", requestedVerificationCodeHeader='"
+ requestedVerificationCodeHeader
+ '\''
+ ", wwwAuthenticateHeader='"
+ wwwAuthenticateHeader
+ '\''
+ ", additionalServiceHeaders="
+ additionalServiceHeaders
+ '}';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
/*
* Configuration API
*
* The version of the OpenAPI document: 2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.adyen.model.balanceplatform;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
Comment on lines +19 to +20
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.

/** ApproveAssociationRequest */
@JsonPropertyOrder({
ApproveAssociationRequest.JSON_PROPERTY_ENTITY_ID,
ApproveAssociationRequest.JSON_PROPERTY_ENTITY_TYPE,
ApproveAssociationRequest.JSON_PROPERTY_SCA_DEVICE_IDS,
ApproveAssociationRequest.JSON_PROPERTY_STATUS
})
public class ApproveAssociationRequest {
public static final String JSON_PROPERTY_ENTITY_ID = "entityId";
private String entityId;

public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType";
private ScaEntityType entityType;

public static final String JSON_PROPERTY_SCA_DEVICE_IDS = "scaDeviceIds";
private List<String> scaDeviceIds;

public static final String JSON_PROPERTY_STATUS = "status";
private AssociationStatus status;

public ApproveAssociationRequest() {}

/**
* The unique identifier of the entity.
*
* @param entityId The unique identifier of the entity.
* @return the current {@code ApproveAssociationRequest} instance, allowing for method chaining
*/
public ApproveAssociationRequest entityId(String entityId) {
this.entityId = entityId;
return this;
}

/**
* The unique identifier of the entity.
*
* @return entityId The unique identifier of the entity.
*/
@JsonProperty(JSON_PROPERTY_ENTITY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getEntityId() {
return entityId;
}

/**
* The unique identifier of the entity.
*
* @param entityId The unique identifier of the entity.
*/
@JsonProperty(JSON_PROPERTY_ENTITY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setEntityId(String entityId) {
this.entityId = entityId;
}

/**
* entityType
*
* @param entityType
* @return the current {@code ApproveAssociationRequest} instance, allowing for method chaining
*/
public ApproveAssociationRequest entityType(ScaEntityType entityType) {
this.entityType = entityType;
return this;
}

/**
* Get entityType
*
* @return entityType
*/
@JsonProperty(JSON_PROPERTY_ENTITY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ScaEntityType getEntityType() {
return entityType;
}

/**
* entityType
*
* @param entityType
*/
@JsonProperty(JSON_PROPERTY_ENTITY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setEntityType(ScaEntityType entityType) {
this.entityType = entityType;
}

/**
* List of device ids associated to the entity that will be approved.
*
* @param scaDeviceIds List of device ids associated to the entity that will be approved.
* @return the current {@code ApproveAssociationRequest} instance, allowing for method chaining
*/
public ApproveAssociationRequest scaDeviceIds(List<String> scaDeviceIds) {
this.scaDeviceIds = scaDeviceIds;
return this;
}

public ApproveAssociationRequest addScaDeviceIdsItem(String scaDeviceIdsItem) {
if (this.scaDeviceIds == null) {
this.scaDeviceIds = new ArrayList<>();
}
this.scaDeviceIds.add(scaDeviceIdsItem);
return this;
}

/**
* List of device ids associated to the entity that will be approved.
*
* @return scaDeviceIds List of device ids associated to the entity that will be approved.
*/
@JsonProperty(JSON_PROPERTY_SCA_DEVICE_IDS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getScaDeviceIds() {
return scaDeviceIds;
}

/**
* List of device ids associated to the entity that will be approved.
*
* @param scaDeviceIds List of device ids associated to the entity that will be approved.
*/
@JsonProperty(JSON_PROPERTY_SCA_DEVICE_IDS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setScaDeviceIds(List<String> scaDeviceIds) {
this.scaDeviceIds = scaDeviceIds;
}

/**
* status
*
* @param status
* @return the current {@code ApproveAssociationRequest} instance, allowing for method chaining
*/
public ApproveAssociationRequest status(AssociationStatus status) {
this.status = status;
return this;
}

/**
* Get status
*
* @return status
*/
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public AssociationStatus getStatus() {
return status;
}

/**
* status
*
* @param status
*/
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStatus(AssociationStatus status) {
this.status = status;
}

/** Return true if this ApproveAssociationRequest object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ApproveAssociationRequest approveAssociationRequest = (ApproveAssociationRequest) o;
return Objects.equals(this.entityId, approveAssociationRequest.entityId)
&& Objects.equals(this.entityType, approveAssociationRequest.entityType)
&& Objects.equals(this.scaDeviceIds, approveAssociationRequest.scaDeviceIds)
&& Objects.equals(this.status, approveAssociationRequest.status);
}

@Override
public int hashCode() {
return Objects.hash(entityId, entityType, scaDeviceIds, status);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ApproveAssociationRequest {\n");
sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n");
sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n");
sb.append(" scaDeviceIds: ").append(toIndentedString(scaDeviceIds)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

/**
* Create an instance of ApproveAssociationRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of ApproveAssociationRequest
* @throws JsonProcessingException if the JSON string is invalid with respect to
* ApproveAssociationRequest
*/
public static ApproveAssociationRequest fromJson(String jsonString)
throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, ApproveAssociationRequest.class);
}

/**
* Convert an instance of ApproveAssociationRequest to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
Loading
Loading