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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.checkout.common.Currency;
import com.checkout.handlepaymentsandpayouts.flow.entities.Customer;
import com.checkout.payments.AuthorizationType;
import com.checkout.payments.BillingInformation;
import com.checkout.payments.ShippingDetails;
import com.checkout.payments.BillingDescriptor;
import com.checkout.payments.PaymentPlan;
import com.checkout.payments.PaymentRecipient;
import com.checkout.payments.ProcessingSettings;
import com.checkout.payments.PaymentInstruction;
Expand Down Expand Up @@ -154,4 +156,18 @@ public abstract class PaymentSessionInfo extends PaymentSessionBase {
* Format: date-time (ISO 8601)
*/
private Instant captureOn;

/**
* The authorization type.
* [Optional]
* Enum: "Final" "Estimated"
* Default: "Final"
*/
private AuthorizationType authorizationType;

/**
* The information to process a recurring payment request. To be used when the payment_type is Recurring.
* [Optional]
*/
private PaymentPlan paymentPlan;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public interface AmlScreeningClient {
* @param amlScreeningRequest the {@link AmlScreeningRequest}
* @return a {@link CompletableFuture} of {@link AmlScreeningResponse}
*/
CompletableFuture<AmlScreeningResponse> createAmlScreeningAsync(AmlScreeningRequest amlScreeningRequest);
CompletableFuture<AmlScreeningResponse> createAmlScreening(AmlScreeningRequest amlScreeningRequest);

/**
* Get an AML screening
*
* @param amlScreeningId the AML screening's unique identifier
* @return a {@link CompletableFuture} of {@link AmlScreeningResponse}
*/
CompletableFuture<AmlScreeningResponse> getAmlScreeningAsync(String amlScreeningId);
CompletableFuture<AmlScreeningResponse> getAmlScreening(String amlScreeningId);

// Sync methods

Expand All @@ -36,14 +36,14 @@ public interface AmlScreeningClient {
* @param amlScreeningRequest the {@link AmlScreeningRequest}
* @return a {@link AmlScreeningResponse}
*/
AmlScreeningResponse createAmlScreening(AmlScreeningRequest amlScreeningRequest);
AmlScreeningResponse createAmlScreeningSync(AmlScreeningRequest amlScreeningRequest);

/**
* Get an AML screening
*
* @param amlScreeningId the AML screening's unique identifier
* @return a {@link AmlScreeningResponse}
*/
AmlScreeningResponse getAmlScreening(String amlScreeningId);
AmlScreeningResponse getAmlScreeningSync(String amlScreeningId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AmlScreeningClientImpl(final ApiClient apiClient, final CheckoutConfigura
* @return a {@link CompletableFuture} containing the {@link AmlScreeningResponse}
*/
@Override
public CompletableFuture<AmlScreeningResponse> createAmlScreeningAsync(
public CompletableFuture<AmlScreeningResponse> createAmlScreening(
final AmlScreeningRequest amlScreeningRequest) {
validateParams("amlScreeningRequest", amlScreeningRequest);
return apiClient.postAsync(AML_VERIFICATIONS_PATH, sdkAuthorization(), AmlScreeningResponse.class,
Expand All @@ -45,7 +45,7 @@ public CompletableFuture<AmlScreeningResponse> createAmlScreeningAsync(
* @return a {@link CompletableFuture} containing the {@link AmlScreeningResponse}
*/
@Override
public CompletableFuture<AmlScreeningResponse> getAmlScreeningAsync(
public CompletableFuture<AmlScreeningResponse> getAmlScreening(
final String amlVerificationId) {
validateParams("amlVerificationId", amlVerificationId);
return apiClient.getAsync(buildPath(AML_VERIFICATIONS_PATH, amlVerificationId), sdkAuthorization(),
Expand All @@ -61,7 +61,7 @@ public CompletableFuture<AmlScreeningResponse> getAmlScreeningAsync(
* @return a {@link AmlScreeningResponse}
*/
@Override
public AmlScreeningResponse createAmlScreening(final AmlScreeningRequest amlScreeningRequest) {
public AmlScreeningResponse createAmlScreeningSync(final AmlScreeningRequest amlScreeningRequest) {
validateParams("amlScreeningRequest", amlScreeningRequest);
return apiClient.post(AML_VERIFICATIONS_PATH, sdkAuthorization(), AmlScreeningResponse.class,
amlScreeningRequest, null);
Expand All @@ -74,7 +74,7 @@ public AmlScreeningResponse createAmlScreening(final AmlScreeningRequest amlScre
* @return a {@link AmlScreeningResponse}
*/
@Override
public AmlScreeningResponse getAmlScreening(final String amlVerificationId) {
public AmlScreeningResponse getAmlScreeningSync(final String amlVerificationId) {
validateParams("amlVerificationId", amlVerificationId);
return apiClient.get(buildPath(AML_VERIFICATIONS_PATH, amlVerificationId), sdkAuthorization(),
AmlScreeningResponse.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.checkout.identities.entities;

import com.checkout.common.Link;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* The links related to an attempt asset.
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public final class AttemptAssetLinks {

/**
* The URL to download the asset.
* [Required]
* Format: uri
*/
@SerializedName("asset_url")
private Link assetUrl;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.checkout.identities.entities;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Query parameters for retrieving the assets captured during an attempt.
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public final class AttemptAssetsQueryFilter {

/**
* The number of assets to skip.
* [Optional]
* Default: 0
*/
private Integer skip;

/**
* The maximum number of assets to return.
* [Optional]
* Default: 10
*/
private Integer limit;

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.checkout.identities.faceauthentications;

import com.checkout.identities.entities.AttemptAssetsQueryFilter;
import com.checkout.identities.faceauthentications.requests.FaceAuthenticationAttemptRequest;
import com.checkout.identities.faceauthentications.requests.FaceAuthenticationRequest;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptAssetsResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptsResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationResponse;
Expand Down Expand Up @@ -63,6 +65,16 @@ public interface FaceAuthenticationClient {
*/
CompletableFuture<FaceAuthenticationAttemptResponse> getFaceAuthenticationAttempt(String faceAuthenticationId, String attemptId);

/**
* Retrieves the assets (face images and videos) captured during a face authentication attempt.
*
* @param faceAuthenticationId The face authentication ID
* @param attemptId The attempt ID
* @param queryFilter The pagination query parameters (skip and limit)
* @return CompletableFuture containing the face authentication attempt assets response
*/
CompletableFuture<FaceAuthenticationAttemptAssetsResponse> getFaceAuthenticationAttemptAssets(String faceAuthenticationId, String attemptId, AttemptAssetsQueryFilter queryFilter);

// Synchronous methods

/**
Expand Down Expand Up @@ -114,4 +126,14 @@ public interface FaceAuthenticationClient {
* @return The face authentication attempt response
*/
FaceAuthenticationAttemptResponse getFaceAuthenticationAttemptSync(String faceAuthenticationId, String attemptId);

/**
* Retrieves the assets (face images and videos) captured during a face authentication attempt.
*
* @param faceAuthenticationId The face authentication ID
* @param attemptId The attempt ID
* @param queryFilter The pagination query parameters (skip and limit)
* @return The face authentication attempt assets response
*/
FaceAuthenticationAttemptAssetsResponse getFaceAuthenticationAttemptAssetsSync(String faceAuthenticationId, String attemptId, AttemptAssetsQueryFilter queryFilter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import com.checkout.ApiClient;
import com.checkout.CheckoutConfiguration;
import com.checkout.SdkAuthorizationType;
import com.checkout.identities.entities.AttemptAssetsQueryFilter;
import com.checkout.identities.faceauthentications.requests.FaceAuthenticationAttemptRequest;
import com.checkout.identities.faceauthentications.requests.FaceAuthenticationRequest;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptAssetsResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationAttemptsResponse;
import com.checkout.identities.faceauthentications.responses.FaceAuthenticationResponse;
Expand All @@ -22,6 +24,7 @@
private static final String FACE_AUTHENTICATIONS_PATH = "face-authentications";
private static final String ANONYMIZE_PATH = "anonymize";
private static final String ATTEMPTS_PATH = "attempts";
private static final String ASSETS_PATH = "assets";

public FaceAuthenticationClientImpl(final ApiClient apiClient, final CheckoutConfiguration configuration) {
super(apiClient, configuration, SdkAuthorizationType.SECRET_KEY_OR_OAUTH);
Expand Down Expand Up @@ -106,11 +109,27 @@
@Override
public CompletableFuture<FaceAuthenticationAttemptResponse> getFaceAuthenticationAttempt(
final String faceAuthenticationId, final String attemptId) {
validateParams("faceAuthenticationId", faceAuthenticationId, "attemptId", attemptId);

Check failure on line 112 in src/main/java/com/checkout/identities/faceauthentications/FaceAuthenticationClientImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "attemptId" 4 times.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-java&issues=AZ7aYZdEGLEec-3tCEbl&open=AZ7aYZdEGLEec-3tCEbl&pullRequest=612
return apiClient.getAsync(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId),
return apiClient.getAsync(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId),
sdkAuthorization(), FaceAuthenticationAttemptResponse.class);
}

/**
* Retrieves the assets (face images and videos) captured during a face authentication attempt.
*
* @param faceAuthenticationId The face authentication ID
* @param attemptId The attempt ID
* @param queryFilter The pagination query parameters (skip and limit)
* @return CompletableFuture containing the face authentication attempt assets response
*/
@Override
public CompletableFuture<FaceAuthenticationAttemptAssetsResponse> getFaceAuthenticationAttemptAssets(
final String faceAuthenticationId, final String attemptId, final AttemptAssetsQueryFilter queryFilter) {
validateParams("faceAuthenticationId", faceAuthenticationId, "attemptId", attemptId);
return apiClient.queryAsync(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId, ASSETS_PATH),
sdkAuthorization(), queryFilter, FaceAuthenticationAttemptAssetsResponse.class);
}

// Synchronous methods

/**
Expand Down Expand Up @@ -192,7 +211,23 @@
public FaceAuthenticationAttemptResponse getFaceAuthenticationAttemptSync(
final String faceAuthenticationId, final String attemptId) {
validateParams("faceAuthenticationId", faceAuthenticationId, "attemptId", attemptId);
return apiClient.get(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId),
return apiClient.get(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId),
sdkAuthorization(), FaceAuthenticationAttemptResponse.class);
}

/**
* Retrieves the assets (face images and videos) captured during a face authentication attempt.
*
* @param faceAuthenticationId The face authentication ID
* @param attemptId The attempt ID
* @param queryFilter The pagination query parameters (skip and limit)
* @return The face authentication attempt assets response
*/
@Override
public FaceAuthenticationAttemptAssetsResponse getFaceAuthenticationAttemptAssetsSync(
final String faceAuthenticationId, final String attemptId, final AttemptAssetsQueryFilter queryFilter) {
validateParams("faceAuthenticationId", faceAuthenticationId, "attemptId", attemptId);
return apiClient.query(buildPath(FACE_AUTHENTICATIONS_PATH, faceAuthenticationId, ATTEMPTS_PATH, attemptId, ASSETS_PATH),
sdkAuthorization(), queryFilter, FaceAuthenticationAttemptAssetsResponse.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.checkout.identities.faceauthentications.responses;

import com.checkout.identities.entities.AttemptAssetLinks;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* An asset (face image or video) captured during a face authentication attempt.
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public final class FaceAuthenticationAttemptAsset {

/**
* The type of asset.
* [Required]
*/
private FaceAuthenticationAttemptAssetType type;

/**
* The links related to the asset.
* [Required]
*/
@SerializedName("_links")
private AttemptAssetLinks links;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.checkout.identities.faceauthentications.responses;

import com.google.gson.annotations.SerializedName;

/**
* The type of asset captured during a face authentication attempt.
*/
public enum FaceAuthenticationAttemptAssetType {

@SerializedName("face_image")
FACE_IMAGE,
@SerializedName("face_video")
FACE_VIDEO

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.checkout.identities.faceauthentications.responses;

import com.checkout.common.Resource;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
* The paginated assets captured during a face authentication attempt.
*/
@Data
@EqualsAndHashCode(callSuper = false)

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
Resource.canEqual
; it is advisable to add an Override annotation.
Comment thread
armando-rodriguez-cko marked this conversation as resolved.
Dismissed
@Builder
@NoArgsConstructor
@AllArgsConstructor
public final class FaceAuthenticationAttemptAssetsResponse extends Resource {

/**
* The total number of assets.
* [Required]
*/
private Integer totalCount;

/**
* The number of assets skipped.
* [Required]
*/
private Integer skip;

/**
* The maximum number of assets returned.
* [Required]
*/
private Integer limit;

/**
* The list of assets for the current page.
* [Required]
*/
private List<FaceAuthenticationAttemptAsset> data;
}
Loading
Loading