diff --git a/src/main/java/com/checkout/GsonSerializer.java b/src/main/java/com/checkout/GsonSerializer.java index 46cc1ad9..6160f74c 100644 --- a/src/main/java/com/checkout/GsonSerializer.java +++ b/src/main/java/com/checkout/GsonSerializer.java @@ -23,6 +23,8 @@ import com.checkout.payments.previous.PaymentAction; import com.checkout.payments.sender.Sender; import com.checkout.payments.sender.SenderType; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentSessionStatus; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; import com.checkout.webhooks.previous.WebhookResponse; import com.checkout.workflows.actions.WorkflowActionType; import com.checkout.workflows.conditions.WorkflowConditionType; @@ -207,6 +209,11 @@ public class GsonSerializer implements Serializer { .registerSubtype(com.checkout.issuing.controls.requests.controlgroup.VelocityControlGroupControl.class, identifier(ControlType.VELOCITY_LIMIT)) .registerSubtype(com.checkout.issuing.controls.requests.controlgroup.MccControlGroupControl.class, identifier(ControlType.MCC_LIMIT)) .registerSubtype(com.checkout.issuing.controls.requests.controlgroup.MidControlGroupControl.class, identifier(ControlType.MID_LIMIT))) + // Flow - PaymentSubmissionResponse + .registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse.class, CheckoutUtils.STATUS) + .registerSubtype(com.checkout.handlepaymentsandpayouts.flow.responses.ApprovedPaymentSubmissionResponse.class, identifier(PaymentSessionStatus.APPROVED)) + .registerSubtype(com.checkout.handlepaymentsandpayouts.flow.responses.DeclinedPaymentSubmissionResponse.class, identifier(PaymentSessionStatus.DECLINED)) + .registerSubtype(com.checkout.handlepaymentsandpayouts.flow.responses.ActionRequiredPaymentSubmissionResponse.class, identifier(PaymentSessionStatus.ACTION_REQUIRED))) // Adapters when API returns an array .registerTypeAdapter(EVENT_TYPES_TYPE, eventTypesResponseDeserializer()) .registerTypeAdapter(WORKFLOWS_EVENT_TYPES_TYPE, workflowEventTypesResponseDeserializer()) diff --git a/src/main/java/com/checkout/common/CheckoutUtils.java b/src/main/java/com/checkout/common/CheckoutUtils.java index 4fb5e85a..0f5d3af1 100644 --- a/src/main/java/com/checkout/common/CheckoutUtils.java +++ b/src/main/java/com/checkout/common/CheckoutUtils.java @@ -10,6 +10,7 @@ public final class CheckoutUtils { public static final String PROJECT_NAME = "checkout-sdk-java"; public static final String TYPE = "type"; public static final String FREQUENCY = "frequency"; + public static final String STATUS = "status"; public static final String DAILY = "Daily"; public static final String WEEKLY = "Weekly"; public static final String MONTHLY = "Monthly"; diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClient.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClient.java index 24f10458..f726d40e 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClient.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClient.java @@ -1,36 +1,48 @@ package com.checkout.handlepaymentsandpayouts.flow; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses.PaymentSessionResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.PaymentSessionWithPaymentRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses.PaymentSessionWithPaymentResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests.SubmitPaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses.SubmitPaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCreateRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionSubmitRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCompleteRequest; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; import java.util.concurrent.CompletableFuture; +/** + * Flow - Create payment sessions and submit payment attempts + */ public interface FlowClient { - CompletableFuture requestPaymentSession(PaymentSessionRequest paymentSessionRequest); - - CompletableFuture submitPaymentSessions( - String paymentId, - SubmitPaymentSessionRequest submitPaymentSessionRequest - ); - - CompletableFuture requestPaymentSessionWithPayment( - PaymentSessionWithPaymentRequest paymentSessionRequest - ); + /** + * Request a Payment Session + * Creates a payment session. + * The values you provide in the request will be used to determine the payment methods available to Flow. + * Some payment methods may require you to provide specific values for certain fields. + * You must supply the unmodified response body when you initialize Flow. + */ + CompletableFuture requestPaymentSession(PaymentSessionCreateRequest request); + + /** + * Submit a Payment Session + * Submit a payment attempt for a payment session. + * This request works with the Flow handleSubmit callback, where you can perform a customized payment submission. + * You must send the unmodified response body as the response of the handleSubmit callback. + */ + CompletableFuture submitPaymentSession(String sessionId, PaymentSessionSubmitRequest request); + + /** + * Request a Payment Session with Payment + * Create a payment session and submit a payment attempt for it. + * The values you provide in the request will be used to determine the payment methods available to Flow. + * This request works with the advanced Flow integration, where you do not need to create a payment session for initializing Flow. + * You must send the unmodified response body as the response of the handleSubmit callback. + */ + CompletableFuture requestPaymentSessionWithPayment(PaymentSessionCompleteRequest request); // Synchronous methods - PaymentSessionResponse requestPaymentSessionSync(PaymentSessionRequest paymentSessionRequest); - - SubmitPaymentSessionResponse submitPaymentSessionsSync( - String paymentId, - SubmitPaymentSessionRequest submitPaymentSessionRequest - ); - - PaymentSessionWithPaymentResponse requestPaymentSessionWithPaymentSync( - PaymentSessionWithPaymentRequest paymentSessionRequest - ); + PaymentSessionResponse requestPaymentSessionSync(PaymentSessionCreateRequest request); + + PaymentSubmissionResponse submitPaymentSessionSync(String sessionId, PaymentSessionSubmitRequest request); + + PaymentSubmissionResponse requestPaymentSessionWithPaymentSync(PaymentSessionCompleteRequest request); } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImpl.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImpl.java index a24a747d..80a9ac21 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImpl.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImpl.java @@ -4,12 +4,11 @@ import com.checkout.ApiClient; import com.checkout.CheckoutConfiguration; import com.checkout.SdkAuthorizationType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses.PaymentSessionResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.PaymentSessionWithPaymentRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses.PaymentSessionWithPaymentResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests.SubmitPaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses.SubmitPaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCreateRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionSubmitRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCompleteRequest; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; import java.util.concurrent.CompletableFuture; @@ -18,129 +17,84 @@ public class FlowClientImpl extends AbstractClient implements FlowClient { private static final String PAYMENT_SESSIONS_PATH = "payment-sessions"; - private static final String COMPLETE_PATH = "complete"; private static final String SUBMIT_PATH = "submit"; + private static final String COMPLETE_PATH = "complete"; public FlowClientImpl(final ApiClient apiClient, final CheckoutConfiguration configuration) { super(apiClient, configuration, SdkAuthorizationType.SECRET_KEY_OR_OAUTH); } @Override - public CompletableFuture requestPaymentSession( - final PaymentSessionRequest paymentSessionRequest - ) { - - validatePaymentSessionRequest(paymentSessionRequest); - - return apiClient.postAsync( - PAYMENT_SESSIONS_PATH, - sdkAuthorization(), - PaymentSessionResponse.class, - paymentSessionRequest, - null - ); - + public CompletableFuture requestPaymentSession(final PaymentSessionCreateRequest request) { + validatePaymentSessionCreateRequest(request); + return apiClient.postAsync(PAYMENT_SESSIONS_PATH, + sdkAuthorization(), + PaymentSessionResponse.class, + request, + null); } @Override - public CompletableFuture submitPaymentSessions( - final String paymentId, - final SubmitPaymentSessionRequest submitPaymentSessionRequest - ) { - - validateSubmitPaymentSessionRequest(paymentId, submitPaymentSessionRequest); - - return apiClient.postAsync( - buildPath(PAYMENT_SESSIONS_PATH, paymentId, SUBMIT_PATH), - sdkAuthorization(), - SubmitPaymentSessionResponse.class, - submitPaymentSessionRequest, - null - ); + public CompletableFuture submitPaymentSession(final String sessionId, final PaymentSessionSubmitRequest request) { + validatePaymentSessionSubmitParameters(sessionId, request); + return apiClient.postAsync(buildPath(PAYMENT_SESSIONS_PATH, sessionId, SUBMIT_PATH), + sdkAuthorization(), + PaymentSubmissionResponse.class, + request, + null); } @Override - public CompletableFuture requestPaymentSessionWithPayment( - final PaymentSessionWithPaymentRequest paymentSessionWithPaymentRequest - ) { - - validatePaymentSessionWithPaymentRequest(paymentSessionWithPaymentRequest); - - return apiClient.postAsync( - buildPath(PAYMENT_SESSIONS_PATH, COMPLETE_PATH), - sdkAuthorization(), - PaymentSessionWithPaymentResponse.class, - paymentSessionWithPaymentRequest, - null - ); - + public CompletableFuture requestPaymentSessionWithPayment(final PaymentSessionCompleteRequest request) { + validatePaymentSessionCompleteRequest(request); + return apiClient.postAsync(buildPath(PAYMENT_SESSIONS_PATH, COMPLETE_PATH), + sdkAuthorization(), + PaymentSubmissionResponse.class, + request, + null); } // Synchronous methods @Override - public PaymentSessionResponse requestPaymentSessionSync( - final PaymentSessionRequest paymentSessionRequest - ) { - - validatePaymentSessionRequest(paymentSessionRequest); - - return apiClient.post( - PAYMENT_SESSIONS_PATH, - sdkAuthorization(), - PaymentSessionResponse.class, - paymentSessionRequest, - null - ); - + public PaymentSessionResponse requestPaymentSessionSync(final PaymentSessionCreateRequest request) { + validatePaymentSessionCreateRequest(request); + return apiClient.post(PAYMENT_SESSIONS_PATH, + sdkAuthorization(), + PaymentSessionResponse.class, + request, + null); } @Override - public SubmitPaymentSessionResponse submitPaymentSessionsSync( - final String paymentId, - final SubmitPaymentSessionRequest submitPaymentSessionRequest - ) { - - validateSubmitPaymentSessionRequest(paymentId, submitPaymentSessionRequest); - - return apiClient.post( - buildPath(PAYMENT_SESSIONS_PATH, paymentId, SUBMIT_PATH), - sdkAuthorization(), - SubmitPaymentSessionResponse.class, - submitPaymentSessionRequest, - null - ); + public PaymentSubmissionResponse submitPaymentSessionSync(final String sessionId, final PaymentSessionSubmitRequest request) { + validatePaymentSessionSubmitParameters(sessionId, request); + return apiClient.post(buildPath(PAYMENT_SESSIONS_PATH, sessionId, SUBMIT_PATH), + sdkAuthorization(), + PaymentSubmissionResponse.class, + request, + null); } @Override - public PaymentSessionWithPaymentResponse requestPaymentSessionWithPaymentSync( - final PaymentSessionWithPaymentRequest paymentSessionWithPaymentRequest - ) { - - validatePaymentSessionWithPaymentRequest(paymentSessionWithPaymentRequest); - - return apiClient.post( - buildPath(PAYMENT_SESSIONS_PATH, COMPLETE_PATH), - sdkAuthorization(), - PaymentSessionWithPaymentResponse.class, - paymentSessionWithPaymentRequest, - null - ); - + public PaymentSubmissionResponse requestPaymentSessionWithPaymentSync(final PaymentSessionCompleteRequest request) { + validatePaymentSessionCompleteRequest(request); + return apiClient.post(buildPath(PAYMENT_SESSIONS_PATH, COMPLETE_PATH), + sdkAuthorization(), + PaymentSubmissionResponse.class, + request, + null); } // Common methods - void validatePaymentSessionRequest(final PaymentSessionRequest paymentSessionRequest) - { - validateParams("paymentSessionRequest", paymentSessionRequest); + private void validatePaymentSessionCreateRequest(final PaymentSessionCreateRequest request) { + validateParams("request", request); } - void validateSubmitPaymentSessionRequest(final String paymentId, final SubmitPaymentSessionRequest submitPaymentSessionRequest) - { - validateParams("paymentId", paymentId,"submitPaymentSessionRequest", submitPaymentSessionRequest); + private void validatePaymentSessionSubmitParameters(final String sessionId, final PaymentSessionSubmitRequest request) { + validateParams("sessionId", sessionId, "request", request); } - void validatePaymentSessionWithPaymentRequest(final PaymentSessionWithPaymentRequest paymentSessionWithPaymentRequest) - { - validateParams("paymentSessionWithPaymentRequest", paymentSessionWithPaymentRequest); + private void validatePaymentSessionCompleteRequest(final PaymentSessionCompleteRequest request) { + validateParams("request", request); } } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java new file mode 100644 index 00000000..4e45d922 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java @@ -0,0 +1,24 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * Configuration options specific to Apple Pay payments. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ApplePayConfiguration extends PaymentMethodConfigurationBase { + + /** + * The type of the Apple Pay payment total line item. Default: "final" + */ + @Builder.Default + private TotalType totalType = TotalType.FINAL; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CardConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CardConfiguration.java new file mode 100644 index 00000000..e602bb28 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CardConfiguration.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * Configuration options specific to card payments + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class CardConfiguration extends PaymentMethodConfigurationBase { + // Empty class - inherits all properties from base +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java new file mode 100644 index 00000000..a3e1fea5 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java @@ -0,0 +1,102 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.checkout.common.Phone; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +/** + * Comprehensive customer information for Flow payment sessions + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class Customer { + + /** + * The customer's email address. Required if source.type is tamara. + */ + private String email; + + /** + * The customer's name. Required if source.type is tamara. + */ + private String name; + + /** + * The unique identifier for an existing customer. + */ + private String id; + + /** + * The customer's phone number. Required if source.type is tamara. + */ + private Phone phone; + + /** + * The customer's value-added tax (VAT) registration number. + */ + private String taxNumber; + + /** + * Summary of the customer's transaction history. Used for risk assessment when source.type is Tamara + */ + private CustomerSummary summary; + + /** + * Customer transaction history summary + */ + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class CustomerSummary { + + /** + * The date the customer registered. + */ + private LocalDate registrationDate; + + /** + * The date of the customer's first transaction. + */ + private LocalDate firstTransactionDate; + + /** + * The date of the customer's last payment. + */ + private LocalDate lastPaymentDate; + + /** + * The total number of orders made by the customer. + */ + private Integer totalOrderCount; + + /** + * The amount of the customer's last payment. + */ + private Double lastPaymentAmount; + + /** + * Specifies whether the customer is a premium customer. + */ + private Boolean isPremiumCustomer; + + /** + * Specifies whether the customer is a returning customer. + */ + private Boolean isReturningCustomer; + + /** + * The customer's lifetime value. This is the total monetary amount that the customer has ordered, + * in their local currency, excluding canceled orders, rejected payments, refunded payments, and Tamara payments. + * The lifetime value is an indicator of how valuable the relationship with the customer is to your company. + */ + private Double lifetimeValue; + } +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CustomerRetry.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CustomerRetry.java new file mode 100644 index 00000000..093be83c --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CustomerRetry.java @@ -0,0 +1,22 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Configuration for asynchronous retries + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CustomerRetry { + + /** + * The maximum number of authorization retry attempts, excluding the initial authorization. Default: 5 + */ + @Builder.Default + private Integer maxAttempts = 5; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/GooglePayConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/GooglePayConfiguration.java new file mode 100644 index 00000000..629c91d9 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/GooglePayConfiguration.java @@ -0,0 +1,24 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * Configuration options specific to Google Pay payments. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class GooglePayConfiguration extends PaymentMethodConfigurationBase { + + /** + * The status of the Google Pay payment total price. Default: "final" + */ + @Builder.Default + private TotalPriceStatus totalPriceStatus = TotalPriceStatus.FINAL; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentAction.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentAction.java new file mode 100644 index 00000000..0562b1ab --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentAction.java @@ -0,0 +1,31 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Instruction for further payment action required by the customer + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PaymentAction { + + /** + * The type of action required + */ + private String type; + + /** + * A URL the customer should be redirected to for further action (if type requires redirect) + */ + private String url; + + /** + * Additional data needed for the action + */ + private Object data; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/PaymentMethodType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethod.java similarity index 68% rename from src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/PaymentMethodType.java rename to src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethod.java index 9b81962f..28356354 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/PaymentMethodType.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethod.java @@ -1,63 +1,111 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums; +package com.checkout.handlepaymentsandpayouts.flow.entities; import com.google.gson.annotations.SerializedName; -/** - * The payment method name. - */ -public enum PaymentMethodType { +public enum PaymentMethod { @SerializedName("alipay_cn") ALIPAY_CN, + @SerializedName("alipay_hk") ALIPAY_HK, + @SerializedName("alma") ALMA, + @SerializedName("applepay") APPLEPAY, + @SerializedName("bancontact") BANCONTACT, + @SerializedName("benefit") BENEFIT, + + @SerializedName("bizum") + BIZUM, + @SerializedName("card") CARD, + @SerializedName("dana") DANA, + @SerializedName("eps") EPS, + @SerializedName("gcash") GCASH, + @SerializedName("googlepay") GOOGLEPAY, + @SerializedName("ideal") IDEAL, + @SerializedName("kakaopay") KAKAOPAY, + @SerializedName("klarna") KLARNA, + @SerializedName("knet") KNET, + @SerializedName("mbway") MBWAY, + + @SerializedName("mobilepay") + MOBILEPAY, + @SerializedName("multibanco") MULTIBANCO, + + @SerializedName("octopus") + OCTOPUS, + @SerializedName("p24") P24, + + @SerializedName("paynow") + PAYNOW, + @SerializedName("paypal") PAYPAL, + + @SerializedName("plaid") + PLAID, + @SerializedName("qpay") QPAY, + + REMEMBER_ME, + @SerializedName("sepa") SEPA, - @SerializedName("sofort") - SOFORT, + @SerializedName("stcpay") STCPAY, + + STORED_CARD, + @SerializedName("tabby") TABBY, + @SerializedName("tamara") TAMARA, + @SerializedName("tng") TNG, + @SerializedName("truemoney") - TRUEMONEY -} + TRUEMONEY, + + @SerializedName("twint") + TWINT, + + @SerializedName("vipps") + VIPPS, + + @SerializedName("wechatpay") + WECHATPAY +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfiguration.java new file mode 100644 index 00000000..b8431446 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfiguration.java @@ -0,0 +1,39 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Configuration options for payment methods + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PaymentMethodConfiguration { + + /** + * Configuration options specific to Apple Pay payments. + */ + @SerializedName("applepay") + private ApplePayConfiguration applePay; + + /** + * Configuration options specific to card payments. + */ + private CardConfiguration card; + + /** + * Configuration options specific to Google Pay payments. + */ + @SerializedName("googlepay") + private GooglePayConfiguration googlePay; + + /** + * Configuration options specific to stored card payments. + */ + private StoredCardConfiguration storedCard; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfigurationBase.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfigurationBase.java new file mode 100644 index 00000000..bcd97556 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfigurationBase.java @@ -0,0 +1,26 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.checkout.common.AccountHolder; +import com.checkout.payments.StorePaymentDetailsType; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Base class for payment method configurations containing common properties + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public abstract class PaymentMethodConfigurationBase { + + /** + * Specifies whether you intend to store the cardholder's payment details. Default: "disabled" + */ + private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; + + /** + * The account holder's details. + */ + private AccountHolder accountHolder; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentSessionStatus.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentSessionStatus.java new file mode 100644 index 00000000..bdc334d6 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentSessionStatus.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.google.gson.annotations.SerializedName; + +/** + * Payment submission response + */ +public enum PaymentSessionStatus { + @SerializedName("Approved") + APPROVED, + @SerializedName("Declined") + DECLINED, + @SerializedName("Action Required") + ACTION_REQUIRED +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/StoredCardConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/StoredCardConfiguration.java new file mode 100644 index 00000000..10dcf129 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/StoredCardConfiguration.java @@ -0,0 +1,33 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Configuration options specific to stored card payments. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StoredCardConfiguration { + + /** + * The unique identifier for an existing customer. + */ + private String customerId; + + /** + * The unique identifiers for card Instruments. + */ + private List instrumentIds; + + /** + * The unique identifier for the payment instrument to present to the customer as the default option. + */ + private String defaultInstrumentId; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalPriceStatus.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalPriceStatus.java new file mode 100644 index 00000000..52af06b0 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalPriceStatus.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.google.gson.annotations.SerializedName; + +/** + * The status of the Google Pay payment total price + */ +public enum TotalPriceStatus { + + @SerializedName("estimated") + ESTIMATED, + + @SerializedName("final") + FINAL +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalType.java new file mode 100644 index 00000000..36c97e25 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/TotalType.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.flow.entities; + +import com.google.gson.annotations.SerializedName; + +/** + * The type of the Apple Pay payment total line item + */ +public enum TotalType { + + @SerializedName("pending") + PENDING, + + @SerializedName("final") + FINAL +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/AccountHolderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/AccountHolderType.java deleted file mode 100644 index d43ddb22..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/AccountHolderType.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -public enum AccountHolderType { - @SerializedName("individual") - INDIVIDUAL, - @SerializedName("corporate") - CORPORATE, - @SerializedName("government") - GOVERNMENT - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ChallengeIndicatorType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ChallengeIndicatorType.java deleted file mode 100644 index 0467a1de..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ChallengeIndicatorType.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "no_preference" Specifies the preference for whether a 3DS challenge should be performed. Ultimately, - * whether the challenge is presented to the customer or not is up to their bank's discretion. - */ -public enum ChallengeIndicatorType { - @SerializedName("no_preference") - NO_PREFERENCE, - @SerializedName("no_challenge_requested") - NO_CHALLENGE_REQUESTED, - @SerializedName("challenge_requested") - CHALLENGE_REQUESTED, - @SerializedName("challenge_requested_mandate") - CHALLENGE_REQUESTED_MANDATE -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/DisabledPaymentMethodsType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/DisabledPaymentMethodsType.java deleted file mode 100644 index 2a3d55ca..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/DisabledPaymentMethodsType.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Specifies which payment method options to not present to the customer. If you specify the same payment method in - * this field and in enabled_payment_methods, the disabled_payment_methods value will be overridden. Any payment method - * options not explicitly specified in this field will be presented to the customer by default. - */ -public enum DisabledPaymentMethodsType { - @SerializedName("alipay_cn") - ALIPAY_CN, - @SerializedName("alipay_hk") - ALIPAY_HK, - @SerializedName("alma") - ALMA, - @SerializedName("applepay") - APPLEPAY, - @SerializedName("bancontact") - BANCONTACT, - @SerializedName("benefit") - BENEFIT, - @SerializedName("card") - CARD, - @SerializedName("dana") - DANA, - @SerializedName("eps") - EPS, - @SerializedName("gcash") - GCASH, - @SerializedName("googlepay") - GOOGLEPAY, - @SerializedName("ideal") - IDEAL, - @SerializedName("kakaopay") - KAKAOPAY, - @SerializedName("klarna") - KLARNA, - @SerializedName("knet") - KNET, - @SerializedName("mbway") - MBWAY, - @SerializedName("multibanco") - MULTIBANCO, - @SerializedName("p24") - P24, - @SerializedName("paypal") - PAYPAL, - @SerializedName("qpay") - QPAY, - @SerializedName("sepa") - SEPA, - @SerializedName("sofort") - SOFORT, - @SerializedName("stcpay") - STCPAY, - @SerializedName("tabby") - TABBY, - @SerializedName("tamara") - TAMARA, - @SerializedName("tng") - TNG, - @SerializedName("truemoney") - TRUEMONEY -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/EnabledPaymentMethodsType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/EnabledPaymentMethodsType.java deleted file mode 100644 index 6856ff45..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/EnabledPaymentMethodsType.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Specifies which payment method options to present to the customer. The values in this field override any equivalent - * values in disabled_payment_methods. - */ -public enum EnabledPaymentMethodsType { - @SerializedName("alipay_cn") - ALIPAY_CN, - @SerializedName("alipay_hk") - ALIPAY_HK, - @SerializedName("alma") - ALMA, - @SerializedName("applepay") - APPLEPAY, - @SerializedName("bancontact") - BANCONTACT, - @SerializedName("benefit") - BENEFIT, - @SerializedName("card") - CARD, - @SerializedName("dana") - DANA, - @SerializedName("eps") - EPS, - @SerializedName("gcash") - GCASH, - @SerializedName("googlepay") - GOOGLEPAY, - @SerializedName("ideal") - IDEAL, - @SerializedName("kakaopay") - KAKAOPAY, - @SerializedName("klarna") - KLARNA, - @SerializedName("knet") - KNET, - @SerializedName("mbway") - MBWAY, - @SerializedName("multibanco") - MULTIBANCO, - @SerializedName("p24") - P24, - @SerializedName("paypal") - PAYPAL, - @SerializedName("qpay") - QPAY, - @SerializedName("sepa") - SEPA, - @SerializedName("sofort") - SOFORT, - @SerializedName("stcpay") - STCPAY, - @SerializedName("tabby") - TABBY, - @SerializedName("tamara") - TAMARA, - @SerializedName("tng") - TNG, - @SerializedName("truemoney") - TRUEMONEY -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ExemptionType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ExemptionType.java deleted file mode 100644 index c85f4e47..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/ExemptionType.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "no_preference" Specifies an exemption reason for the payment to not be processed using 3D Secure - * authentication. For more information on 3DS exemptions, refer to our SCA compliance guide. - */ -public enum ExemptionType { - @SerializedName("low_value") - LOW_VALUE, - @SerializedName("trusted_listing") - TRUSTED_LISTING, - @SerializedName("trusted_listing_prompt") - TRUSTED_LISTING_PROMPT, - @SerializedName("transaction_risk_assessment") - TRANSACTION_RISK_ASSESSMENT, - @SerializedName("3ds_outage") - THREEDS_OUTAGE, - @SerializedName("sca_delegation") - SCA_DELEGATION, - @SerializedName("out_of_sca_scope") - OUT_OF_SCA_SCOPE, - @SerializedName("low_risk_program") - LOW_RISK_PROGRAM, - @SerializedName("recurring_operation") - RECURRING_OPERATION, - @SerializedName("data_share") - DATA_SHARE, - @SerializedName("other") - OTHER -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/IdentificationType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/IdentificationType.java deleted file mode 100644 index bb2c5aba..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/IdentificationType.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** The type of identification used to identify the sender */ -public enum IdentificationType { - @SerializedName("passport") - PASSPORT, - @SerializedName("driving_licence") - DRIVING_LICENCE, - @SerializedName("national_id") - NATIONAL_ID -} - diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/LocaleType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/LocaleType.java deleted file mode 100644 index 80f0b567..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/LocaleType.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "en-GB" Creates a translated version of the page in the specified language. */ -public enum LocaleType { - @SerializedName("ar") - AR, - @SerializedName("da-DK") - DA_DK, - @SerializedName("de-DE") - DE_DE, - @SerializedName("el") - EL, - @SerializedName("en-GB") - EN_GB, - @SerializedName("es-ES") - ES_ES, - @SerializedName("fi-FI") - FI_FI, - @SerializedName("fil-PH") - FIL_PH, - @SerializedName("fr-FR") - FR_FR, - @SerializedName("hi-IN") - HI_IN, - @SerializedName("id-ID") - ID_ID, - @SerializedName("it-IT") - IT_IT, - @SerializedName("ja-JP") - JA_JP, - @SerializedName("ms-MY") - MS_MY, - @SerializedName("nb-NO") - NB_NO, - @SerializedName("nl-NL") - NL_NL, - @SerializedName("pt-PT") - PT_PT, - @SerializedName("sv-SE") - SV_SE, - @SerializedName("th-TH") - TH_TH, - @SerializedName("vi-VN") - VI_VN, - @SerializedName("zh-CN") - ZH_CN, - @SerializedName("zh-HK") - ZH_HK, - @SerializedName("zh-TW") - ZH_TW -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/MerchantInitiatedReasonType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/MerchantInitiatedReasonType.java deleted file mode 100644 index b21f53a2..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/MerchantInitiatedReasonType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Indicates the reason for a merchant-initiated payment request. */ -public enum MerchantInitiatedReasonType { - @SerializedName("Delayed_charge") - DELAYED_CHARGE, - @SerializedName("Resubmission") - RESUBMISSION, - @SerializedName("No_show") - NO_SHOW, - @SerializedName("Reauthorization") - REAUTHORIZATION -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PanPreferenceType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PanPreferenceType.java deleted file mode 100644 index 1b27fea4..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PanPreferenceType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Specifies the preferred type of Primary Account Number (PAN) for the payment: - * DPAN: Uses the Checkout.com Network Token. - * FPAN: Uses the full card number. - * Note: This only works when source.type is any of: cards instruments tokens - */ -public enum PanPreferenceType { - @SerializedName("fpan") - FPAN, - @SerializedName("dpan") - DPAN -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PaymentType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PaymentType.java deleted file mode 100644 index ba9edbd6..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PaymentType.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "Regular" Must be specified for card-not-present (CNP) payments. For example, a recurring mail order / - * telephone order (MOTO) payment. - */ -public enum PaymentType { - @SerializedName("Regular") - REGULAR, - @SerializedName("Recurring") - RECURRING, - @SerializedName("MOTO") - MOTO, - @SerializedName("Installment") - INSTALLMENT, - @SerializedName("Unscheduled") - UNSCHEDULED -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PurposeType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PurposeType.java deleted file mode 100644 index 7ae4aa6c..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/PurposeType.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** The purpose of the payment. This field might be required for AFT transactions depending on the card's - * issuer_country. To view a card's issuer_country, retrieve the card's metadata. See the AFT documentation page for - * more details. - */ -public enum PurposeType { - @SerializedName("donations") - DONATIONS, - @SerializedName("education") - EDUCATION, - @SerializedName("emergency_need") - EMERGENCY_NEED, - @SerializedName("expatriation") - EXPATRIATION, - @SerializedName("family_support") - FAMILY_SUPPORT, - @SerializedName("financial_services") - FINANCIAL_SERVICES, - @SerializedName("gifts") - GIFTS, - @SerializedName("income") - INCOME, - @SerializedName("insurance") - INSURANCE, - @SerializedName("investment") - INVESTMENT, - @SerializedName("it_services") - IT_SERVICES, - @SerializedName("leisure") - LEISURE, - @SerializedName("loan_payment") - LOAN_PAYMENT, - @SerializedName("medical_treatment") - MEDICAL_TREATMENT, - @SerializedName("other") - OTHER, - @SerializedName("pension") - PENSION, - @SerializedName("royalties") - ROYALTIES, - @SerializedName("savings") - SAVINGS, - @SerializedName("travel_and_tourism") - TRAVEL_AND_TOURISM -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/SenderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/SenderType.java deleted file mode 100644 index ae901cc8..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/SenderType.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -public enum SenderType { - @SerializedName("individual") - INDIVIDUAL, - @SerializedName("corporate") - CORPORATE, - @SerializedName("instrument") - INSTRUMENT -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/StorePaymentDetailsType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/StorePaymentDetailsType.java deleted file mode 100644 index ad9757e9..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/enums/StorePaymentDetailsType.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "disabled" Specifies whether you intend to store the cardholder's payment details. If you set this field to - * enabled, you must: have obtained consent from the cardholder to store their payment details provide a customer ID or - * email address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ -public enum StorePaymentDetailsType { - @SerializedName("disabled") - DISABLED, - @SerializedName("enabled") - ENABLED, - @SerializedName("collect_consent") - COLLECT_CONSENT -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AccommodationData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AccommodationData.java deleted file mode 100644 index d7c37db1..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AccommodationData.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AccommodationData { - - /** - * For lodging, contains the lodging name that appears on the storefront/customer receipts. For cruise, contains the - * ship name booked for the cruise. - */ - private String name; - - /** - * A unique identifier for the booking. - */ - @SerializedName("booking_reference") - private String bookingReference; - - /** - * For lodging, contains the actual or scheduled date the guest checked-in. For cruise, contains the cruise - * departure date also known as sail date. - */ - @SerializedName("check_in_date") - private Instant checkInDate; - - /** - * For lodging, contains the actual or scheduled date the guest checked-out. For cruise, contains the cruise return - * date also known as sail end date. - */ - @SerializedName("check_out_date") - private Instant checkOutDate; - - /** - * The address details of the accommodation. - */ - private Address address; - - /** - * The state or province of the address country (ISO 3166-2 code of up to two alphanumeric characters). - */ - private String state; - - /** - * The ISO country code of the address. - */ - private String country; - - /** - * The address city. - */ - private String city; - - /** - * The total number of rooms booked for the accommodation. - */ - @SerializedName("number_of_rooms") - private Long numberOfRooms; - - /** - * Contains information about the guests staying at the accommodation. - */ - private List guests; - - /** - * Contains information about the rooms booked by the customer. - */ - private List room; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Address.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Address.java deleted file mode 100644 index 72c3e524..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Address.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.common.CountryCode; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Address { - - /** - * The first line of the address. - */ - @SerializedName("address_line1") - private String addressLine1; - - /** - * The second line of the address - */ - @SerializedName("address_line2") - private String addressLine2; - - /** - * The address city. - */ - private String city; - - /** - * The state or province of the address country ISO 3166-2 code (for example: CA for California in the United - * States). - */ - private String state; - - /** - * The address zip or postal code. - */ - private String zip; - - /** - * The two-letter ISO country code of the address. - */ - private CountryCode country; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AirlineData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AirlineData.java deleted file mode 100644 index 8dc50aca..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AirlineData.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AirlineData { - - /** - * Contains information about the airline ticket. - */ - private Ticket ticket; - - /** - * Contains information about the passenger(s) on the flight. - */ - private List passenger; - - /** - * Contains information about the flight leg(s) booked by the customer. - */ - @SerializedName("flight_leg_details") - private List flightLegDetails; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AmountAllocation.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AmountAllocation.java deleted file mode 100644 index 998e89b7..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/AmountAllocation.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AmountAllocation { - - /** - * The sub-entity's ID. - */ - private String id; - - /** - * The split amount, in minor currency units. The sum of all split amounts must be equal to the payment amount. The - * split amount will be credited to your sub-entity's currency account. - */ - private Long amount; - - /** - * A reference you can use to identify the split. For example, an order number. - */ - private String reference; - - /** - * The commission you'd like to collect from the split, calculated using the formula: commission = (amount * - * commission.percentage) + commission.amount. The commission cannot exceed the split amount. Commission will be - * credited to your currency account. - */ - private Commission commission; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Applepay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Applepay.java deleted file mode 100644 index 709e9c5f..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Applepay.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Applepay { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this fieldto enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Billing.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Billing.java deleted file mode 100644 index a45aa6dd..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Billing.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Billing { - - /** - * The billing address. - */ - private Address address; - - /** - * The phone number associated with the billing address - */ - private Phone phone; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/BillingDescriptor.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/BillingDescriptor.java deleted file mode 100644 index 55ba562a..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/BillingDescriptor.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class BillingDescriptor { - - /** - * A description for the payment, which will be displayed on the customer's card statement. Only applicable for card - * payments. - */ - private String name; - - /** - * The city from which the payment originated. Only applicable for card payments. - */ - private String city; - - /** - * The reference to display on the customer's bank statement. Required for payouts to bank accounts. - */ - private String reference; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Card.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Card.java deleted file mode 100644 index 3f9b2745..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Card.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Card { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this field to enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Commission.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Commission.java deleted file mode 100644 index a4574399..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Commission.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Commission { - - /** - * An optional commission to collect, as a fixed amount in minor currency units. - */ - private Long amount; - - /** - * An optional commission to collect, as a percentage value with up to eight decimal places. - */ - private Double percentage; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Customer.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Customer.java deleted file mode 100644 index e560b064..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Customer.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Customer { - - /** - * The customer's email address. Required if source.type is tamara. - */ - private String email; - - /** - * The customer's name. Required if source.type is tamara. - */ - private String name; - - /** - * The unique identifier for an existing customer. - */ - private String id; - - /** - * The customer's phone number. Required if source.type is tamara. - */ - private Phone phone; - - /** - * The customer’s value-added tax (VAT) registration number. - */ - @SerializedName("tax_number") - private String taxNumber; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/CustomerRetry.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/CustomerRetry.java deleted file mode 100644 index 90819240..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/CustomerRetry.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class CustomerRetry { - - /** - * Default: 5 - * The maximum number of authorization retry attempts, excluding the initial authorization. - */ - @Builder.Default - @SerializedName("max_attempts") - private Long maxAttempts = 5L; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/FlightLegDetails.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/FlightLegDetails.java deleted file mode 100644 index 784bf598..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/FlightLegDetails.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class FlightLegDetails { - - /** - * The flight identifier. - */ - @SerializedName("flight_number") - private String flightNumber; - - /** - * The IATA 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data - * includes leg details. - */ - @SerializedName("carrier_code") - private String carrierCode; - - /** - * A one-letter travel class identifier. The following are common: F = First class, J = Business class, Y = Economy - * class, W = Premium economy. - */ - @SerializedName("class_of_travelling") - private String classOfTravelling; - - /** - * The IATA three-letter airport code of the departure airport. This field is required if the airline data includes - * leg details. - */ - @SerializedName("departure_airport") - private String departureAirport; - - /** - * The date of the scheduled take off. - */ - @SerializedName("departure_date") - private Instant departureDate; - - /** - * The time of the scheduled take off. - */ - @SerializedName("departure_time") - private String departureTime; - - /** - * The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes - * leg details. - */ - @SerializedName("arrival_airport") - private String arrivalAirport; - - /** - * A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the - * passenger is entitled to make a stopover, or X if they are not. - */ - @SerializedName("stop_over_code") - private String stopOverCode; - - /** - * The fare basis code, alphanumeric. - */ - @SerializedName("fare_basis_code") - private String fareBasisCode; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Googlepay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Googlepay.java deleted file mode 100644 index 75230774..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Googlepay.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Googlepay { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this field to enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Guest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Guest.java deleted file mode 100644 index 457b0f41..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Guest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Guest { - - /** - * The first name of the guest. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The last name of the guest. - */ - @SerializedName("last_name") - private String lastName; - - /** - * The date of birth of the guest. - */ - @SerializedName("date_of_birth") - private Instant dateOfBirth; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Identification.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Identification.java deleted file mode 100644 index babc7b7d..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Identification.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.IdentificationType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Identification { - - /** - * The type of identification used to identify the sender - */ - private IdentificationType type; - - /** - * The identification number - */ - private String number; - - /** - * The two-letter ISO country code of the country that issued the identification - */ - @SerializedName("issuing_country") - private String issuingCountry; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Instruction.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Instruction.java deleted file mode 100644 index db0640a0..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Instruction.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PurposeType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Instruction { - - /** - * The purpose of the payment. This field might be required for AFT transactions depending on the card's - * issuer_country. To view a card's issuer_country, retrieve the card's metadata. See the AFT documentation page for - * more details. - */ - private PurposeType purpose; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Item.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Item.java deleted file mode 100644 index 0089dfbb..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Item.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Item { - - /** - * The descriptive name of the line item. - */ - private String name; - - /** - * The number of line items. - */ - private Long quantity; - - /** - * The unit price of the item, in minor currency units. - */ - @SerializedName("unit_price") - private Long unitPrice; - - /** - * The item reference or product stock keeping unit (SKU). - */ - private String reference; - - /** - * A code identifying a commodity for value-added tax (VAT) purposes. - */ - @SerializedName("commodity_code") - private String commodityCode; - - /** - * The unit in which the item is measured, as a Unit of Measure (UoM) code. - */ - @SerializedName("unit_of_measure") - private String unitOfMeasure; - - /** - * The total cost of the line item, in minor currency units. The value should include any tax and discounts applied - * using the formula: value = (quantity x unit_price) - discount_amount. - */ - @SerializedName("total_amount") - private Long totalAmount; - - /** - * The total amount of sales tax or value-added tax (VAT) on the total purchase amount. Tax should be included in the - * total purchase amount. - */ - @SerializedName("tax_amount") - private Long taxAmount; - - /** - * The discount applied to each invoice line item. - */ - @SerializedName("discount_amount") - private Long discountAmount; - - /** - * Link to the line item's product page. - */ - private String url; - - /** - * Link to the line item's product image. - */ - @SerializedName("image_url") - private String imageUrl; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PartnerCustomerRiskData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PartnerCustomerRiskData.java deleted file mode 100644 index 922c0486..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PartnerCustomerRiskData.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PartnerCustomerRiskData { - - /** - * The key for the pair. - */ - private String key; - - /** - * The value for the pair. - */ - private String value; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Passenger.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Passenger.java deleted file mode 100644 index 11abfa63..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Passenger.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Passenger { - - /** - * The passenger's first name. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The passenger's last name. - */ - @SerializedName("last_name") - private String lastName; - - /** - * The passenger's date of birth. - */ - @SerializedName("date_of_birth") - private Instant dateOfBirth; - - /** - * Contains information about the passenger's address. - */ - private Address address; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentMethodConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentMethodConfiguration.java deleted file mode 100644 index 2cc00a4d..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentMethodConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PaymentMethodConfiguration { - - /** - * Configuration options specific to Apple Pay payments. - */ - private Applepay applepay; - - /** - * Configuration options specific to card payments. - */ - private Card card; - - /** - * Configuration options specific to Google Pay payments. - */ - private Googlepay googlepay; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentSessionRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentSessionRequest.java deleted file mode 100644 index adaa005c..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/PaymentSessionRequest.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.common.Currency; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.LocaleType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PaymentType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.AbstractSender; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PaymentSessionRequest { - - /** - * The payment amount. Provide a value of 0 to perform a card verification. The amount must be provided in the minor - * currency unit. - */ - private Long amount; - - /** - * The three-letter ISO currency code - */ - private Currency currency; - - /** - * The billing details. - */ - private Billing billing; - - /** - * Overrides the default success redirect URL configured on your account, for payment methods that require a - * redirect. - */ - @SerializedName("success_url") - private String successUrl; - - /** - * Overrides the default failure redirect URL configured on your account, for payment methods that require a - * redirect. - */ - @SerializedName("failure_url") - private String failureUrl; - - /** - * Default: "Regular" - * Must be specified for card-not-present (CNP) payments. For example, a recurring mail order / telephone order - * (MOTO) payment. - */ - @Builder.Default - @SerializedName("payment_type") - private PaymentType paymentType = PaymentType.REGULAR; - - /** - * A description of the purchase, which is displayed on the customer's statement. - */ - @SerializedName("billing_descriptor") - private BillingDescriptor billingDescriptor; - - /** - * A reference you can use to identify the payment. For example, an order number. For Amex payments, this must be at - * most 30 characters. For Benefit payments, the reference must be a unique alphanumeric value. For iDEAL payments, - * the reference is required and must be an alphanumeric value with a 35-character limit. - */ - private String reference; - - /** - * A description for the payment. - */ - private String description; - - /** - * The customer's details. Required if source.type is tamara. - */ - private Customer customer; - - /** - * The shipping details - */ - private Shipping shipping; - - /** - * Information about the recipient of the payment's funds. Applies to Account Funding Transactions, and VISA or - * Mastercard domestic UK transactions processed by financial institutions. - */ - private Recipient recipient; - - /** - * Use the processing object to influence or override the data sent during card processing - */ - private Processing processing; - - /** - * Details about the payment instruction. - */ - private Instruction instruction; - - /** - * The processing channel to use for the payment. - */ - @SerializedName("processing_channel_id") - private String processingChannelId; - - /** - * Configurations for payment method-specific settings. - */ - @SerializedName("payment_method_configuration") - private PaymentMethodConfiguration paymentMethodConfiguration; - - /** - * The line items in the order. - */ - private List items; - - /** - * The sub-entities that the payment is being processed on behalf of. - */ - @SerializedName("amount_allocations") - private List amountAllocations; - - /** - * Configures the risk assessment performed during payment processing. - */ - private Risk risk; - - /** - * The merchant's display name. - */ - @SerializedName("display_name") - private String displayName; - - /** - * Allows you to store additional information about a transaction with custom fields and up to five user-defined - * fields, which can be used for reporting purposes. You can supply fields of type string, number, and boolean - * within the metadata object. Arrays and objects are not supported. - * You can provide up to 18 metadata fields per API call, but the value of each field must not exceed 255 characters - * in length. You can also reference metadata properties in your custom rules for Fraud Detection. For example, - * $coupon_code = '1234’. - */ - @Builder.Default - private Map metadata = new HashMap<>(); - - /** - * Default: "en-GB" Creates a translated version of the page in the specified language. - */ - @Builder.Default - private LocaleType locale = LocaleType.EN_GB; - - /** - * Information required for 3D Secure authentication payments. - */ - @SerializedName("3ds") - private Threeds threeds; - - /** - * The sender of the payment. - */ - private AbstractSender sender; - - /** - * Default: true - * Specifies whether to capture the payment, if applicable. - */ - @Builder.Default - private Boolean capture = true; - - /** - * A timestamp specifying when to capture the payment, as an ISO 8601 code. If a value is provided, capture is - * automatically set to true. - */ - @SerializedName("capture_on") - private Instant captureOn; - - /** - * A timestamp specifying when the PaymentSession should expire, as an ISO 8601 code. If no value is provided, expiry is - * set to 1 hour after the PaymentSession is created. You cannot set the session expiry to more than 60 days after the - * PaymentSession is created. - */ - @SerializedName("expires_on") - private Instant expiresOn; - - /** - * Specifies which payment method options to present to the customer. The values in this field override any equivalent - * values in disabled_payment_methods. - */ - @SerializedName("enabled_payment_methods") - private List enabledPaymentMethods; - - /** - * Specifies which payment method options to not present to the customer. If you specify the same payment method in this - * field and in enabled_payment_methods, the disabled_payment_methods value will be overridden. Any payment method - * options not explicitly specified in this field will be presented to the customer by default. - */ - @SerializedName("disabled_payment_methods") - private List disabledPaymentMethods; - - /** - * Configuration for asynchronous retries. - */ - @SerializedName("customer_retry") - private CustomerRetry customerRetry; - - /** - * @deprecated This property will be removed in the future, and should be used with caution. - * The Customers IP address. Only IPv4 and IPv6 addresses are accepted. - */ - @SerializedName("ip_address") - @Deprecated - private String ipAddress; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Phone.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Phone.java deleted file mode 100644 index 395342b6..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Phone.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Phone { - - /** - * The international country calling code. - */ - @SerializedName("country_code") - private String countryCode; - - /** - * The phone number. - */ - private String number; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Processing.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Processing.java deleted file mode 100644 index 86e39cae..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Processing.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.MerchantInitiatedReasonType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PanPreferenceType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Processing { - - /** - * Indicates whether the payment is an Account Funding Transaction - */ - private Boolean aft; - - /** - * The discount amount applied to the transaction by the merchant. - */ - @SerializedName("discount_amount") - private Double discountAmount; - - /** - * The total freight or shipping and handling charges for the transaction. - */ - @SerializedName("shipping_amount") - private Double shippingAmount; - - /** - * The customer's value-added tax registration number. - */ - @SerializedName("tax_amount") - private Double taxAmount; - - /** - * Invoice ID number. - */ - @SerializedName("invoice_id") - private String invoiceId; - - /** - * The label that overrides the business name in the PayPal account on the PayPal pages. - */ - @SerializedName("brand_name") - private String brandName; - - /** - * The language and region of the customer in ISO 639-2 language code; value consists of language-country. - */ - private String locale; - - /** - * An array of key-and-value pairs with merchant-specific data for the transaction. - */ - @SerializedName("partner_customer_risk_data") - private List partnerCustomerRiskData; - - /** - * Promo codes - An array that can be used to define which of the configured payment options within a payment - * category (pay_later, pay_over_time, etc.) should be shown for this purchase. - */ - @SerializedName("custom_payment_method_ids") - private List customPaymentMethodIds; - - /** - * Contains information about the airline ticket and flights booked by the customer. - */ - @SerializedName("airline_data") - private List airlineData; - - /** - * Contains information about the accommodation booked by the customer. - */ - @SerializedName("accommodation_data") - private List accommodationData; - - /** - * The number provided by the cardholder. Purchase order or invoice number may be used. - */ - @SerializedName("order_id") - private String orderId; - - /** - * Surcharge amount applied to the transaction in minor units by the merchant. - */ - @SerializedName("surcharge_amount") - private Long surchargeAmount; - - /** - * The total charges for any import/export duty included in the transaction. - */ - @SerializedName("duty_amount") - private Double dutyAmount; - - /** - * The tax amount of the freight or shipping and handling charges for the transaction. - */ - @SerializedName("shipping_tax_amount") - private Double shippingTaxAmount; - - /** - * The purchase country of the customer. ISO 3166 alpha-2 purchase country. - */ - @SerializedName("purchase_country") - private String purchaseCountry; - - /** - * Indicates the reason for a merchant-initiated payment request. - */ - @SerializedName("merchant_initiated_reason") - private MerchantInitiatedReasonType merchantInitiatedReason; - - /** - * Unique number of the campaign this payment will be running in. Only required for Afterpay campaign invoices. - */ - @SerializedName("campaign_id") - private Long campaignId; - - /** - * The payment for a merchant's order may be split, and the original order price indicates the transaction amount of - * the entire order. - */ - @SerializedName("original_order_amount") - private Double originalOrderAmount; - - /** - * Merchant receipt ID. - */ - @SerializedName("receipt_id") - private String receiptId; - - /** - * A URL which you can use to notify the customer that the order has been created. - */ - @SerializedName("merchant_callback_url") - private String merchantCallbackUrl; - - /** - * Beta - * The line of business that the payment is associated with. - */ - @SerializedName("line_of_business") - private String lineOfBusiness; - - /** - * Specifies the preferred type of Primary Account Number (PAN) for the payment: - * DPAN: Uses the Checkout.com Network Token. - * FPAN: Uses the full card number. - * Note: This only works when source.type is any of: cards instruments tokens - */ - @SerializedName("pan_preference") - private PanPreferenceType panPreference; - - /** - * Default: true - * Indicates whether to provision a network token for the payment. - */ - @Builder.Default - @SerializedName("provision_network_token") - private Boolean provisionNetworkToken = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Recipient.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Recipient.java deleted file mode 100644 index 62af9c49..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Recipient.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Recipient { - - /** - * The recipient's date of birth, in the format YYYY-MM-DD. - */ - private Instant dob; - - /** - * An identifier related to the primary recipient's account. For example, an IBAN, an internal account number, a - * phone number, or the first six and last four digits of the PAN. - */ - @SerializedName("account_number") - private String accountNumber; - - /** - * The recipient's address. - */ - private Address address; - - /** - * The recipient's first name. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The recipient's last name. - */ - @SerializedName("last_name") - private String lastName; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Risk.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Risk.java deleted file mode 100644 index de4bdb11..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Risk.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Risk { - - /** - * Default: true - * Specifies whether to perform a risk assessment. - */ - @Builder.Default - private Boolean enabled = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Room.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Room.java deleted file mode 100644 index bbe12af0..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Room.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Room { - - /** - * For lodging, contains the nightly rate for one room. For cruise, contains the total cost of the cruise. - */ - private String rate; - - /** - * For lodging, contains the number of nights charged at the rate provided in the rate field. For cruise, contains - * the length of the cruise in days. - */ - @SerializedName("number_of_nights_at_room_rate") - private String numberOfNightsAtRoomRate; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Shipping.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Shipping.java deleted file mode 100644 index 7a7ae86d..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Shipping.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Shipping { - - /** - * The shipping address - */ - private Address address; - - /** - * The phone number associated with the shipping address - */ - private Phone phone; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Threeds.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Threeds.java deleted file mode 100644 index 8eb27da0..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Threeds.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.ChallengeIndicatorType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.ExemptionType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Threeds { - - /** - * Default: false Whether to process the payment as a 3D Secure payment. Payments where merchant_initiated is set to - * true will be processed as 3DS Requestor Initiated. - */ - @Builder.Default - private Boolean enabled = false; - - /** - * Default: false Applies only when 3ds.enabled is set to true. Set to true to attempt the payment without 3DS when - * the issuer, card, or network doesn't support 3DS. - */ - @Builder.Default - @SerializedName("attempt_n3d") - private Boolean attemptN3d = false; - - /** - * Default: "no_preference" Specifies the preference for whether a 3DS challenge should be performed. Ultimately, - * whether the challenge is presented to the customer or not is up to their bank's discretion. - */ - @Builder.Default - @SerializedName("challenge_indicator") - private ChallengeIndicatorType challengeIndicator = ChallengeIndicatorType.NO_PREFERENCE; - - /** - * Specifies an exemption reason for the payment to not be processed using 3D Secure - * authentication. For more information on 3DS exemptions, refer to our SCA compliance guide. - */ - private ExemptionType exemption; - - /** - * Default: true Specifies whether to process the payment as 3D Secure, if authorization was soft declined due to - * 3DS authentication being required. For processing channels created before October 12, 2022, the value will - * default to false. - */ - @Builder.Default - @SerializedName("allow_upgrade") - private Boolean allowUpgrade = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Ticket.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Ticket.java deleted file mode 100644 index 369f0191..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/Ticket.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Ticket { - - /** - * The ticket's unique identifier. - */ - private String number; - - /** - * Date the airline ticket was issued. - */ - @SerializedName("issue_date") - private Instant issueDate; - - /** - * Carrier code of the ticket issuer. - */ - @SerializedName("issuing_carrier_code") - private String issuingCarrierCode; - - /** - * C = Car rental reservation, A = Airline flight reservation, B = Both car rental and airline flight reservations - * included, N = Unknown. - */ - @SerializedName("travel_package_indicator") - private String travelPackageIndicator; - - /** - * The name of the travel agency. - */ - @SerializedName("travel_agency_name") - private String travelAgencyName; - - /** - * The unique identifier from IATA or ARC for the travel agency that issues the ticket. - */ - @SerializedName("travel_agency_code") - private String travelAgencyCode; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/AbstractAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/AbstractAccountHolder.java deleted file mode 100644 index 8635e2aa..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/AbstractAccountHolder.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.AccountHolderType; -import lombok.Data; - -@Data -public abstract class AbstractAccountHolder { - - /** - * The type of account holder. - */ - protected final AccountHolderType type; - - protected AbstractAccountHolder(final AccountHolderType type) { - this.type = type; - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/CorporateAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/CorporateAccountHolder.java deleted file mode 100644 index 0449f1a4..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/CorporateAccountHolder.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class CorporateAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's company name.\nThis must be a valid legal name. The following formats for the company_name - * value will return a field validation error:\n\na single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("company_name") - private String companyName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - - @Builder - private CorporateAccountHolder( - final String companyName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.CORPORATE); - this.companyName = companyName; - this.accountNameInquiry = accountNameInquiry; - } - - public CorporateAccountHolder() { - super(AccountHolderType.CORPORATE); - } -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/GovernmentAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/GovernmentAccountHolder.java deleted file mode 100644 index b053f660..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/GovernmentAccountHolder.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class GovernmentAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's company name.\nThis must be a valid legal name. The following formats for the company_name - * value will return a field validation error:\n\na single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("company_name") - private String companyName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - - @Builder - private GovernmentAccountHolder( - final String companyName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.GOVERNMENT); - this.companyName = companyName; - this.accountNameInquiry = accountNameInquiry; - } - - public GovernmentAccountHolder() { - super(AccountHolderType.GOVERNMENT); - } - - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/IndividualAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/IndividualAccountHolder.java deleted file mode 100644 index dab17564..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/accountholder/IndividualAccountHolder.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class IndividualAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's first name. - * This must be a valid legal name. The following formats for the first_name value will return a field validation - * error: - * a single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("first_name") - private String firstName; - - /** - * The account holder's last name. - * This must be a valid legal name. The following formats for the last_name value will return a field validation - * error: - * a single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("last_name") - private String lastName; - - /** - * The account holder's middle name. - * This field is required if the issuer_country value returned in the card metadata response is ZA. - */ - @SerializedName("middle_name") - private String middleName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - @Builder - private IndividualAccountHolder( - final String firstName, - final String lastName, - final String middleName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.INDIVIDUAL); - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.accountNameInquiry = accountNameInquiry; - } - - public IndividualAccountHolder() { - super(AccountHolderType.INDIVIDUAL); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/AbstractSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/AbstractSender.java deleted file mode 100644 index a1468ce2..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/AbstractSender.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.SenderType; -import lombok.Data; - -@Data -public abstract class AbstractSender { - - /** - * The type of sender. - */ - protected final SenderType type; - - protected AbstractSender(final SenderType type) { - this.type = type; - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/CorporateSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/CorporateSender.java deleted file mode 100644 index 040fff70..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/CorporateSender.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.SenderType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class CorporateSender extends AbstractSender { - - /** - * The corporate sender's company name. - */ - private String companyName; - /** - * The sender's registered corporate address. - */ - private Address address; - /** - * The sender's reference for the payout - */ - private String reference; - - @Builder - private CorporateSender( - final String companyName, - final Address address, - final String reference - ) { - super(SenderType.CORPORATE); - this.companyName = companyName; - this.address = address; - this.reference = reference; - } - - public CorporateSender() { - super(SenderType.CORPORATE); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/IndividualSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/IndividualSender.java deleted file mode 100644 index 31d95c03..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/IndividualSender.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.SenderType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Identification; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -import java.time.Instant; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class IndividualSender extends AbstractSender { - - /** - * The sender's first name - */ - private String firstName; - /** - * The sender's last name - */ - private String lastName; - /** - * @deprecated This property will be removed in the future, and should be used with caution. - * This field is deprecated. Use date_of_birth instead. The sender's date of birth, in the format yyyy-mm-dd. - */ - @Deprecated - private Instant dob; - /** - * The sender's date of birth, in the format yyyy-mm-dd. - */ - private String dateOfBirth; - /** - * The sender's address - */ - private Address address; - /** - * The sender's reference for the payout - */ - private String reference; - - private Identification identification; - - @Builder - private IndividualSender( - final String firstName, - final String lastName, - final Instant dob, - final String dateOfBirth, - final Address address, - final Identification identification, - final String reference - ) { - super(SenderType.INDIVIDUAL); - this.firstName = firstName; - this.lastName = lastName; - this.dob = dob; - this.dateOfBirth = dateOfBirth; - this.address = address; - this.identification = identification; - this.reference = reference; - } - - public IndividualSender() { - super(SenderType.INDIVIDUAL); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/InstrumentSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/InstrumentSender.java deleted file mode 100644 index 621c5b0c..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/requests/sender/InstrumentSender.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.SenderType; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class InstrumentSender extends AbstractSender { - - /** - * The sender's reference for the payout - */ - private String reference; - - @Builder - private InstrumentSender(final String reference) { - super(SenderType.INSTRUMENT); - this.reference = reference; - } - - public InstrumentSender() { - super(SenderType.INSTRUMENT); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/AccountHolderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/AccountHolderType.java deleted file mode 100644 index 7eb9ff48..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/AccountHolderType.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -public enum AccountHolderType { - @SerializedName("individual") - INDIVIDUAL, - @SerializedName("corporate") - CORPORATE, - @SerializedName("government") - GOVERNMENT -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ChallengeIndicatorType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ChallengeIndicatorType.java deleted file mode 100644 index d29ff701..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ChallengeIndicatorType.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "no_preference" Specifies the preference for whether a 3DS challenge should be performed. Ultimately, - * whether the challenge is presented to the customer or not is up to their bank's discretion. - */ -public enum ChallengeIndicatorType { - @SerializedName("no_preference") - NO_PREFERENCE, - @SerializedName("no_challenge_requested") - NO_CHALLENGE_REQUESTED, - @SerializedName("challenge_requested") - CHALLENGE_REQUESTED, - @SerializedName("challenge_requested_mandate") - CHALLENGE_REQUESTED_MANDATE -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ExemptionType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ExemptionType.java deleted file mode 100644 index 71057d88..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/ExemptionType.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "no_preference" Specifies an exemption reason for the payment to not be processed using 3D Secure - * authentication. For more information on 3DS exemptions, refer to our SCA compliance guide. - */ -public enum ExemptionType { - @SerializedName("low_value") - LOW_VALUE, - @SerializedName("trusted_listing") - TRUSTED_LISTING, - @SerializedName("trusted_listing_prompt") - TRUSTED_LISTING_PROMPT, - @SerializedName("transaction_risk_assessment") - TRANSACTION_RISK_ASSESSMENT, - @SerializedName("3ds_outage") - THREEDS_OUTAGE, - @SerializedName("sca_delegation") - SCA_DELEGATION, - @SerializedName("out_of_sca_scope") - OUT_OF_SCA_SCOPE, - @SerializedName("low_risk_program") - LOW_RISK_PROGRAM, - @SerializedName("recurring_operation") - RECURRING_OPERATION, - @SerializedName("data_share") - DATA_SHARE, - @SerializedName("other") - OTHER -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/IdentificationType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/IdentificationType.java deleted file mode 100644 index cde178a5..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/IdentificationType.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** The type of identification used to identify the sender */ -public enum IdentificationType { - @SerializedName("passport") - PASSPORT, - @SerializedName("driving_licence") - DRIVING_LICENCE, - @SerializedName("national_id") - NATIONAL_ID -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/LocaleType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/LocaleType.java deleted file mode 100644 index 588b9738..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/LocaleType.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "en-GB" Creates a translated version of the page in the specified language. */ -public enum LocaleType { - @SerializedName("ar") - AR, - @SerializedName("da-DK") - DA_DK, - @SerializedName("de-DE") - DE_DE, - @SerializedName("el") - EL, - @SerializedName("en-GB") - EN_GB, - @SerializedName("es-ES") - ES_ES, - @SerializedName("fi-FI") - FI_FI, - @SerializedName("fil-PH") - FIL_PH, - @SerializedName("fr-FR") - FR_FR, - @SerializedName("hi-IN") - HI_IN, - @SerializedName("id-ID") - ID_ID, - @SerializedName("it-IT") - IT_IT, - @SerializedName("ja-JP") - JA_JP, - @SerializedName("ms-MY") - MS_MY, - @SerializedName("nb-NO") - NB_NO, - @SerializedName("nl-NL") - NL_NL, - @SerializedName("pt-PT") - PT_PT, - @SerializedName("sv-SE") - SV_SE, - @SerializedName("th-TH") - TH_TH, - @SerializedName("vi-VN") - VI_VN, - @SerializedName("zh-CN") - ZH_CN, - @SerializedName("zh-HK") - ZH_HK, - @SerializedName("zh-TW") - ZH_TW -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/MerchantInitiatedReasonType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/MerchantInitiatedReasonType.java deleted file mode 100644 index 7532f98a..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/MerchantInitiatedReasonType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Indicates the reason for a merchant-initiated payment request. */ -public enum MerchantInitiatedReasonType { - @SerializedName("Delayed_charge") - DELAYED_CHARGE, - @SerializedName("Resubmission") - RESUBMISSION, - @SerializedName("No_show") - NO_SHOW, - @SerializedName("Reauthorization") - REAUTHORIZATION -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PanPreferenceType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PanPreferenceType.java deleted file mode 100644 index a6539fa6..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PanPreferenceType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Specifies the preferred type of Primary Account Number (PAN) for the payment: - * DPAN: Uses the Checkout.com Network Token. - * FPAN: Uses the full card number. - * Note: This only works when source.type is any of: cards instruments tokens - */ -public enum PanPreferenceType { - @SerializedName("fpan") - FPAN, - @SerializedName("dpan") - DPAN -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentMethodType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentMethodType.java deleted file mode 100644 index 65adf957..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentMethodType.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** The payment method name. */ -public enum PaymentMethodType { - @SerializedName("alipay_cn") - ALIPAY_CN, - @SerializedName("alipay_hk") - ALIPAY_HK, - @SerializedName("alma") - ALMA, - @SerializedName("applepay") - APPLEPAY, - @SerializedName("bancontact") - BANCONTACT, - @SerializedName("benefit") - BENEFIT, - @SerializedName("card") - CARD, - @SerializedName("dana") - DANA, - @SerializedName("eps") - EPS, - @SerializedName("gcash") - GCASH, - @SerializedName("googlepay") - GOOGLEPAY, - @SerializedName("ideal") - IDEAL, - @SerializedName("kakaopay") - KAKAOPAY, - @SerializedName("klarna") - KLARNA, - @SerializedName("knet") - KNET, - @SerializedName("mbway") - MBWAY, - @SerializedName("multibanco") - MULTIBANCO, - @SerializedName("p24") - P24, - @SerializedName("paypal") - PAYPAL, - @SerializedName("qpay") - QPAY, - @SerializedName("sepa") - SEPA, - @SerializedName("sofort") - SOFORT, - @SerializedName("stcpay") - STCPAY, - @SerializedName("tabby") - TABBY, - @SerializedName("tamara") - TAMARA, - @SerializedName("tng") - TNG, - @SerializedName("truemoney") - TRUEMONEY -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentType.java deleted file mode 100644 index 80e9b71f..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PaymentType.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "Regular" Must be specified for card-not-present (CNP) payments. For example, a recurring mail order / - * telephone order (MOTO) payment. - */ -public enum PaymentType { - @SerializedName("Regular") - REGULAR, - @SerializedName("Recurring") - RECURRING, - @SerializedName("MOTO") - MOTO, - @SerializedName("Installment") - INSTALLMENT, - @SerializedName("Unscheduled") - UNSCHEDULED -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PurposeType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PurposeType.java deleted file mode 100644 index d95a41a8..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/PurposeType.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** The purpose of the payment. This field might be required for AFT transactions depending on the card's - * issuer_country. To view a card's issuer_country, retrieve the card's metadata. See the AFT documentation page for - * more details. - */ -public enum PurposeType { - @SerializedName("donations") - DONATIONS, - @SerializedName("education") - EDUCATION, - @SerializedName("emergency_need") - EMERGENCY_NEED, - @SerializedName("expatriation") - EXPATRIATION, - @SerializedName("family_support") - FAMILY_SUPPORT, - @SerializedName("financial_services") - FINANCIAL_SERVICES, - @SerializedName("gifts") - GIFTS, - @SerializedName("income") - INCOME, - @SerializedName("insurance") - INSURANCE, - @SerializedName("investment") - INVESTMENT, - @SerializedName("it_services") - IT_SERVICES, - @SerializedName("leisure") - LEISURE, - @SerializedName("loan_payment") - LOAN_PAYMENT, - @SerializedName("medical_treatment") - MEDICAL_TREATMENT, - @SerializedName("other") - OTHER, - @SerializedName("pension") - PENSION, - @SerializedName("royalties") - ROYALTIES, - @SerializedName("savings") - SAVINGS, - @SerializedName("travel_and_tourism") - TRAVEL_AND_TOURISM -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/SenderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/SenderType.java deleted file mode 100644 index 00a87f96..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/SenderType.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -public enum SenderType { - @SerializedName("individual") - INDIVIDUAL, - @SerializedName("corporate") - CORPORATE, - @SerializedName("instrument") - INSTRUMENT -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/StorePaymentDetailsType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/StorePaymentDetailsType.java deleted file mode 100644 index c00fc1c8..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/enums/StorePaymentDetailsType.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums; - -import com.google.gson.annotations.SerializedName; - -/** Default: "disabled" Specifies whether you intend to store the cardholder's payment details. If you set this field to - * enabled, you must: have obtained consent from the cardholder to store their payment details provide a customer ID or - * email address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ -public enum StorePaymentDetailsType { - @SerializedName("disabled") - DISABLED, - @SerializedName("enabled") - ENABLED -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AccommodationData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AccommodationData.java deleted file mode 100644 index bbd2f644..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AccommodationData.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AccommodationData { - - /** - * For lodging, contains the lodging name that appears on the storefront/customer receipts. For cruise, contains the - * ship name booked for the cruise. - */ - private String name; - - /** - * A unique identifier for the booking. - */ - @SerializedName("booking_reference") - private String bookingReference; - - /** - * For lodging, contains the actual or scheduled date the guest checked-in. For cruise, contains the cruise - * departure date also known as sail date. - */ - @SerializedName("check_in_date") - private Instant checkInDate; - - /** - * For lodging, contains the actual or scheduled date the guest checked-out. For cruise, contains the cruise return - * date also known as sail end date. - */ - @SerializedName("check_out_date") - private Instant checkOutDate; - - /** - * The address details of the accommodation. - */ - private Address address; - - /** - * The state or province of the address country (ISO 3166-2 code of up to two alphanumeric characters). - */ - private String state; - - /** - * The ISO country code of the address. - */ - private String country; - - /** - * The address city. - */ - private String city; - - /** - * The total number of rooms booked for the accommodation. - */ - @SerializedName("number_of_rooms") - private Long numberOfRooms; - - /** - * Contains information about the guests staying at the accommodation. - */ - private List guests; - - /** - * Contains information about the rooms booked by the customer. - */ - private List room; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Address.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Address.java deleted file mode 100644 index de40271b..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Address.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.common.CountryCode; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Address { - - /** - * The first line of the address. - */ - @SerializedName("address_line1") - private String addressLine1; - - /** - * The second line of the address - */ - @SerializedName("address_line2") - private String addressLine2; - - /** - * The address city. - */ - private String city; - - /** - * The state or province of the address country ISO 3166-2 code (for example: CA for California in the United - * States). - */ - private String state; - - /** - * The address zip or postal code. - */ - private String zip; - - /** - * The two-letter ISO country code of the address. - */ - private CountryCode country; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AirlineData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AirlineData.java deleted file mode 100644 index 12acc433..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AirlineData.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AirlineData { - - /** - * Contains information about the airline ticket. - */ - private Ticket ticket; - - /** - * Contains information about the passenger(s) on the flight. - */ - private List passenger; - - /** - * Contains information about the flight leg(s) booked by the customer. - */ - @SerializedName("flight_leg_details") - private List flightLegDetails; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AmountAllocations.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AmountAllocations.java deleted file mode 100644 index b9d1cf7b..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/AmountAllocations.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class AmountAllocations { - - /** - * The sub-entity's ID. - */ - private String id; - - /** - * The split amount, in minor currency units. The sum of all split amounts must be equal to the payment amount. The - * split amount will be credited to your sub-entity's currency account. - */ - private Long amount; - - /** - * A reference you can use to identify the split. For example, an order number. - */ - private String reference; - - /** - * The commission you'd like to collect from the split, calculated using the formula: commission = (amount * - * commission.percentage) + commission.amount. The commission cannot exceed the split amount. Commission will be - * credited to your currency account. - */ - private Commission commission; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Applepay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Applepay.java deleted file mode 100644 index b7e1be0a..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Applepay.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Applepay { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this field to enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Billing.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Billing.java deleted file mode 100644 index 75e790e8..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Billing.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Billing { - - /** - * The billing address. - */ - private Address address; - - /** - * The phone number associated with the billing address - */ - private Phone phone; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/BillingDescriptor.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/BillingDescriptor.java deleted file mode 100644 index a7aa1eb7..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/BillingDescriptor.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class BillingDescriptor { - - /** - * A description for the payment, which will be displayed on the customer's card statement. Only applicable for card - * payments. - */ - private String name; - - /** - * The city from which the payment originated. Only applicable for card payments. - */ - private String city; - - /** - * The reference to display on the customer's bank statement. Required for payouts to bank accounts. - */ - private String reference; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Card.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Card.java deleted file mode 100644 index 83b680a1..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Card.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Card { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this field to enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Commission.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Commission.java deleted file mode 100644 index 3d4c0ffc..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Commission.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Commission { - - /** - * An optional commission to collect, as a fixed amount in minor currency units. - */ - private Long amount; - - /** - * An optional commission to collect, as a percentage value with up to eight decimal places. - */ - private Double percentage; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Customer.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Customer.java deleted file mode 100644 index a3279ad3..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Customer.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Customer { - - /** - * The customer's email address. Required if source.type is tamara. - */ - private String email; - - /** - * The customer's name. Required if source.type is tamara. - */ - private String name; - - /** - * The unique identifier for an existing customer. - */ - private String id; - - /** - * The customer's phone number. Required if source.type is tamara. - */ - private Phone phone; - - /** - * The customer’s value-added tax (VAT) registration number. - */ - @SerializedName("tax_number") - private String taxNumber; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/FlightLegDetails.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/FlightLegDetails.java deleted file mode 100644 index b155e197..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/FlightLegDetails.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class FlightLegDetails { - - /** - * The flight identifier. - */ - @SerializedName("flight_number") - private String flightNumber; - - /** - * The IATA 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data - * includes leg details. - */ - @SerializedName("carrier_code") - private String carrierCode; - - /** - * A one-letter travel class identifier. The following are common: F = First class, J = Business class, Y = Economy - * class, W = Premium economy. - */ - @SerializedName("class_of_travelling") - private String classOfTravelling; - - /** - * The IATA three-letter airport code of the departure airport. This field is required if the airline data includes - * leg details. - */ - @SerializedName("departure_airport") - private String departureAirport; - - /** - * The date of the scheduled take off. - */ - @SerializedName("departure_date") - private Instant departureDate; - - /** - * The time of the scheduled take off. - */ - @SerializedName("departure_time") - private String departureTime; - - /** - * The IATA 3-letter airport code of the destination airport. This field is required if the airline data includes - * leg details. - */ - @SerializedName("arrival_airport") - private String arrivalAirport; - - /** - * A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the - * passenger is entitled to make a stopover, or X if they are not. - */ - @SerializedName("stop_over_code") - private String stopOverCode; - - /** - * The fare basis code, alphanumeric. - */ - @SerializedName("fare_basis_code") - private String fareBasisCode; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Googlepay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Googlepay.java deleted file mode 100644 index a02dd8fc..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Googlepay.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.StorePaymentDetailsType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Googlepay { - - /** - * Default: "disabled" - * Specifies whether you intend to store the cardholder's payment details. If you set this field to enabled, you - * must: have obtained consent from the cardholder to store their payment details provide a customer ID or email - * address in the request If the request's payment_type is set to one of the following values, you do not need to - * provide this field: Installment Recurring Unscheduled - */ - @Builder.Default - @SerializedName("store_payment_details") - private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; - - /** - * The account holder's details. - */ - @SerializedName("account_holder") - private AbstractAccountHolder accountHolder; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Guest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Guest.java deleted file mode 100644 index c5ea2117..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Guest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Guest { - - /** - * The first name of the guest. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The last name of the guest. - */ - @SerializedName("last_name") - private String lastName; - - /** - * The date of birth of the guest. - */ - @SerializedName("date_of_birth") - private Instant dateOfBirth; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Identification.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Identification.java deleted file mode 100644 index 50ff48e9..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Identification.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.IdentificationType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Identification { - - /** - * The type of identification used to identify the sender - */ - private IdentificationType type; - - /** - * The identification number - */ - private String number; - - /** - * The two-letter ISO country code of the country that issued the identification - */ - @SerializedName("issuing_country") - private String issuingCountry; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Instruction.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Instruction.java deleted file mode 100644 index 990c1939..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Instruction.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.PurposeType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Instruction { - - /** - * The purpose of the payment. This field might be required for AFT transactions depending on the card's - * issuer_country. To view a card's issuer_country, retrieve the card's metadata. See the AFT documentation page for - * more details. - */ - private PurposeType purpose; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Item.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Item.java deleted file mode 100644 index 1b711928..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Item.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Item { - - /** - * The descriptive name of the line item. - */ - private String name; - - /** - * The number of line items. - */ - private Long quantity; - - /** - * The unit price of the item, in minor currency units. - */ - @SerializedName("unit_price") - private Long unitPrice; - - /** - * The item reference or product stock keeping unit (SKU). - */ - private String reference; - - /** - * A code identifying a commodity for value-added tax (VAT) purposes. - */ - @SerializedName("commodity_code") - private String commodityCode; - - /** - * The unit in which the item is measured, as a Unit of Measure (UoM) code. - */ - @SerializedName("unit_of_measure") - private String unitOfMeasure; - - /** - * The total cost of the line item, in minor currency units. The value should include any tax and discounts applied - * using the formula: value = (quantity x unit_price) - discount_amount. - */ - @SerializedName("total_amount") - private Long totalAmount; - - /** - * The total amount of sales tax or value-added tax (VAT) on the total purchase amount. Tax should be included in the - * total purchase amount. - */ - @SerializedName("tax_amount") - private Long taxAmount; - - /** - * The discount applied to each invoice line item. - */ - @SerializedName("discount_amount") - private Long discountAmount; - - /** - * Link to the line item's product page. - */ - private String url; - - /** - * Link to the line item's product image. - */ - @SerializedName("image_url") - private String imageUrl; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PartnerCustomerRiskData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PartnerCustomerRiskData.java deleted file mode 100644 index 9fbeedfa..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PartnerCustomerRiskData.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PartnerCustomerRiskData { - - /** - * The key for the pair. - */ - private String key; - - /** - * The value for the pair. - */ - private String value; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Passenger.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Passenger.java deleted file mode 100644 index 4cce1a31..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Passenger.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Passenger { - - /** - * The passenger's first name. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The passenger's last name. - */ - @SerializedName("last_name") - private String lastName; - - /** - * The passenger's date of birth. - */ - @SerializedName("date_of_birth") - private Instant dateOfBirth; - - /** - * Contains information about the passenger's address. - */ - private Address address; - -} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentMethodConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentMethodConfiguration.java deleted file mode 100644 index 452f5932..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentMethodConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PaymentMethodConfiguration { - - /** - * Configuration options specific to Apple Pay payments. - */ - private Applepay applepay; - - /** - * Configuration options specific to card payments. - */ - private Card card; - - /** - * Configuration options specific to Google Pay payments. - */ - private Googlepay googlepay; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentSessionWithPaymentRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentSessionWithPaymentRequest.java deleted file mode 100644 index 0f1272eb..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/PaymentSessionWithPaymentRequest.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.common.Currency; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.AmountAllocation; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.LocaleType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.PaymentType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.sender.AbstractSender; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class PaymentSessionWithPaymentRequest { - - /** - * A unique token representing the additional customer data captured by Flow, as received from the handleSubmit - * callback. Do not log or store this value. - */ - @SerializedName("session_data") - private String sessionData; - - /** - * The payment amount. Provide a value of 0 to perform a card verification. The amount must be provided in the minor - * currency unit. - */ - private Long amount; - - /** - * The three-letter ISO currency code - */ - private Currency currency; - - /** - * The billing details. - */ - private Billing billing; - - /** - * Overrides the default success redirect URL configured on your account, for payment methods that require a - * redirect. - */ - @SerializedName("success_url") - private String successUrl; - - /** - * Overrides the default failure redirect URL configured on your account, for payment methods that require a - * redirect. - */ - @SerializedName("failure_url") - private String failureUrl; - - /** - * Default: "Regular" - * Must be specified for card-not-present (CNP) payments. For example, a recurring mail order / telephone order - * (MOTO) payment. - */ - @Builder.Default - @SerializedName("payment_type") - private PaymentType paymentMethodType = PaymentType.REGULAR; - - /** - * A description of the purchase, which is displayed on the customer's statement. - */ - @SerializedName("billing_descriptor") - private BillingDescriptor billingDescriptor; - - /** - * A reference you can use to identify the payment. For example, an order number. For Amex payments, this must be at - * most 30 characters. For Benefit payments, the reference must be a unique alphanumeric value. For iDEAL payments, - * the reference is required and must be an alphanumeric value with a 35-character limit. - */ - private String reference; - - /** - * A description for the payment. - */ - private String description; - - /** - * The customer's details. Required if source.type is tamara. - */ - private Customer customer; - - /** - * The shipping details - */ - private Shipping shipping; - - /** - * Information about the recipient of the payment's funds. Applies to Account Funding Transactions, and VISA or - * Mastercard domestic UK transactions processed by financial institutions. - */ - private Recipient recipient; - - /** - * Use the processing object to influence or override the data sent during card processing - */ - private Processing processing; - - /** - * Details about the payment instruction. - */ - private Instruction instruction; - - /** - * The processing channel to use for the payment. - */ - @SerializedName("processing_channel_id") - private String processingChannelId; - - /** - * Configurations for payment method-specific settings. - */ - @SerializedName("payment_method_configuration") - private PaymentMethodConfiguration paymentMethodConfiguration; - - /** - * The line items in the order. - */ - private List items; - - /** - * The sub-entities that the payment is being processed on behalf of. - */ - @SerializedName("amount_allocations") - private List amountAllocations; - - /** - * Configures the risk assessment performed during payment processing. - */ - private Risk risk; - - /** - * The merchant's display name. - */ - @SerializedName("display_name") - private String displayName; - - /** - * Allows you to store additional information about a transaction with custom fields and up to five user-defined - * fields, which can be used for reporting purposes. You can supply fields of type string, number, and boolean - * within the metadata object. Arrays and objects are not supported. - * You can provide up to 18 metadata fields per API call, but the value of each field must not exceed 255 characters - * in length. You can also reference metadata properties in your custom rules for Fraud Detection. For example, - * $coupon_code = '1234’. - */ - @Builder.Default - private Map metadata = new HashMap<>(); - - /** - * Default: "en-GB" Creates a translated version of the page in the specified language. - */ - @Builder.Default - private LocaleType locale = LocaleType.EN_GB; - - /** - * Information required for 3D Secure authentication payments. - */ - @SerializedName("3ds") - private Threeds threeds; - - /** - * The sender of the payment. - */ - private AbstractSender sender; - - /** - * Default: true Specifies whether to capture the payment, if applicable. - */ - @Builder.Default - private Boolean capture = true; - - /** - * A timestamp specifying when to capture the payment, as an ISO 8601 code. If a value is provided, capture is - * automatically set to true. - */ - @SerializedName("capture_on") - private Instant captureOn; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Phone.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Phone.java deleted file mode 100644 index ab7d4de6..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Phone.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.common.CountryCode; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Phone { - - /** - * The international country calling code. - */ - @SerializedName("country_code") - private CountryCode countryCode; - - /** - * The phone number. - */ - private String number; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Processing.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Processing.java deleted file mode 100644 index 26ef3322..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Processing.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.MerchantInitiatedReasonType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.PanPreferenceType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Processing { - - /** - * Indicates whether the payment is an Account Funding Transaction - */ - private Boolean aft; - - /** - * The discount amount applied to the transaction by the merchant. - */ - @SerializedName("discount_amount") - private Double discountAmount; - - /** - * The total freight or shipping and handling charges for the transaction. - */ - @SerializedName("shipping_amount") - private Double shippingAmount; - - /** - * The customer's value-added tax registration number. - */ - @SerializedName("tax_amount") - private Double taxAmount; - - /** - * Invoice ID number. - */ - @SerializedName("invoice_id") - private String invoiceId; - - /** - * The label that overrides the business name in the PayPal account on the PayPal pages. - */ - @SerializedName("brand_name") - private String brandName; - - /** - * The language and region of the customer in ISO 639-2 language code; value consists of language-country. - */ - private String locale; - - /** - * An array of key-and-value pairs with merchant-specific data for the transaction. - */ - @SerializedName("partner_customer_risk_data") - private List partnerCustomerRiskData; - - /** - * Promo codes - An array that can be used to define which of the configured payment options within a payment - * category (pay_later, pay_over_time, etc.) should be shown for this purchase. - */ - @SerializedName("custom_payment_method_ids") - private List customPaymentMethodIds; - - /** - * Contains information about the airline ticket and flights booked by the customer. - */ - @SerializedName("airline_data") - private List airlineData; - - /** - * Contains information about the accommodation booked by the customer. - */ - @SerializedName("accommodation_data") - private List accommodationData; - - /** - * The number provided by the cardholder. Purchase order or invoice number may be used. - */ - @SerializedName("order_id") - private String orderId; - - /** - * Surcharge amount applied to the transaction in minor units by the merchant. - */ - @SerializedName("surcharge_amount") - private Long surchargeAmount; - - /** - * The total charges for any import/export duty included in the transaction. - */ - @SerializedName("duty_amount") - private Double dutyAmount; - - /** - * The tax amount of the freight or shipping and handling charges for the transaction. - */ - @SerializedName("shipping_tax_amount") - private Double shippingTaxAmount; - - /** - * The purchase country of the customer. ISO 3166 alpha-2 purchase country. - */ - @SerializedName("purchase_country") - private String purchaseCountry; - - /** - * Indicates the reason for a merchant-initiated payment request. - */ - @SerializedName("merchant_initiated_reason") - private MerchantInitiatedReasonType merchantInitiatedReason; - - /** - * Unique number of the campaign this payment will be running in. Only required for Afterpay campaign invoices. - */ - @SerializedName("campaign_id") - private Long campaignId; - - /** - * The payment for a merchant's order may be split, and the original order price indicates the transaction amount of the - * entire order. - */ - @SerializedName("original_order_amount") - private Double originalOrderAmount; - - /** - * Merchant receipt ID. - */ - @SerializedName("receipt_id") - private String receiptId; - - /** - * A URL which you can use to notify the customer that the order has been created. - */ - @SerializedName("merchant_callback_url") - private String merchantCallbackUrl; - - /** - * Beta - * The line of business that the payment is associated with. - */ - @SerializedName("line_of_business") - private String lineOfBusiness; - - /** - * Specifies the preferred type of Primary Account Number (PAN) for the payment: - * DPAN: Uses the Checkout.com Network Token. - * FPAN: Uses the full card number. - * Note: This only works when source.type is any of: cards instruments tokens - */ - @SerializedName("pan_preference") - private PanPreferenceType panPreference; - - /** - * Default: true - * Indicates whether to provision a network token for the payment. - */ - @Builder.Default - @SerializedName("provision_network_token") - private Boolean provisionNetworkToken = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Recipient.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Recipient.java deleted file mode 100644 index c9dca4e9..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Recipient.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Recipient { - - /** - * The recipient's date of birth, in the format YYYY-MM-DD. - */ - private Instant dob; - - /** - * An identifier related to the primary recipient's account. For example, an IBAN, an internal account number, a - * phone number, or the first six and last four digits of the PAN. - */ - @SerializedName("account_number") - private String accountNumber; - - /** - * The recipient's address. - */ - private Address address; - - /** - * The recipient's first name. - */ - @SerializedName("first_name") - private String firstName; - - /** - * The recipient's last name. - */ - @SerializedName("last_name") - private String lastName; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Risk.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Risk.java deleted file mode 100644 index 9883a197..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Risk.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Risk { - - /** - * Default: true Specifies whether to perform a risk assessment. - */ - @Builder.Default - private Boolean enabled = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Room.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Room.java deleted file mode 100644 index 5025428a..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Room.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Room { - - /** - * For lodging, contains the nightly rate for one room. For cruise, contains the total cost of the cruise. - */ - private String rate; - - /** - * For lodging, contains the number of nights charged at the rate provided in the rate field. For cruise, contains - * the length of the cruise in days. - */ - @SerializedName("number_of_nights_at_room_rate") - private String numberOfNightsAtRoomRate; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Shipping.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Shipping.java deleted file mode 100644 index a48e2d48..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Shipping.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Shipping { - - /** - * The shipping address - */ - private Address address; - - /** - * The phone number associated with the shipping address - */ - private Phone phone; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Threeds.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Threeds.java deleted file mode 100644 index 884c6b79..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Threeds.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.ChallengeIndicatorType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.ExemptionType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Threeds { - - /** - * Default: false - * Whether to process the payment as a 3D Secure payment. Payments where merchant_initiated is set to true will be - * processed as 3DS Requestor Initiated. - */ - @Builder.Default - private Boolean enabled = false; - - /** - * Default: false - * Applies only when 3ds.enabled is set to true. Set to true to attempt the payment without 3DS when the issuer, - * card, or network doesn't support 3DS. - */ - @Builder.Default - @SerializedName("attempt_n3d") - private Boolean attemptN3d = false; - - /** - * Default: "no_preference" - * Specifies the preference for whether a 3DS challenge should be performed. Ultimately, whether the challenge is - * presented to the customer or not is up to their bank's discretion. - */ - @Builder.Default - @SerializedName("challenge_indicator") - private ChallengeIndicatorType challengeIndicator = ChallengeIndicatorType.NO_PREFERENCE; - - /** - * Specifies an exemption reason for the payment to not be processed using 3D Secure authentication. For more - * information on 3DS exemptions, refer to our SCA compliance guide. - */ - private ExemptionType exemption; - - /** - * Default: true - * Specifies whether to process the payment as 3D Secure, if authorization was soft declined due to 3DS - * authentication being required. For processing channels created before October 12, 2022, the value will default - * to false. - */ - @Builder.Default - @SerializedName("allow_upgrade") - private Boolean allowUpgrade = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Ticket.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Ticket.java deleted file mode 100644 index f3a5f5ce..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/Ticket.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.Instant; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Ticket { - - /** - * The ticket's unique identifier. - */ - private String number; - - /** - * Date the airline ticket was issued. - */ - @SerializedName("issue_date") - private Instant issueDate; - - /** - * Carrier code of the ticket issuer. - */ - @SerializedName("issuing_carrier_code") - private String issuingCarrierCode; - - /** - * C = Car rental reservation, A = Airline flight reservation, B = Both car rental and airline flight reservations - * included, N = Unknown. - */ - @SerializedName("travel_package_indicator") - private String travelPackageIndicator; - - /** - * The name of the travel agency. - */ - @SerializedName("travel_agency_name") - private String travelAgencyName; - - /** - * The unique identifier from IATA or ARC for the travel agency that issues the ticket. - */ - @SerializedName("travel_agency_code") - private String travelAgencyCode; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/AbstractAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/AbstractAccountHolder.java deleted file mode 100644 index 63419254..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/AbstractAccountHolder.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.AccountHolderType; -import lombok.Data; - -@Data -public abstract class AbstractAccountHolder { - - /** - * The type of the Account Holder. - */ - protected final AccountHolderType type; - - protected AbstractAccountHolder(final AccountHolderType type) { - this.type = type; - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/CorporateAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/CorporateAccountHolder.java deleted file mode 100644 index d28ec162..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/CorporateAccountHolder.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class CorporateAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's company name.\nThis must be a valid legal name. The following formats for the company_name - * value will return a field validation error:\n\na single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("company_name") - private String companyName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - - @Builder - private CorporateAccountHolder( - final String companyName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.CORPORATE); - this.companyName = companyName; - this.accountNameInquiry = accountNameInquiry; - } - - public CorporateAccountHolder() { - super(AccountHolderType.CORPORATE); - } -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/GovernmentAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/GovernmentAccountHolder.java deleted file mode 100644 index 0b8e5fe1..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/GovernmentAccountHolder.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class GovernmentAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's company name.\ - * This must be a valid legal name. The following formats for the company_name value will return a field validation - * error: - * a single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("company_name") - private String companyName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - - @Builder - private GovernmentAccountHolder( - final String companyName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.GOVERNMENT); - this.companyName = companyName; - this.accountNameInquiry = accountNameInquiry; - } - - public GovernmentAccountHolder() { - super(AccountHolderType.GOVERNMENT); - } - - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/IndividualAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/IndividualAccountHolder.java deleted file mode 100644 index 0470c5dc..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/accountholder/IndividualAccountHolder.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.accountholder; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.AccountHolderType; -import com.google.gson.annotations.SerializedName; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class IndividualAccountHolder extends AbstractAccountHolder { - - /** - * The account holder's first name. - * This must be a valid legal name. The following formats for the first_name value will return a field validation - * error: - * a single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("first_name") - private String firstName; - - /** - * The account holder's last name. - * This must be a valid legal name. The following formats for the last_name value will return a field validation - * error: - * a single character - * all numeric characters - * all punctuation characters - */ - @SerializedName("last_name") - private String lastName; - - /** - * The account holder's middle name. - * This field is required if the issuer_country value returned in the card metadata response is ZA. - */ - @SerializedName("middle_name") - private String middleName; - - /** - * Specifies whether to perform an account name inquiry (ANI) check with the scheme. - * This is only valid for Visa and Mastercard payments. - */ - @SerializedName("account_name_inquiry") - private Boolean accountNameInquiry; - - @Builder - private IndividualAccountHolder( - final String firstName, - final String lastName, - final String middleName, - final Boolean accountNameInquiry - ) { - super(AccountHolderType.INDIVIDUAL); - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.accountNameInquiry = accountNameInquiry; - } - - public IndividualAccountHolder() { - super(AccountHolderType.INDIVIDUAL); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/AbstractSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/AbstractSender.java deleted file mode 100644 index 6ee924ec..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/AbstractSender.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.SenderType; -import lombok.Data; - -@Data -public abstract class AbstractSender { - - /** - * The type of the sender. - */ - protected final SenderType type; - - protected AbstractSender(final SenderType type) { - this.type = type; - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/CorporateSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/CorporateSender.java deleted file mode 100644 index 8ef136f5..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/CorporateSender.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.SenderType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Address; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class CorporateSender extends AbstractSender { - - /** - * The corporate sender's company name. - */ - private String companyName; - /** - * The sender's registered corporate address. - */ - private Address address; - /** - * The sender's reference for the payout - */ - private String reference; - - @Builder - private CorporateSender( - final String companyName, - final Address address, - final String reference - ) { - super(SenderType.CORPORATE); - this.companyName = companyName; - this.address = address; - this.reference = reference; - } - - public CorporateSender() { - super(SenderType.CORPORATE); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/IndividualSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/IndividualSender.java deleted file mode 100644 index fe78e456..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/IndividualSender.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.SenderType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Address; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Identification; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -import java.time.Instant; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class IndividualSender extends AbstractSender { - - /** - * The sender's first name - */ - private String firstName; - /** - * The sender's last name - */ - private String lastName; - /** - * @deprecated This property will be removed in the future, and should be used with caution. - * This field is deprecated. Use date_of_birth instead. The sender's date of birth, in the format yyyy-mm-dd. - */ - @Deprecated - private Instant dob; - /** - * The sender's date of birth, in the format yyyy-mm-dd. - */ - private Instant dateOfBirth; - /** - * The sender's address - */ - private Address address; - /** - * The sender's reference for the payout - */ - private String reference; - - private Identification identification; - - @Builder - private IndividualSender( - final String firstName, - final String lastName, - final Instant dob, - final Instant dateOfBirth, - final Address address, - final Identification identification, - final String reference - ) { - super(SenderType.INDIVIDUAL); - this.firstName = firstName; - this.lastName = lastName; - this.dob = dob; - this.dateOfBirth = dateOfBirth; - this.address = address; - this.identification = identification; - this.reference = reference; - } - - public IndividualSender() { - super(SenderType.INDIVIDUAL); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/InstrumentSender.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/InstrumentSender.java deleted file mode 100644 index cab9b95e..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/requests/sender/InstrumentSender.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.sender; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.SenderType; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public final class InstrumentSender extends AbstractSender { - - /** - * The sender's reference for the payout - */ - private String reference; - - @Builder - private InstrumentSender(final String reference) { - super(SenderType.INSTRUMENT); - this.reference = reference; - } - - public InstrumentSender() { - super(SenderType.INSTRUMENT); - } - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/responses/PaymentSessionWithPaymentResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/responses/PaymentSessionWithPaymentResponse.java deleted file mode 100644 index 0a79ad6f..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionscomplete/responses/PaymentSessionWithPaymentResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses; - -import com.checkout.common.Resource; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.enums.PaymentMethodType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@Getter -@Builder -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@AllArgsConstructor -@NoArgsConstructor -public class PaymentSessionWithPaymentResponse extends Resource { - - /** - * The payment identifier. - */ - private String id; - - /** - * The payment's status. ApprovedDeclinedApproved - */ - private String status; - - /** - * The payment method name. - */ - private PaymentMethodType type; - - /** - * Instruction for further payment action. - */ - private Object action; - - /** - * The Payment Sessions unique identifier - */ - @SerializedName("payment_session_id") - private String paymentSessionId; - - /** - * The secret used by Flow to authenticate payment session requests. Do not log or store this value. - */ - @SerializedName("payment_session_secret") - private String paymentSessionSecret; - - /** - * The reason for the payment decline. - */ - @SerializedName("decline_reason") - private String declineReason; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ChallengeIndicatorType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ChallengeIndicatorType.java deleted file mode 100644 index e1a8c95e..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ChallengeIndicatorType.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums; - -import com.google.gson.annotations.SerializedName; - -/** - * Default: "no_preference" - * Specifies the preference for whether a 3DS challenge should be performed. Ultimately, whether the challenge is - * presented to the customer or not is up to their bank's discretion. - */ -public enum ChallengeIndicatorType { - @SerializedName("no_preference") - NO_PREFERENCE, - @SerializedName("no_challenge_requested") - NO_CHALLENGE_REQUESTED, - @SerializedName("challenge_requested") - CHALLENGE_REQUESTED, - @SerializedName("challenge_requested_mandate") - CHALLENGE_REQUESTED_MANDATE -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ExemptionType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ExemptionType.java deleted file mode 100644 index c6d3c4e1..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/enums/ExemptionType.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums; - -import com.google.gson.annotations.SerializedName; - -/** - * Default: "no_preference" - * Specifies an exemption reason for the payment to not be processed using 3D Secure authentication. For more - * information on 3DS exemptions, refer to our SCA compliance guide. - */ -public enum ExemptionType { - @SerializedName("low_value") - LOW_VALUE, - @SerializedName("trusted_listing") - TRUSTED_LISTING, - @SerializedName("trusted_listing_prompt") - TRUSTED_LISTING_PROMPT, - @SerializedName("transaction_risk_assessment") - TRANSACTION_RISK_ASSESSMENT, - @SerializedName("3ds_outage") - THREEDS_OUTAGE, - @SerializedName("sca_delegation") - SCA_DELEGATION, - @SerializedName("out_of_sca_scope") - OUT_OF_SCA_SCOPE, - @SerializedName("low_risk_program") - LOW_RISK_PROGRAM, - @SerializedName("recurring_operation") - RECURRING_OPERATION, - @SerializedName("data_share") - DATA_SHARE, - @SerializedName("other") - OTHER -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Item.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Item.java deleted file mode 100644 index 5cf0813f..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Item.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Item { - - /** - * The descriptive name of the line item. - */ - private String name; - - /** - * The number of line items. - */ - private Long quantity; - - /** - * The unit price of the item, in minor currency units. - */ - @SerializedName("unit_price") - private Long unitPrice; - - /** - * The item reference or product stock keeping unit (SKU). - */ - private String reference; - - /** - * A code identifying a commodity for value-added tax (VAT) purposes. - */ - @SerializedName("commodity_code") - private String commodityCode; - - /** - * The unit in which the item is measured, as a Unit of Measure (UoM) code. - */ - @SerializedName("unit_of_measure") - private String unitOfMeasure; - - /** - * The total cost of the line item, in minor currency units. The value should include any tax and discounts applied - * using the formula: value = (quantity x unit_price) - discount_amount. - */ - @SerializedName("total_amount") - private Long totalAmount; - - /** - * The total amount of sales tax or value-added tax (VAT) on the total purchase amount. Tax should be included in - * the total purchase amount. - */ - @SerializedName("tax_amount") - private Long taxAmount; - - /** - * The discount applied to each invoice line item. - */ - @SerializedName("discount_amount") - private Long discountAmount; - - /** - * Link to the line item's product page. - */ - private String url; - - /** - * Link to the line item's product image. - */ - @SerializedName("image_url") - private String imageUrl; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/SubmitPaymentSessionRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/SubmitPaymentSessionRequest.java deleted file mode 100644 index 74765c9d..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/SubmitPaymentSessionRequest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class SubmitPaymentSessionRequest { - - /** - * A unique token representing the additional customer data captured by Flow, as received from the handleSubmit - * callback. Do not log or store this value. - */ - @SerializedName("session_data") - private String sessionData; - - /** - * The payment amount. Provide a value of 0 to perform a card verification. The amount must be provided in the minor - * currency unit. - */ - private Long amount; - - /** - * A reference you can use to identify the payment. For example, an order number. For Amex payments, this must be at - * most 30 characters. For Benefit payments, the reference must be a unique alphanumeric value. For iDEAL payments, - * the reference is required and must be an alphanumeric value with a 35-character limit. - */ - private String reference; - - /** - * The line items in the order. - */ - private List items; - - /** - * Information required for 3D Secure authentication payments. - */ - @SerializedName("3ds") - private Threeds threeds; - - /** - * The Customer's IP address. Only IPv4 and IPv6 addresses are accepted. - */ - @SerializedName("ip_address") - private String ipAddress; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Threeds.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Threeds.java deleted file mode 100644 index 40d644bf..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/requests/Threeds.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests; - -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums.ChallengeIndicatorType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums.ExemptionType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public final class Threeds { - - /** - * Default: false - * Whether to process the payment as a 3D Secure payment. Payments where merchant_initiated is set to true will be - * processed as 3DS Requestor Initiated. - */ - @Builder.Default - private Boolean enabled = false; - - /** - * Default: false - * Applies only when 3ds.enabled is set to true. Set to true to attempt the payment without 3DS when the issuer, - * card, or network doesn't support 3DS. - */ - @Builder.Default - @SerializedName("attempt_n3d") - private Boolean attemptN3d = false; - - /** - * Default: "no_preference" - * Specifies the preference for whether a 3DS challenge should be performed. Ultimately, whether the challenge is - * presented to the customer or not is up to their bank's discretion. - */ - @Builder.Default - @SerializedName("challenge_indicator") - private ChallengeIndicatorType challengeIndicator = ChallengeIndicatorType.NO_PREFERENCE; - - /** - * Specifies an exemption reason for the payment to not be processed using 3D Secure authentication. For more - * information on 3DS exemptions, refer to our SCA compliance guide. - */ - private ExemptionType exemption; - - /** - * Default: true - * Specifies whether to process the payment as 3D Secure, if authorization was soft declined due to 3DS - * authentication being required. For processing channels created before October 12, 2022, the value will default to - * false. - */ - @Builder.Default - @SerializedName("allow_upgrade") - private Boolean allowUpgrade = true; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/responses/SubmitPaymentSessionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/responses/SubmitPaymentSessionResponse.java deleted file mode 100644 index cf2d4c0f..00000000 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessionssubmit/responses/SubmitPaymentSessionResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses; - -import com.checkout.common.Resource; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.enums.PaymentMethodType; -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@Getter -@Builder -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@AllArgsConstructor -@NoArgsConstructor -public final class SubmitPaymentSessionResponse extends Resource { - - /** - * The payment identifier. - */ - private String id; - - /** - * The payment's status. ApprovedDeclinedApproved - */ - private String status; - - /** - * The payment method name. - */ - private PaymentMethodType type; - - /** - * The reason for the payment decline. - */ - @SerializedName("decline_reason") - private String declineReason; - - /** - * Instruction for further payment action. - */ - private Object action; - -} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java new file mode 100644 index 00000000..ef875254 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java @@ -0,0 +1,55 @@ +package com.checkout.handlepaymentsandpayouts.flow.requests; + +import com.checkout.payments.ProductRequest; +import com.checkout.payments.PaymentType; +import com.checkout.payments.ThreeDSRequest; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.experimental.SuperBuilder; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * Base class for all payment session requests containing common properties + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public abstract class PaymentSessionBase { + + /** + * The payment amount. Provide a value of 0 to perform a card verification. + * The amount must be provided in the minor currency unit. + * For example, provide 10000 for £100.00, or provide 100 for ¥100 (a zero-decimal currency). + */ + private Long amount; + + /** + * A reference you can use to identify the payment. For example, an order number. + * For Amex payments, this must be at most 30 characters. + * For Benefit payments, the reference must be a unique alphanumeric value. + * For iDEAL payments, the reference is required and must be an alphanumeric value with a 35-character limit. + */ + private String reference; + + /** + * The line items in the order. + */ + private List items; + + /** + * Information required for 3D Secure authentication payments. + */ + @SerializedName("3ds") + private ThreeDSRequest threeDS; + + /** + * Must be specified for card-not-present (CNP) payments. Default: "Regular" + */ + @Builder.Default + private PaymentType paymentType = PaymentType.REGULAR; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCompleteRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCompleteRequest.java new file mode 100644 index 00000000..2c239089 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCompleteRequest.java @@ -0,0 +1,28 @@ +package com.checkout.handlepaymentsandpayouts.flow.requests; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import com.google.gson.annotations.SerializedName; +import lombok.Builder; + +/** + * Request to create and complete a payment session in one operation. + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class PaymentSessionCompleteRequest extends PaymentSessionInfo { + + /** + * A unique token representing the additional customer data captured by Flow, + * as received from the handleSubmit callback. + * Do not log or store this value. + */ + private String sessionData; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCreateRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCreateRequest.java new file mode 100644 index 00000000..be06a6f3 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCreateRequest.java @@ -0,0 +1,56 @@ +package com.checkout.handlepaymentsandpayouts.flow.requests; + +import com.checkout.handlepaymentsandpayouts.flow.entities.CustomerRetry; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentMethod; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentMethodConfiguration; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.time.Instant; +import java.util.List; + +/** + * Request to create a payment session. + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class PaymentSessionCreateRequest extends PaymentSessionInfo { + + /** + * A timestamp specifying when the PaymentSession should expire, as an ISO 8601 code. + */ + private Instant expiresOn; + + /** + * Specifies which payment method options to present to the customer. + */ + private List enabledPaymentMethods; + + /** + * Specifies which payment method options to not present to the customer. + */ + private List disabledPaymentMethods; + + /** + * Configurations for payment method-specific settings. + */ + private PaymentMethodConfiguration paymentMethodConfiguration; + + /** + * Configuration for asynchronous retries. + */ + private CustomerRetry customerRetry; + + /** + * Deprecated - The Customer's IP address. Only IPv4 and IPv6 addresses are accepted. + */ + @Deprecated + private String ipAddress; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionInfo.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionInfo.java new file mode 100644 index 00000000..e1295938 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionInfo.java @@ -0,0 +1,141 @@ +package com.checkout.handlepaymentsandpayouts.flow.requests; + +import com.checkout.common.Currency; +import com.checkout.handlepaymentsandpayouts.flow.entities.Customer; +import com.checkout.payments.BillingInformation; +import com.checkout.payments.ShippingDetails; +import com.checkout.payments.BillingDescriptor; +import com.checkout.payments.PaymentRecipient; +import com.checkout.payments.ProcessingSettings; +import com.checkout.payments.PaymentInstruction; +import com.checkout.common.AmountAllocations; +import com.checkout.payments.RiskRequest; +import com.checkout.payments.sender.PaymentSender; +import com.checkout.payments.LocaleType; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.time.Instant; +import java.util.List; +import java.util.Map; + +/** + * Extended base class for payment session requests that include full payment details + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public abstract class PaymentSessionInfo extends PaymentSessionBase { + + /** + * The three-letter ISO currency code + */ + private Currency currency; + + /** + * The billing details. + */ + private BillingInformation billing; + + /** + * Overrides the default success redirect URL configured on your account, + * for payment methods that require a redirect. + */ + private String successUrl; + + /** + * Overrides the default failure redirect URL configured on your account, + * for payment methods that require a redirect. + */ + private String failureUrl; + + /** + * A description of the purchase, which is displayed on the customer's statement. + */ + private BillingDescriptor billingDescriptor; + + /** + * A description for the payment. + */ + private String description; + + /** + * The customer's details. Required if source.type is tamara. + */ + private Customer customer; + + /** + * The shipping details + */ + private ShippingDetails shipping; + + /** + * Information about the recipient of the payment's funds. + */ + private PaymentRecipient recipient; + + /** + * Use the processing object to influence or override the data sent during card processing + */ + private ProcessingSettings processing; + + /** + * Details about the payment instruction. + */ + private PaymentInstruction instruction; + + /** + * The processing channel to use for the payment. + */ + private String processingChannelId; + + /** + * The sub-entities that the payment is being processed on behalf of. + */ + private List amountAllocations; + + /** + * Configures the risk assessment performed during payment processing. + */ + private RiskRequest risk; + + /** + * The merchant's display name. + */ + private String displayName; + + /** + * Allows you to store additional information about a transaction with custom fields. + */ + private Map metadata; + + /** + * Creates a translated version of the page in the specified language. Default: "en-GB" + */ + @Builder.Default + private LocaleType locale = LocaleType.EN_GB; + + /** + * The sender of the payment. + */ + private PaymentSender sender; + + /** + * Specifies whether to capture the payment, if applicable. Default: true + */ + @Builder.Default + private Boolean capture = true; + + /** + * A timestamp specifying when to capture the payment, as an ISO 8601 code. + * If a value is provided, capture is automatically set to true. + */ + private Instant captureOn; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionSubmitRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionSubmitRequest.java new file mode 100644 index 00000000..fc307c58 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionSubmitRequest.java @@ -0,0 +1,34 @@ +package com.checkout.handlepaymentsandpayouts.flow.requests; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import com.google.gson.annotations.SerializedName; +import lombok.Builder; + +/** + * Request to submit a payment session. + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class PaymentSessionSubmitRequest extends PaymentSessionBase { + + /** + * A unique token representing the additional customer data captured by Flow, + * as received from the handleSubmit callback. + * Do not log or store this value. + */ + private String sessionData; + + /** + * Deprecated - The Customer's IP address. Only IPv4 and IPv6 addresses are accepted. + */ + @Deprecated + private String ipAddress; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java new file mode 100644 index 00000000..d4c80869 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java @@ -0,0 +1,36 @@ +package com.checkout.handlepaymentsandpayouts.flow.responses; + +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentAction; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * Action required payment submission response + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ActionRequiredPaymentSubmissionResponse extends PaymentSubmissionResponse { + + /** + * Instruction for further payment action. + */ + private PaymentAction action; + + /** + * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response) + */ + private String paymentSessionId; + + /** + * The secret used by Flow to authenticate payment session requests (only present in CreateAndSubmitPaymentSession response). + * Do not log or store this value. + */ + private String paymentSessionSecret; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java new file mode 100644 index 00000000..64fd7eb2 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java @@ -0,0 +1,30 @@ +package com.checkout.handlepaymentsandpayouts.flow.responses; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * Approved payment submission response + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ApprovedPaymentSubmissionResponse extends PaymentSubmissionResponse { + + /** + * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response) + */ + private String paymentSessionId; + + /** + * The secret used by Flow to authenticate payment session requests (only present in CreateAndSubmitPaymentSession response). + * Do not log or store this value. + */ + private String paymentSessionSecret; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/DeclinedPaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/DeclinedPaymentSubmissionResponse.java new file mode 100644 index 00000000..bb16473f --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/DeclinedPaymentSubmissionResponse.java @@ -0,0 +1,23 @@ +package com.checkout.handlepaymentsandpayouts.flow.responses; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * Declined payment submission response + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class DeclinedPaymentSubmissionResponse extends PaymentSubmissionResponse { + + /** + * The reason for the payment decline. + */ + private String declineReason; +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/responses/PaymentSessionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java similarity index 58% rename from src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/responses/PaymentSessionResponse.java rename to src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java index 376a1d2c..12ebb723 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/paymentsessions/responses/PaymentSessionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java @@ -1,21 +1,22 @@ -package com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses; +package com.checkout.handlepaymentsandpayouts.flow.responses; import com.checkout.common.Resource; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; +import lombok.Data; import lombok.EqualsAndHashCode; -import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.ToString; -@Getter +/** + * Payment session response containing session details + */ +@Data @Builder -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -@AllArgsConstructor @NoArgsConstructor -public final class PaymentSessionResponse extends Resource { +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class PaymentSessionResponse extends Resource { /** * The Payment Sessions unique identifier @@ -23,16 +24,14 @@ public final class PaymentSessionResponse extends Resource { private String id; /** - * A unique token representing the payment session, which you must provide when you initialize Flow. Do not log or - * store this value. + * A unique token representing the payment session, which you must provide when you initialize Flow. + * Do not log or store this value. */ - @SerializedName("payment_session_token") private String paymentSessionToken; /** - * The secret used by Flow to authenticate payment session requests. Do not log or store this value. + * The secret used by Flow to authenticate payment session requests. + * Do not log or store this value. */ - @SerializedName("payment_session_secret") private String paymentSessionSecret; - -} +} \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSubmissionResponse.java new file mode 100644 index 00000000..7313ea0f --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSubmissionResponse.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.flow.responses; + +import com.checkout.common.Resource; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentMethod; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentSessionStatus; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * Base class for payment submission responses + */ +@Data +@EqualsAndHashCode(callSuper = true) + +public abstract class PaymentSubmissionResponse extends Resource { + + /** + * The payment identifier. + */ + private String id; + + /** + * The payment's status - used for polymorphic deserialization. + */ + private PaymentSessionStatus status; + + /** + * The payment method name. + */ + private PaymentMethod type; +} \ No newline at end of file diff --git a/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImplTest.java b/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImplTest.java index b8ab901d..92d85f45 100644 --- a/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImplTest.java +++ b/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowClientImplTest.java @@ -5,22 +5,11 @@ import com.checkout.SdkAuthorization; import com.checkout.SdkAuthorizationType; import com.checkout.SdkCredentials; -import com.checkout.common.CountryCode; -import com.checkout.common.Currency; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.IdentificationType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.LocaleType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PaymentType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Identification; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Phone; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.IndividualSender; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses.PaymentSessionResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.PaymentSessionWithPaymentRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses.PaymentSessionWithPaymentResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests.SubmitPaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses.SubmitPaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCreateRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionSubmitRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCompleteRequest; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -56,193 +45,120 @@ class FlowClientImplTest { @BeforeEach void setUp() { - when(sdkCredentials.getAuthorization(SdkAuthorizationType.SECRET_KEY_OR_OAUTH)).thenReturn(authorization); - when(configuration.getSdkCredentials()).thenReturn(sdkCredentials); + setUpAuthorizationMocks(); client = new FlowClientImpl(apiClient, configuration); } @Test - void shouldRequestPaymentSessions() throws ExecutionException, InterruptedException { - final PaymentSessionRequest request = createPaymentSessionRequest(); - final PaymentSessionResponse response = createPaymentSessionResponse(); - - when(apiClient.postAsync(eq("payment-sessions"), eq(authorization), eq(PaymentSessionResponse.class), eq(request), isNull())) - .thenReturn(CompletableFuture.completedFuture(response)); - - final CompletableFuture future = client.requestPaymentSession(request); - - validatePaymentSessionResponse(future.get(), response); - } + void shouldRequestPaymentSession() throws ExecutionException, InterruptedException { + final PaymentSessionCreateRequest request = createMockPaymentSessionCreateRequest(); + final PaymentSessionResponse expectedResponse = mock(PaymentSessionResponse.class); - @Test - void shouldRequestPaymentSessionsWithFullIndividualSender() throws ExecutionException, InterruptedException { - final PaymentSessionRequest request = PaymentSessionRequest.builder() - .amount(1000L) // 10.00 in minor currency units - .currency(Currency.USD) - .billing(createStandardBilling()) - .successUrl("https://example.com/success") - .failureUrl("https://example.com/failure") - .paymentType(PaymentType.REGULAR) - .reference("ORDER-12345") - .description("Test payment for order") - .sender(createIndividualSender()) - .capture(true) - .locale(LocaleType.EN_GB) - .build(); - - final PaymentSessionResponse response = mock(PaymentSessionResponse.class); - - when(apiClient.postAsync(eq("payment-sessions"), eq(authorization), eq(PaymentSessionResponse.class), eq(request), isNull())) - .thenReturn(CompletableFuture.completedFuture(response)); + when(apiClient.postAsync(eq("payment-sessions"), eq(authorization), eq(PaymentSessionResponse.class), + eq(request), isNull())) + .thenReturn(CompletableFuture.completedFuture(expectedResponse)); final CompletableFuture future = client.requestPaymentSession(request); + final PaymentSessionResponse actualResponse = future.get(); - validatePaymentSessionResponse(future.get(), response); + validateResponse(expectedResponse, actualResponse); } @Test - void shouldSubmitPaymentSessions() throws ExecutionException, InterruptedException { - final String paymentId = "pay_mbabizu24mvu3mela5njyhpit4"; - final SubmitPaymentSessionRequest request = createSubmitPaymentSessionRequest(); - final SubmitPaymentSessionResponse response = createSubmitPaymentSessionResponse(); + void shouldSubmitPaymentSession() throws ExecutionException, InterruptedException { + final String sessionId = "ps_test_123456789"; + final PaymentSessionSubmitRequest request = createMockPaymentSessionSubmitRequest(); + final PaymentSubmissionResponse expectedResponse = mock(PaymentSubmissionResponse.class); - when(apiClient.postAsync(eq("payment-sessions/" + paymentId + "/submit"), eq(authorization), eq(SubmitPaymentSessionResponse.class), eq(request), isNull())) - .thenReturn(CompletableFuture.completedFuture(response)); + when(apiClient.postAsync(eq("payment-sessions/" + sessionId + "/submit"), eq(authorization), eq(PaymentSubmissionResponse.class), + eq(request), isNull())) + .thenReturn(CompletableFuture.completedFuture(expectedResponse)); - final CompletableFuture future = client.submitPaymentSessions(paymentId, request); + final CompletableFuture future = client.submitPaymentSession(sessionId, request); + final PaymentSubmissionResponse actualResponse = future.get(); - validateSubmitPaymentSessionResponse(future.get(), response); + validateResponse(expectedResponse, actualResponse); } @Test void shouldRequestPaymentSessionWithPayment() throws ExecutionException, InterruptedException { - final PaymentSessionWithPaymentRequest request = createPaymentSessionWithPaymentRequest(); - final PaymentSessionWithPaymentResponse response = createPaymentSessionWithPaymentResponse(); + final PaymentSessionCompleteRequest request = createMockPaymentSessionCompleteRequest(); + final PaymentSubmissionResponse expectedResponse = mock(PaymentSubmissionResponse.class); - when(apiClient.postAsync(eq("payment-sessions/complete"), eq(authorization), eq(PaymentSessionWithPaymentResponse.class), eq(request), isNull())) - .thenReturn(CompletableFuture.completedFuture(response)); + when(apiClient.postAsync(eq("payment-sessions/complete"), eq(authorization), eq(PaymentSubmissionResponse.class), + eq(request), isNull())) + .thenReturn(CompletableFuture.completedFuture(expectedResponse)); - final CompletableFuture future = client.requestPaymentSessionWithPayment(request); + final CompletableFuture future = client.requestPaymentSessionWithPayment(request); + final PaymentSubmissionResponse actualResponse = future.get(); - validatePaymentSessionWithPaymentResponse(future.get(), response); + validateResponse(expectedResponse, actualResponse); } // Synchronous methods @Test - void shouldRequestPaymentSessionsSync() throws ExecutionException, InterruptedException { - - final PaymentSessionRequest request = createPaymentSessionRequest(); - final PaymentSessionResponse response = createPaymentSessionResponse(); + void shouldRequestPaymentSessionSync() { + final PaymentSessionCreateRequest request = createMockPaymentSessionCreateRequest(); + final PaymentSessionResponse expectedResponse = mock(PaymentSessionResponse.class); when(apiClient.post(eq("payment-sessions"), eq(authorization), eq(PaymentSessionResponse.class), eq(request), isNull())) - .thenReturn(response); + .thenReturn(expectedResponse); - PaymentSessionResponse result = client.requestPaymentSessionSync(request); - - validatePaymentSessionResponse(result, response); + final PaymentSessionResponse actualResponse = client.requestPaymentSessionSync(request); + validateResponse(expectedResponse, actualResponse); } @Test - void shouldSubmitPaymentSessionsSync() throws ExecutionException, InterruptedException { - final String paymentId = "pay_mbabizu24mvu3mela5njyhpit4"; - final SubmitPaymentSessionRequest request = createSubmitPaymentSessionRequest(); - final SubmitPaymentSessionResponse response = createSubmitPaymentSessionResponse(); + void shouldSubmitPaymentSessionSync() { + final String sessionId = "ps_test_123456789"; + final PaymentSessionSubmitRequest request = createMockPaymentSessionSubmitRequest(); + final PaymentSubmissionResponse expectedResponse = mock(PaymentSubmissionResponse.class); - when(apiClient.post(eq("payment-sessions/" + paymentId + "/submit"), eq(authorization), eq(SubmitPaymentSessionResponse.class), + when(apiClient.post(eq("payment-sessions/" + sessionId + "/submit"), eq(authorization), eq(PaymentSubmissionResponse.class), eq(request), isNull())) - .thenReturn(response); + .thenReturn(expectedResponse); - final SubmitPaymentSessionResponse result = client.submitPaymentSessionsSync(paymentId, request); + final PaymentSubmissionResponse actualResponse = client.submitPaymentSessionSync(sessionId, request); - validateSubmitPaymentSessionResponse(result, response); + validateResponse(expectedResponse, actualResponse); } @Test - void shouldRequestPaymentSessionWithPaymentSync() throws ExecutionException, InterruptedException { - final PaymentSessionWithPaymentRequest request = createPaymentSessionWithPaymentRequest(); - final PaymentSessionWithPaymentResponse response = createPaymentSessionWithPaymentResponse(); + void shouldRequestPaymentSessionWithPaymentSync() { + final PaymentSessionCompleteRequest request = createMockPaymentSessionCompleteRequest(); + final PaymentSubmissionResponse expectedResponse = mock(PaymentSubmissionResponse.class); - when(apiClient.post(eq("payment-sessions/complete"), eq(authorization), eq(PaymentSessionWithPaymentResponse.class), + when(apiClient.post(eq("payment-sessions/complete"), eq(authorization), eq(PaymentSubmissionResponse.class), eq(request), isNull())) - .thenReturn(response); + .thenReturn(expectedResponse); - final PaymentSessionWithPaymentResponse result = client.requestPaymentSessionWithPaymentSync(request); + final PaymentSubmissionResponse actualResponse = client.requestPaymentSessionWithPaymentSync(request); - validatePaymentSessionWithPaymentResponse(result, response); + validateResponse(expectedResponse, actualResponse); } // Common methods - private IndividualSender createIndividualSender() { - return IndividualSender.builder() - .firstName("John") - .lastName("Doe") - .address(Address.builder() - .addressLine1("123 Test Street") - .city("London") - .state("London") - .zip("SW1A 1AA") - .country(CountryCode.GB) - .build()) - .identification(Identification.builder() - .type(IdentificationType.DRIVING_LICENCE) - .number("DL123456789") - .issuingCountry("GB") - .build()) - .reference("SENDER-REF-123") - .build(); - } - - private Billing createStandardBilling() { - return Billing.builder() - .address(Address.builder() - .addressLine1("123 High St.") - .addressLine2("Flat 456") - .city("London") - .state("London") - .zip("SW1A 1AA") - .country(CountryCode.GB) - .build()) - .phone(Phone.builder() - .countryCode("+1") - .number("415 555 2671") - .build()) - .build(); - } - - private PaymentSessionRequest createPaymentSessionRequest() { - return mock(PaymentSessionRequest.class); + private void setUpAuthorizationMocks() { + when(sdkCredentials.getAuthorization(SdkAuthorizationType.SECRET_KEY_OR_OAUTH)).thenReturn(authorization); + when(configuration.getSdkCredentials()).thenReturn(sdkCredentials); } - private PaymentSessionResponse createPaymentSessionResponse() { - return mock(PaymentSessionResponse.class); - } - private SubmitPaymentSessionRequest createSubmitPaymentSessionRequest() { - return mock(SubmitPaymentSessionRequest.class); - } - private SubmitPaymentSessionResponse createSubmitPaymentSessionResponse() { - return mock(SubmitPaymentSessionResponse.class); - } - private PaymentSessionWithPaymentRequest createPaymentSessionWithPaymentRequest() { - return mock(PaymentSessionWithPaymentRequest.class); - } - private PaymentSessionWithPaymentResponse createPaymentSessionWithPaymentResponse() { - return mock(PaymentSessionWithPaymentResponse.class); + private PaymentSessionCreateRequest createMockPaymentSessionCreateRequest() { + return mock(PaymentSessionCreateRequest.class); } - private void validatePaymentSessionResponse(PaymentSessionResponse actual, PaymentSessionResponse expected) { - assertNotNull(actual); - assertEquals(expected, actual); + private PaymentSessionSubmitRequest createMockPaymentSessionSubmitRequest() { + return mock(PaymentSessionSubmitRequest.class); } - private void validateSubmitPaymentSessionResponse(SubmitPaymentSessionResponse actual, SubmitPaymentSessionResponse expected) { - assertNotNull(actual); - assertEquals(expected, actual); + private PaymentSessionCompleteRequest createMockPaymentSessionCompleteRequest() { + return mock(PaymentSessionCompleteRequest.class); } - private void validatePaymentSessionWithPaymentResponse(PaymentSessionWithPaymentResponse actual, PaymentSessionWithPaymentResponse expected) { - assertNotNull(actual); - assertEquals(expected, actual); + private void validateResponse(T expectedResponse, T actualResponse) { + assertEquals(expectedResponse, actualResponse); + assertNotNull(actualResponse); } -} +} \ No newline at end of file diff --git a/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowTestIT.java b/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowTestIT.java index 8088a276..973d4134 100644 --- a/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowTestIT.java +++ b/src/test/java/com/checkout/handlepaymentsandpayouts/flow/FlowTestIT.java @@ -2,33 +2,36 @@ import com.checkout.PlatformType; import com.checkout.SandboxTestFixture; +import com.checkout.common.Address; import com.checkout.common.CountryCode; import com.checkout.common.Currency; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.ExemptionType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PanPreferenceType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PurposeType; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.AmountAllocation; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.BillingDescriptor; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.CustomerRetry; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Instruction; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Item; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentMethodConfiguration; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Processing; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Risk; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Shipping; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.InstrumentSender; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses.PaymentSessionResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.PaymentSessionWithPaymentRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses.PaymentSessionWithPaymentResponse; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests.SubmitPaymentSessionRequest; -import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses.SubmitPaymentSessionResponse; +import com.checkout.common.Phone; +import com.checkout.handlepaymentsandpayouts.flow.entities.CardConfiguration; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentMethod; +import com.checkout.handlepaymentsandpayouts.flow.entities.PaymentMethodConfiguration; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCreateRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionSubmitRequest; +import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCompleteRequest; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSessionResponse; +import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; +import com.checkout.payments.BillingDescriptor; +import com.checkout.payments.BillingInformation; +import com.checkout.payments.LocaleType; +import com.checkout.payments.PaymentType; +import com.checkout.payments.ProductRequest; +import com.checkout.payments.RiskRequest; +import com.checkout.payments.StorePaymentDetailsType; +import com.checkout.payments.ThreeDSRequest; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import java.util.Collections; import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; class FlowTestIT extends SandboxTestFixture { @@ -38,239 +41,168 @@ class FlowTestIT extends SandboxTestFixture { } @Test - void shouldMakeAPaymentSessionsRequest() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing billing = createBilling(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.BillingDescriptor billingDescriptor = createBillingDescriptor(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Shipping shipping = createShipping(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Processing processing = createProcessing(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Instruction instruction = createInstruction(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentMethodConfiguration paymentMethodConfiguration = createPaymentMethodConfiguration(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Item item = createItem(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.AmountAllocation amountAllocation = createAmountAllocation(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Risk risk = createRisk(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Threeds threeds = createThreeds(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.InstrumentSender sender = createInstrumentSender(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.CustomerRetry customerRetry = createCustomerRetry(); - - final HashMap metadata = new java.util.HashMap<>(); - metadata.put("coupon_code", "NY2018"); + void shouldCreatePaymentSession() { + // Arrange + final PaymentSessionCreateRequest request = createPaymentSessionCreateRequest(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest request = com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest.builder() - .amount(1000L) - .currency(Currency.USD) - .paymentType(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PaymentType.REGULAR) - .billing(billing) - .billingDescriptor(billingDescriptor) - .reference("ORD-123A") - .description("Payment for gold necklace") - //.customer(customer) - .shipping(shipping) - //.recipient(recipient) - .processing(processing) - .instruction(instruction) - .processingChannelId(System.getenv("CHECKOUT_PROCESSING_CHANNEL_ID")) - .paymentMethodConfiguration(paymentMethodConfiguration) - .items(java.util.Collections.singletonList(item)) - .amountAllocations(java.util.Collections.singletonList(amountAllocation)) - .risk(risk) - .displayName("Company Test") - .successUrl("https://example.com/payments/success") - .failureUrl("https://example.com/payments/failure") - .metadata(metadata) - .locale(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.LocaleType.AR) - .threeds(threeds) - .sender(sender) - .capture(true) - .captureOn(java.time.Instant.parse("2024-01-01T09:15:30Z")) - //.expiresOn(java.time.Instant.parse("2024-01-01T09:15:30Z")) - .enabledPaymentMethods(java.util.Arrays.asList( - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.CARD, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.APPLEPAY, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.GOOGLEPAY)) - .disabledPaymentMethods(java.util.Arrays.asList( - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.EPS, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.IDEAL, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.KNET)) - .customerRetry(customerRetry) - .ipAddress("90.197.169.245") - .build(); + // Act + final CompletableFuture future = + checkoutApi.flowClient().requestPaymentSession(request); + final PaymentSessionResponse response = future.join(); - final PaymentSessionResponse response = blocking(() -> checkoutApi.flowClient().requestPaymentSession(request)); + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getPaymentSessionToken()); + assertNotNull(response.getPaymentSessionSecret()); + } + + @Test + @Disabled("This test requires a valid merchant configuration for Flow") + void shouldSubmitPaymentSession() { + // Arrange + final PaymentSessionCreateRequest createRequest = createPaymentSessionCreateRequest(); + final CompletableFuture createFuture = + checkoutApi.flowClient().requestPaymentSession(createRequest); + final PaymentSessionResponse createResponse = createFuture.join(); - validatePaymentSessionResponse(response); + final PaymentSessionSubmitRequest submitRequest = createPaymentSessionSubmitRequest(); + + // Act + final CompletableFuture submitFuture = + checkoutApi.flowClient().submitPaymentSession(createResponse.getId(), submitRequest); + final PaymentSubmissionResponse response = submitFuture.join(); + + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getStatus()); + assertNotNull(response.getType()); } - @Disabled("Use on demand") @Test - void shouldMakeAPaymentSessionWithPaymentRequest() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Billing billing = createBillingShort(); - - final PaymentSessionWithPaymentRequest request = - PaymentSessionWithPaymentRequest.builder() - .sessionData("session_data_example") - .amount(1000L) - .currency(Currency.GBP) - .reference("ORD-123A") - .billing(billing) - .successUrl("https://example.com/payments/success") - .failureUrl("https://example.com/payments/failure") - .build(); - - final PaymentSessionWithPaymentResponse response = - blocking(() -> checkoutApi.flowClient().requestPaymentSessionWithPayment(request)); - - validatePaymentSessionWithPaymentResponse(response); + @Disabled("This test requires a valid merchant configuration for Flow") + void shouldCompletePaymentSession() { + // Arrange + final PaymentSessionCompleteRequest request = createPaymentSessionCompleteRequest(); + + // Act + final CompletableFuture future = + checkoutApi.flowClient().requestPaymentSessionWithPayment(request); + final PaymentSubmissionResponse response = future.join(); + + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getStatus()); + assertNotNull(response.getType()); } - @Disabled("Use on demand") + // Synchronous methods @Test - void shouldSubmitPaymentSession() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing billing = createBillingShort2(); - final PaymentSessionRequest sessionRequest = PaymentSessionRequest.builder() - .amount(1000L) - .currency(Currency.GBP) - .reference("ORD-123A") - .billing(billing) - .successUrl("https://example.com/payments/success") - .failureUrl("https://example.com/payments/failure") - .build(); + void shouldCreatePaymentSessionSync() { + // Arrange + final PaymentSessionCreateRequest request = createPaymentSessionCreateRequest(); + + // Act + final PaymentSessionResponse response = checkoutApi.flowClient().requestPaymentSessionSync(request); + + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getPaymentSessionToken()); + assertNotNull(response.getPaymentSessionSecret()); + } - final PaymentSessionResponse sessionResponse = blocking(() -> checkoutApi.flowClient().requestPaymentSession(sessionRequest)); - validatePaymentSessionResponseShort(sessionResponse); + @Test + @Disabled("This test requires a valid merchant configuration for Flow") + void shouldSubmitPaymentSessionSync() { + // Arrange + final PaymentSessionCreateRequest createRequest = createPaymentSessionCreateRequest(); + final PaymentSessionResponse createResponse = checkoutApi.flowClient().requestPaymentSessionSync(createRequest); - final SubmitPaymentSessionRequest submitRequest = - SubmitPaymentSessionRequest.builder() - .sessionData("session_data_example") - .amount(1000L) - .reference("ORD-123A") - .ipAddress("90.197.169.245") - .build(); + final PaymentSessionSubmitRequest submitRequest = createPaymentSessionSubmitRequest(); - final SubmitPaymentSessionResponse submitResponse = - blocking(() -> checkoutApi.flowClient().submitPaymentSessions(sessionResponse.getId(), submitRequest)); + // Act + final PaymentSubmissionResponse response = checkoutApi.flowClient().submitPaymentSessionSync(createResponse.getId(), submitRequest); - validateSubmitPaymentSessionResponse(submitResponse); + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getStatus()); + assertNotNull(response.getType()); } - // Synchronous methods @Test - void shouldMakeAPaymentSessionsRequestSync() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing billing = createBilling(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.BillingDescriptor billingDescriptor = createBillingDescriptor(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Shipping shipping = createShipping(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Processing processing = createProcessing(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Instruction instruction = createInstruction(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentMethodConfiguration paymentMethodConfiguration = createPaymentMethodConfiguration(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Item item = createItem(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.AmountAllocation amountAllocation = createAmountAllocation(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Risk risk = createRisk(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Threeds threeds = createThreeds(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.InstrumentSender sender = createInstrumentSender(); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.CustomerRetry customerRetry = createCustomerRetry(); - - final HashMap metadata = new java.util.HashMap<>(); - metadata.put("coupon_code", "NY2018"); + @Disabled("This test requires a valid merchant configuration for Flow") + void shouldCompletePaymentSessionSync() { + // Arrange + final PaymentSessionCompleteRequest request = createPaymentSessionCompleteRequest(); + + // Act + final PaymentSubmissionResponse response = checkoutApi.flowClient().requestPaymentSessionWithPaymentSync(request); - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest request = com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest.builder() + // Assert + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getStatus()); + assertNotNull(response.getType()); + } + + // Common methods + private PaymentSessionCreateRequest createPaymentSessionCreateRequest() { + return PaymentSessionCreateRequest.builder() .amount(1000L) .currency(Currency.USD) - .paymentType(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.PaymentType.REGULAR) - .billing(billing) - .billingDescriptor(billingDescriptor) + .paymentType(PaymentType.REGULAR) .reference("ORD-123A") .description("Payment for gold necklace") - //.customer(customer) - .shipping(shipping) - //.recipient(recipient) - .processing(processing) - .instruction(instruction) - .processingChannelId(System.getenv("CHECKOUT_PROCESSING_CHANNEL_ID")) - .paymentMethodConfiguration(paymentMethodConfiguration) - .items(java.util.Collections.singletonList(item)) - .amountAllocations(java.util.Collections.singletonList(amountAllocation)) - .risk(risk) .displayName("Company Test") + .processingChannelId(System.getenv("CHECKOUT_PROCESSING_CHANNEL_ID")) .successUrl("https://example.com/payments/success") .failureUrl("https://example.com/payments/failure") - .metadata(metadata) - .locale(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.LocaleType.AR) - .threeds(threeds) - .sender(sender) + .billing(createBillingInformation()) + .billingDescriptor(createBillingDescriptor()) + .risk(createRiskRequest()) + .threeDS(createThreeDSRequest()) .capture(true) - .captureOn(java.time.Instant.parse("2024-01-01T09:15:30Z")) - //.expiresOn(java.time.Instant.parse("2024-01-01T09:15:30Z")) - .enabledPaymentMethods(java.util.Arrays.asList( - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.CARD, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.APPLEPAY, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.EnabledPaymentMethodsType.GOOGLEPAY)) - .disabledPaymentMethods(java.util.Arrays.asList( - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.EPS, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.IDEAL, - com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.DisabledPaymentMethodsType.KNET)) - .customerRetry(customerRetry) - .ipAddress("90.197.169.245") + .locale(LocaleType.EN_GB) + .enabledPaymentMethods(Collections.singletonList(PaymentMethod.CARD)) + .paymentMethodConfiguration(createPaymentMethodConfiguration()) .build(); - - final PaymentSessionResponse response = checkoutApi.flowClient().requestPaymentSessionSync(request); - - validatePaymentSessionResponse(response); } - @Disabled("Use on demand") - @Test - void shouldMakeAPaymentSessionWithPaymentRequestSync() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Billing billing = createBillingShort(); - - final PaymentSessionWithPaymentRequest request = - PaymentSessionWithPaymentRequest.builder() - .sessionData("session_data_example") - .amount(1000L) - .currency(Currency.GBP) - .reference("ORD-123A") - .billing(billing) - .successUrl("https://example.com/payments/success") - .failureUrl("https://example.com/payments/failure") - .build(); - - final PaymentSessionWithPaymentResponse response = checkoutApi.flowClient().requestPaymentSessionWithPaymentSync(request); - - validatePaymentSessionWithPaymentResponse(response); + private PaymentSessionSubmitRequest createPaymentSessionSubmitRequest() { + return PaymentSessionSubmitRequest.builder() + .sessionData("encrypted_session_data") + .ipAddress("192.168.1.1") + .build(); } - @Disabled("Use on demand") - @Test - void shouldSubmitPaymentSessionSync() { - final com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing billing = createBillingShort2(); - final PaymentSessionRequest sessionRequest = PaymentSessionRequest.builder() + private PaymentSessionCompleteRequest createPaymentSessionCompleteRequest() { + return PaymentSessionCompleteRequest.builder() .amount(1000L) - .currency(Currency.GBP) - .reference("ORD-123A") - .billing(billing) + .currency(Currency.USD) + .paymentType(PaymentType.REGULAR) + .reference("ORD-5023-4E89") + .description("Payment for gold necklace") + .displayName("Company Test") + .processingChannelId(System.getenv("CHECKOUT_PROCESSING_CHANNEL_ID")) .successUrl("https://example.com/payments/success") .failureUrl("https://example.com/payments/failure") + .billing(createBillingInformation()) + .billingDescriptor(createBillingDescriptor()) + .risk(createRiskRequest()) + .threeDS(createThreeDSRequest()) + .capture(true) + .locale(LocaleType.EN_GB) + .sessionData("encrypted_session_data") .build(); - - final PaymentSessionResponse sessionResponse = checkoutApi.flowClient().requestPaymentSessionSync(sessionRequest); - validatePaymentSessionResponseShort(sessionResponse); - - final SubmitPaymentSessionRequest submitRequest = - SubmitPaymentSessionRequest.builder() - .sessionData("session_data_example") - .amount(1000L) - .reference("ORD-123A") - .ipAddress("90.197.169.245") - .build(); - - final SubmitPaymentSessionResponse submitResponse = - checkoutApi.flowClient().submitPaymentSessionsSync(sessionResponse.getId(), submitRequest); - - validateSubmitPaymentSessionResponse(submitResponse); } - // Common methods - private Billing createBilling() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing.builder() - .address(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address.builder() + private BillingInformation createBillingInformation() { + return BillingInformation.builder() + .address(Address.builder() .addressLine1("123 High St.") .addressLine2("Flat 456") .city("London") @@ -278,184 +210,187 @@ private Billing createBilling() { .zip("SW1A 1AA") .country(CountryCode.GB) .build()) - .phone(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Phone.builder() + .phone(Phone.builder() .countryCode("+1") .number("415 555 2671") .build()) .build(); } - private com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Billing createBillingShort() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Billing.builder() - .address(com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.Address.builder() - .addressLine1("23 High St.") - .addressLine2("Flat 456") - .city("London") - .state("str") - .zip("SW1A 1AA") - .country(CountryCode.GB) - .build()) - .build(); - } - - private com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing createBillingShort2() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Billing.builder() - .address(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address.builder() - .addressLine1("23 High St.") - .addressLine2("Flat 456") - .city("London") - .state("str") - .zip("SW1A 1AA") - .country(CountryCode.GB) - .build()) - .build(); - } - private BillingDescriptor createBillingDescriptor() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.BillingDescriptor.builder() - .name("string") - .city("string") - .reference("string") + return BillingDescriptor.builder() + .name("Company Test") + .city("London") + .reference(UUID.randomUUID().toString()) .build(); } - private Shipping createShipping() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Shipping.builder() - .address(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Address.builder() - .addressLine1("123 High St.") - .addressLine2("Flat 456") - .city("London") - .state("str") - .zip("SW1A 1AA") - .country(CountryCode.GB) - .build()) - .phone(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Phone.builder() - .countryCode("+1") - .number("415 555 2671") - .build()) - .build(); - } - - private Processing createProcessing() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Processing.builder() - .aft(true) - .discountAmount(0.0) - .shippingAmount(300.0) - .taxAmount(3000.0) - .invoiceId("string") - .brandName("string") - .locale("en-US") - .orderId("123456789") - .surchargeAmount(200L) - .dutyAmount(0.0) - .shippingTaxAmount(100.0) - .merchantInitiatedReason(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.MerchantInitiatedReasonType.DELAYED_CHARGE) - .campaignId(0L) - .originalOrderAmount(10.0) - .receiptId("10") - .merchantCallbackUrl("string") - .lineOfBusiness("Flights") - .panPreference(PanPreferenceType.FPAN) - .provisionNetworkToken(true) + private RiskRequest createRiskRequest() { + return RiskRequest.builder() + .enabled(false) .build(); } - private Instruction createInstruction() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Instruction.builder() - .purpose(PurposeType.DONATIONS) + private ThreeDSRequest createThreeDSRequest() { + return ThreeDSRequest.builder() + .enabled(false) .build(); } private PaymentMethodConfiguration createPaymentMethodConfiguration() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentMethodConfiguration.builder().build(); + final CardConfiguration cardConfiguration = new CardConfiguration(); + cardConfiguration.setStorePaymentDetails(StorePaymentDetailsType.ENABLED); + + return PaymentMethodConfiguration.builder() + .card(cardConfiguration) + .build(); } - private Item createItem() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Item.builder() + private ProductRequest createProductRequest() { + return ProductRequest.builder() .reference("string") - .commodityCode("string") - .unitOfMeasure("string") - .totalAmount(1000L) - .taxAmount(1000L) - .discountAmount(1000L) - .url("string") - .imageUrl("string") .name("Gold Necklace") .quantity(1L) .unitPrice(1000L) .build(); } - private AmountAllocation createAmountAllocation() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.AmountAllocation.builder() - .id("string") - .amount(1L) - .reference("ORD-123A") - .commission(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Commission.builder() - .amount(10L) - .percentage(12.5) - .build()) - .build(); - } - - private Risk createRisk() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Risk.builder() - .enabled(false) - .build(); - } - - private com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Threeds createThreeds() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.Threeds.builder() - .enabled(false) - .attemptN3d(false) - .challengeIndicator(com.checkout.handlepaymentsandpayouts.flow.paymentsessions.enums.ChallengeIndicatorType.NO_PREFERENCE) - .exemption(ExemptionType.LOW_VALUE) - .allowUpgrade(true) - .build(); - } - - private InstrumentSender createInstrumentSender() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.sender.InstrumentSender.builder() - .reference("8285282045818") - .build(); - } - private CustomerRetry createCustomerRetry() { - return com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.CustomerRetry.builder() - .maxAttempts(2L) - .build(); + private Map createMetadata() { + final Map metadata = new HashMap<>(); + metadata.put("coupon_code", "NY2018"); + return metadata; } - private void validatePaymentSessionResponseShort(final PaymentSessionResponse response) { - assertNotNull(response); - assertNotNull(response.getId()); + private String randomString(int length) { + return UUID.randomUUID().toString().substring(0, length); } - private void validatePaymentSessionResponse(final PaymentSessionResponse response) { - validatePaymentSessionResponseShort(response); - assertNotNull(response.getPaymentSessionToken()); - assertNotNull(response.getPaymentSessionSecret()); - assertNotNull(response.getLinks()); + @Test + void paymentSessionCreateRequest_shouldHaveAllRequiredPropertiesForJsonCompatibility() { + // This test validates that PaymentSessionCreateRequest has the necessary properties + // to be compatible with the comprehensive JSON structure from the API documentation + final PaymentSessionCreateRequest request = new PaymentSessionCreateRequest(); + + // Validate that all major property groups from the JSON are available: + + // Basic properties from PaymentSessionBase + request.setAmount(1000L); + request.setReference("ORD-123A"); + request.setPaymentType(PaymentType.REGULAR); + request.setItems(Collections.singletonList(createProductRequest())); + request.setThreeDS(createThreeDSRequest()); + + // Properties from PaymentSessionInfo + request.setCurrency(Currency.USD); + request.setDescription("Payment for gold necklace"); + request.setBillingDescriptor(createBillingDescriptor()); + request.setBilling(createBillingInformation()); + request.setSuccessUrl("https://example.com/success"); + request.setFailureUrl("https://example.com/failure"); + request.setMetadata(createMetadata()); + request.setLocale(LocaleType.AR); + request.setDisplayName("Test Payment"); + request.setProcessingChannelId("pc_123"); + request.setCapture(true); + request.setRisk(createRiskRequest()); + + // Properties specific to PaymentSessionCreateRequest + request.setEnabledPaymentMethods(Collections.singletonList(PaymentMethod.CARD)); + request.setDisabledPaymentMethods(Collections.singletonList(PaymentMethod.EPS)); + request.setPaymentMethodConfiguration(createPaymentMethodConfiguration()); + request.setIpAddress("127.0.0.1"); + + // Assertions to ensure the object is properly constructed + assertNotNull(request); + assertEquals(1000L, request.getAmount()); + assertEquals(Currency.USD, request.getCurrency()); + assertEquals("ORD-123A", request.getReference()); + assertEquals("Payment for gold necklace", request.getDescription()); + assertNotNull(request.getBilling()); + assertNotNull(request.getPaymentMethodConfiguration()); + assertEquals("127.0.0.1", request.getIpAddress()); } - private void validatePaymentSessionWithPaymentResponse(final PaymentSessionWithPaymentResponse response) { - assertNotNull(response); - assertNotNull(response.getId()); - assertNotNull(response.getStatus()); - assertNotNull(response.getType()); - assertNotNull(response.getPaymentSessionId()); - assertNotNull(response.getPaymentSessionSecret()); - if (response.getHttpStatusCode() == 202) { - assertNotNull(response.getAction()); - } + @Test + void paymentSessionSubmitRequest_shouldHaveAllRequiredPropertiesForJsonCompatibility() { + // This test validates that PaymentSessionSubmitRequest has the necessary properties + // to be compatible with the submit JSON structure from the API documentation + final PaymentSessionSubmitRequest request = new PaymentSessionSubmitRequest(); + + // PaymentSessionSubmitRequest specific properties + request.setSessionData("string"); + request.setIpAddress("90.197.169.245"); + + // Basic properties from PaymentSessionBase (inherited) + request.setAmount(1000L); + request.setReference("ORD-123A"); + request.setItems(Collections.singletonList(createProductRequest())); + request.setThreeDS(createThreeDSRequest()); + request.setPaymentType(PaymentType.REGULAR); + + // Assertions to verify all properties from the JSON can be assigned + assertNotNull(request); + assertEquals("string", request.getSessionData()); + assertEquals("90.197.169.245", request.getIpAddress()); + assertEquals(1000L, request.getAmount()); + assertEquals("ORD-123A", request.getReference()); + assertNotNull(request.getItems()); + assertEquals(1, request.getItems().size()); + assertEquals("Gold Necklace", request.getItems().get(0).getName()); + assertNotNull(request.getThreeDS()); + assertEquals(false, request.getThreeDS().getEnabled()); + assertEquals(PaymentType.REGULAR, request.getPaymentType()); } - private void validateSubmitPaymentSessionResponse(final SubmitPaymentSessionResponse submitResponse) { - assertNotNull(submitResponse); - assertNotNull(submitResponse.getId()); - assertNotNull(submitResponse.getStatus()); - assertNotNull(submitResponse.getType()); - if (submitResponse.getHttpStatusCode() == 202) { - assertNotNull(submitResponse.getAction()); - } + @Test + void paymentSessionCompleteRequest_shouldHaveAllRequiredPropertiesForJsonCompatibility() { + // This test validates that PaymentSessionCompleteRequest has the necessary properties + // to be compatible with the complete JSON structure from the API documentation + final PaymentSessionCompleteRequest request = new PaymentSessionCompleteRequest(); + + // PaymentSessionCompleteRequest specific property + request.setSessionData("string"); + + // Properties from PaymentSessionBase (inherited through PaymentSessionInfo) + request.setAmount(1000L); + request.setReference("ORD-123A"); + request.setItems(Collections.singletonList(createProductRequest())); + request.setThreeDS(createThreeDSRequest()); + request.setPaymentType(PaymentType.REGULAR); + + // Properties from PaymentSessionInfo (inherited) + request.setCurrency(Currency.USD); + request.setBilling(createBillingInformation()); + request.setBillingDescriptor(createBillingDescriptor()); + request.setDescription("Payment for gold necklace"); + request.setSuccessUrl("https://example.com/payments/success"); + request.setFailureUrl("https://example.com/payments/failure"); + request.setMetadata(createMetadata()); + request.setLocale(LocaleType.AR); + request.setDisplayName("string"); + request.setProcessingChannelId("string"); + request.setRisk(createRiskRequest()); + request.setCapture(true); + + // Assertions to verify all properties from the JSON can be assigned + assertNotNull(request); + assertEquals("string", request.getSessionData()); + assertEquals(1000L, request.getAmount()); + assertEquals(Currency.USD, request.getCurrency()); + assertEquals(PaymentType.REGULAR, request.getPaymentType()); + assertNotNull(request.getBilling()); + assertNotNull(request.getBillingDescriptor()); + assertEquals("ORD-123A", request.getReference()); + assertEquals("Payment for gold necklace", request.getDescription()); + assertEquals("string", request.getProcessingChannelId()); + assertEquals(1, request.getItems().size()); + assertNotNull(request.getRisk()); + assertEquals("string", request.getDisplayName()); + assertEquals("https://example.com/payments/success", request.getSuccessUrl()); + assertEquals("https://example.com/payments/failure", request.getFailureUrl()); + assertEquals(1, request.getMetadata().size()); + assertEquals(LocaleType.AR, request.getLocale()); + assertNotNull(request.getThreeDS()); + assertEquals(true, request.getCapture()); } } \ No newline at end of file