From e48ee9ed49ea8153041a6b48eb8c782caa688cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:24:03 +0200 Subject: [PATCH 01/10] chore: ignore IDE tooling files and directories Add .claude/, CLAUDE.md, and .github/copilot-instructions.md to gitignore so local IDE and assistant configuration does not leak into the repo. --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 70935fdb..c737ee92 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,8 @@ lombok.config .vscode/ .cursor .github/SKILL.md +.github/copilot-instructions.md swagger-spec.json -swagger.* \ No newline at end of file +swagger.* +.claude/ +CLAUDE.md From ef2dd74884e5a707c2459dc6e1ea3e303613f578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:24:24 +0200 Subject: [PATCH 02/10] feat(disputes): add missing fields from swagger review - Dispute: resolvedReason, isCeCandidate, processingChannel, segmentId - CompellingEvidence: deviceId - DisputeRelevantEvidence: PROOF_OF_DELIVERY_OR_SERVICE_DATE, COMPELLING_EVIDENCE --- .../checkout/disputes/CompellingEvidence.java | 50 +++++++++ .../java/com/checkout/disputes/Dispute.java | 101 +++++++++++++++++- .../disputes/DisputeRelevantEvidence.java | 6 ++ 3 files changed, 156 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/checkout/disputes/CompellingEvidence.java b/src/main/java/com/checkout/disputes/CompellingEvidence.java index 3a9cbf81..d0472df5 100644 --- a/src/main/java/com/checkout/disputes/CompellingEvidence.java +++ b/src/main/java/com/checkout/disputes/CompellingEvidence.java @@ -7,30 +7,80 @@ public final class CompellingEvidence { + /** + * Whether the evidence concerns merchandise or services. + * [Required] + * Enum: "Merchandise" "Services" + */ @SerializedName("merchandise_or_service") private String merchandiseOrService; + /** + * A description of the merchandise or service provided. + * [Required] + * min 1 character, max 5000 characters + */ @SerializedName("merchandise_or_service_desc") private String merchandiseOrServiceDesc; + /** + * The date the merchandise or service was provided to the customer. + * [Required] + * Format: date-time (RFC 3339) + */ @SerializedName("merchandise_or_service_provided_date") private Instant merchandiseOrServiceProvidedDate; + /** + * The shipping or delivery status of the merchandise. + * [Optional] + */ @SerializedName("shipping_delivery_status") private ShippingDeliveryStatusType shippingDeliveryStatus; + /** + * The tracking number for the shipment. + * [Optional] + * max 50 characters + */ @SerializedName("tracking_information") private TrackingInformationType trackingInformation; + /** + * The customer's account or login identifier. + * [Optional] + * max 50 characters + */ @SerializedName("user_id") private String userId; + /** + * The IP address used for the transaction (IPv4 or IPv6). + * [Optional] + */ @SerializedName("ip_address") private String ipAddress; + /** + * The device identifier used for the transaction. + * [Optional] + * min 15 characters, max 64 characters + */ + @SerializedName("device_id") + private String deviceId; + + /** + * The shipping address used for the transaction. + * [Optional] + */ @SerializedName("shipping_address") private ShippingAddress shippingAddress; + /** + * Prior undisputed transactions between the merchant and the same customer. + * At least 2 items required. + * [Required] + */ @SerializedName("historical_transactions") private List historicalTransactions; diff --git a/src/main/java/com/checkout/disputes/Dispute.java b/src/main/java/com/checkout/disputes/Dispute.java index df315f29..be2c4d1d 100644 --- a/src/main/java/com/checkout/disputes/Dispute.java +++ b/src/main/java/com/checkout/disputes/Dispute.java @@ -16,53 +16,152 @@ @EqualsAndHashCode(callSuper = false) public final class Dispute extends Resource { + /** + * The dispute identifier. + * [Optional] + * ^(dsp)_(\w{22,26})$ + */ private String id; + /** + * The reason for the dispute. + * [Optional] + */ private DisputeCategory category; + /** + * The current status of the dispute. + * [Optional] + */ private DisputeStatus status; + /** + * The disputed amount in the processing currency. + * [Optional] + */ private Long amount; + /** + * The processing currency. + * [Optional] + */ private Currency currency; + /** + * The card scheme reason code for the dispute. + * [Optional] + */ @SerializedName("reason_code") private String reasonCode; + /** + * The payment identifier. + * [Optional] + */ @SerializedName("payment_id") private String paymentId; + /** + * The payment action identifier. + * [Optional] + */ @SerializedName("payment_action_id") private String paymentActionId; + /** + * The payment reference or order ID. + * [Optional] + */ @SerializedName("payment_reference") private String paymentReference; + /** + * The acquirer reference number for the payment. + * [Optional] + */ @SerializedName("payment_arn") private String paymentArn; + /** + * The payment method or card scheme. + * [Optional] + */ @SerializedName("payment_method") private String paymentMethod; + /** + * The deadline by which evidence must be submitted. + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("evidence_required_by") private Instant evidenceRequiredBy; + /** + * The date and time the dispute was issued. + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("received_on") private Instant receivedOn; + /** + * The date and time of the last update to the dispute. + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("last_update") private Instant lastUpdate; /** - * Not available on Previous + * The reason the dispute was automatically resolved. + * [Optional] + * Enum: "rapid_dispute_resolution" "negative_amount" "already_refunded" */ + @SerializedName("resolved_reason") + private DisputeResolvedReason resolvedReason; + /** + * Whether the dispute is eligible for Visa Compelling Evidence 3.0. + * [Optional] + */ + @SerializedName("is_ce_candidate") + private Boolean isCeCandidate; + + // Not available on Previous API + + /** + * The client entity linked to this dispute. + * [Optional] + */ @SerializedName("entity_id") private String entityId; + /** + * The sub-entity linked to this dispute. + * [Optional] + */ @SerializedName("sub_entity_id") private String subEntityId; + /** + * The processing channel linked to this dispute. + * [Optional] + */ + @SerializedName("processing_channel") + private String processingChannel; + + /** + * The business segment identifier. + * [Optional] + */ + @SerializedName("segment_id") + private String segmentId; + + /** + * The merchant category code for the payment. + * [Optional] + */ @SerializedName("payment_mcc") private String paymentMcc; diff --git a/src/main/java/com/checkout/disputes/DisputeRelevantEvidence.java b/src/main/java/com/checkout/disputes/DisputeRelevantEvidence.java index 067cd558..43a85bbe 100644 --- a/src/main/java/com/checkout/disputes/DisputeRelevantEvidence.java +++ b/src/main/java/com/checkout/disputes/DisputeRelevantEvidence.java @@ -25,6 +25,12 @@ public enum DisputeRelevantEvidence { @SerializedName("additional_evidence") ADDITIONAL_EVIDENCE, + @SerializedName("proof_of_delivery_or_service_date") + PROOF_OF_DELIVERY_OR_SERVICE_DATE, + + @SerializedName("compelling_evidence") + COMPELLING_EVIDENCE, + @SerializedName("arbitration_no_review") ARBITRATION_NO_REVIEW, From 8bb78261f543762ff75e12e60d826885e057dd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:24:38 +0200 Subject: [PATCH 03/10] feat(issuing): update card shipping instruction fields Align ShippingInstruction with current swagger schema for issuing cards. --- .../requests/create/ShippingInstruction.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java b/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java index ec003f8c..3f727378 100644 --- a/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java +++ b/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java @@ -9,12 +9,28 @@ @Builder public final class ShippingInstruction { + /** + * The name of the person the card will be shipped to. + * [Optional] + * @deprecated No longer supported. + */ + @Deprecated @SerializedName("shipping_recipient") private String shippingRecipient; + /** + * The address to ship the physical card to. + * [Optional] + */ @SerializedName("shipping_address") private Address shippingAddress; + /** + * Any additional comment on shipping. + * [Optional] + * @deprecated No longer supported. + */ + @Deprecated @SerializedName("additional_comment") private String additionalComment; -} \ No newline at end of file +} From 6594c619ff12ef166ff20a860882d17f46415656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:24:51 +0200 Subject: [PATCH 04/10] feat(payment-contexts): add metadata and accommodation phone fields - PaymentContexts/PaymentContextsRequest: add metadata (Map) - PaymentContextsAccommodationData: add propertyPhone and customerServicePhone (List) per 2026-01-30 changelog --- .../payments/contexts/PaymentContexts.java | 74 +++++++++++++++++++ .../PaymentContextsAccommodationData.java | 15 ++++ .../contexts/PaymentContextsRequest.java | 10 ++- 3 files changed, 97 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContexts.java b/src/main/java/com/checkout/payments/contexts/PaymentContexts.java index 4cd4538a..0fcfdf32 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContexts.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContexts.java @@ -9,42 +9,116 @@ import lombok.NoArgsConstructor; import java.util.List; +import java.util.Map; @Data @AllArgsConstructor @NoArgsConstructor public class PaymentContexts { + /** + * The payment amount in minor currency units. + * [Required] + * min 0 + */ private Long amount; + /** + * The three-letter ISO currency code. + * [Required] + * min 3 characters, max 3 characters + */ private Currency currency; + /** + * Must be "Recurring" if the payment is paid in multiple installments. + * [Optional] + * Enum: "Regular" "Recurring" + */ @SerializedName("payment_type") private PaymentType paymentType; + /** + * The authorization type for the payment. + * [Optional] + */ @SerializedName("authorization_type") private String authorizationType; + /** + * Whether to capture the later payment. + * [Optional] + */ private Boolean capture; + /** + * The customer details. Required if source.type is StcPay or Tabby. + * [Optional] + */ private PaymentContextsCustomerRequest customer; + /** + * The shipping details. + * [Optional] + */ private ShippingDetails shipping; + /** + * Use the processing object to influence or override the data during payment processing. + * [Optional] + */ private PaymentContextsProcessing processing; + /** + * The processing channel to be used for the payment. + * [Optional] + * Pattern: ^(pc)_(\w{26})$ + */ @SerializedName("processing_channel_id") private String processingChannelId; + /** + * A reference you can later use to identify this Payment Context, such as an order number. + * [Optional] + * max 50 characters + */ private String reference; + /** + * A description of the Payment Context. + * [Optional] + * max 100 characters + */ private String description; + /** + * For redirect payment methods, this overrides the default success redirect URL configured on your account. + * [Optional] + * Format: uri + * max 1024 characters + */ @SerializedName("success_url") private String successUrl; + /** + * For redirect payment methods, this overrides the default failure redirect URL configured on your account. + * [Optional] + * Format: uri + * max 1024 characters + */ @SerializedName("failure_url") private String failureUrl; + /** + * The order's line items. Required for Klarna payments. + * [Optional] + */ private List items; + + /** + * A set of key-value pairs to store additional information about the transaction. + * Up to 20 fields, max 255 characters per value. + * [Optional] + */ + private Map metadata; } diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java index 63390f11..e2847c17 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java @@ -2,6 +2,7 @@ import com.checkout.common.Address; import com.checkout.common.CountryCode; +import com.checkout.common.Phone; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; @@ -90,4 +91,18 @@ public final class PaymentContextsAccommodationData { */ @SerializedName("room") private List room; + + /** + * The property's phone information. + * [Optional] + */ + @SerializedName("property_phone") + private List propertyPhone; + + /** + * The customer service phone information. + * [Optional] + */ + @SerializedName("customer_service_phone") + private List customerServicePhone; } diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsRequest.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsRequest.java index 60406925..211705bf 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContextsRequest.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsRequest.java @@ -11,6 +11,7 @@ import lombok.ToString; import java.util.List; +import java.util.Map; @Data @ToString(callSuper = true) @@ -18,6 +19,10 @@ @NoArgsConstructor public final class PaymentContextsRequest extends PaymentContexts { + /** + * The source of the payment. Discriminated by type: klarna, paypal, stcpay, tabby. + * [Required] + */ private AbstractRequestSource source; @Builder @@ -36,10 +41,11 @@ private PaymentContextsRequest( final String failureUrl, final List items, final String authorizationType, - final PaymentContextsCustomerRequest customer + final PaymentContextsCustomerRequest customer, + final Map metadata ) { super(amount, currency, paymentType, authorizationType, capture, customer, shipping, processing, - processingChannelId, reference, description, successUrl, failureUrl, items); + processingChannelId, reference, description, successUrl, failureUrl, items, metadata); this.source = source; } } From 807c289d2ab1c250e23f6f1ef92f05f60e08d5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:25:57 +0200 Subject: [PATCH 05/10] feat(payment-sessions): sync flow entities and requests with swagger Update PaymentSession flow classes (entities, requests, responses) to reflect the current swagger spec for /payment-sessions endpoints. --- .../flow/entities/ApplePayConfiguration.java | 3 +- .../flow/entities/Customer.java | 21 +++++++++-- .../flow/entities/CustomerRetry.java | 3 +- .../flow/entities/GooglePayConfiguration.java | 3 +- .../flow/entities/PaymentAction.java | 11 +++--- .../entities/PaymentMethodConfiguration.java | 6 +++- .../PaymentMethodConfigurationBase.java | 4 ++- .../entities/StoredCardConfiguration.java | 5 ++- .../flow/requests/PaymentSessionBase.java | 11 ++++-- .../PaymentSessionCompleteRequest.java | 6 ++-- .../requests/PaymentSessionCreateRequest.java | 10 +++++- .../flow/requests/PaymentSessionInfo.java | 36 +++++++++++++++---- .../requests/PaymentSessionSubmitRequest.java | 9 +++-- ...tionRequiredPaymentSubmissionResponse.java | 7 ++-- .../ApprovedPaymentSubmissionResponse.java | 6 ++-- .../DeclinedPaymentSubmissionResponse.java | 3 +- .../responses/PaymentSessionResponse.java | 7 ++-- .../responses/PaymentSubmissionResponse.java | 5 ++- 18 files changed, 122 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java index 3063fe1d..f4c2af1f 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java @@ -18,7 +18,8 @@ public final class ApplePayConfiguration extends PaymentMethodConfigurationBase /** * The type of the Apple Pay payment total line item. Default: "final" + * [Optional] */ @Builder.Default private TotalType totalType = TotalType.FINAL; -} \ 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 index 20e9337d..dea1bda3 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java @@ -20,31 +20,37 @@ public final class Customer { /** * The customer's email address. Required if source.type is tamara. + * [Optional] */ private String email; /** * The customer's name. Required if source.type is tamara. + * [Optional] */ private String name; /** * The unique identifier for an existing customer. + * [Optional] */ private String id; /** * The customer's phone number. Required if source.type is tamara. + * [Optional] */ private Phone phone; /** * The customer's value-added tax (VAT) registration number. + * [Optional] */ private String taxNumber; /** - * Summary of the customer's transaction history. Used for risk assessment when source.type is Tamara + * Summary of the customer's transaction history. Used for risk assessment when source.type is Tamara. + * [Optional] */ private CustomerSummary summary; @@ -59,36 +65,46 @@ public static class CustomerSummary { /** * The date the customer registered. + * [Optional] + * Format: yyyy-MM-dd */ private LocalDate registrationDate; /** * The date of the customer's first transaction. + * [Optional] + * Format: yyyy-MM-dd */ private LocalDate firstTransactionDate; /** * The date of the customer's last payment. + * [Optional] + * Format: yyyy-MM-dd */ private LocalDate lastPaymentDate; /** * The total number of orders made by the customer. + * [Optional] */ private Integer totalOrderCount; /** * The amount of the customer's last payment. + * [Optional] */ private Double lastPaymentAmount; /** * Specifies whether the customer is a premium customer. + * [Optional] */ private Boolean isPremiumCustomer; /** * Specifies whether the customer is a returning customer. + * [Optional] */ private Boolean isReturningCustomer; @@ -96,7 +112,8 @@ public static class CustomerSummary { * 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. + * [Optional] */ 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 index 19bae096..bcc2384e 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CustomerRetry.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CustomerRetry.java @@ -16,7 +16,8 @@ public final class CustomerRetry { /** * The maximum number of authorization retry attempts, excluding the initial authorization. Default: 5 + * [Optional] */ @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 index 35f44157..b7b32739 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/GooglePayConfiguration.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/GooglePayConfiguration.java @@ -18,7 +18,8 @@ public final class GooglePayConfiguration extends PaymentMethodConfigurationBase /** * The status of the Google Pay payment total price. Default: "final" + * [Optional] */ @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 index f55572d1..e98ff447 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentAction.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentAction.java @@ -15,17 +15,20 @@ public final class PaymentAction { /** - * The type of action required + * The type of action required. + * [Optional] */ private String type; /** - * A URL the customer should be redirected to for further action (if type requires redirect) + * A URL the customer should be redirected to for further action (if type requires redirect). + * [Optional] */ private String url; /** - * Additional data needed for the action + * Additional data needed for the action. + * [Optional] */ private Object data; -} \ 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 index a606d8e7..cbfed282 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfiguration.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfiguration.java @@ -17,23 +17,27 @@ public final class PaymentMethodConfiguration { /** * Configuration options specific to Apple Pay payments. + * [Optional] */ @SerializedName("applepay") private ApplePayConfiguration applePay; /** * Configuration options specific to card payments. + * [Optional] */ private CardConfiguration card; /** * Configuration options specific to Google Pay payments. + * [Optional] */ @SerializedName("googlepay") private GooglePayConfiguration googlePay; /** * Configuration options specific to stored card payments. + * [Optional] */ 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 index bcd97556..7585c8f5 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfigurationBase.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/PaymentMethodConfigurationBase.java @@ -16,11 +16,13 @@ public abstract class PaymentMethodConfigurationBase { /** * Specifies whether you intend to store the cardholder's payment details. Default: "disabled" + * [Optional] */ private StorePaymentDetailsType storePaymentDetails = StorePaymentDetailsType.DISABLED; /** * The account holder's details. + * [Optional] */ private AccountHolder accountHolder; -} \ 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 index 9a0dcd3b..aba2ec92 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/StoredCardConfiguration.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/StoredCardConfiguration.java @@ -18,16 +18,19 @@ public final class StoredCardConfiguration { /** * The unique identifier for an existing customer. + * [Optional] */ private String customerId; /** * The unique identifiers for card Instruments. + * [Optional] */ private List instrumentIds; /** * The unique identifier for the payment instrument to present to the customer as the default option. + * [Optional] */ private String defaultInstrumentId; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java index ef875254..4330cee3 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionBase.java @@ -25,31 +25,38 @@ 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). + * [Optional] + * min 0 */ 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. + * [Optional] */ private String reference; /** * The line items in the order. + * [Optional] */ private List items; /** * Information required for 3D Secure authentication payments. + * [Optional] */ @SerializedName("3ds") private ThreeDSRequest threeDS; /** * Must be specified for card-not-present (CNP) payments. Default: "Regular" + * [Optional] + * Enum: "Regular" "Recurring" "MOTO" "Installment" "PayLater" "Unscheduled" */ @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 index 78ceac75..4f5c8eec 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCompleteRequest.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCompleteRequest.java @@ -20,14 +20,16 @@ public final class PaymentSessionCompleteRequest extends PaymentSessionInfo { /** * Creates a translated version of the page in the specified language. Default: "en-GB" + * [Optional] */ @Builder.Default private LocaleType locale = LocaleType.EN_GB; /** - * A unique token representing the additional customer data captured by Flow, + * A unique token representing the additional customer data captured by Flow, * as received from the handleSubmit callback. * Do not log or store this value. + * [Optional] */ 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 index fec9838e..6ddd34ef 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCreateRequest.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionCreateRequest.java @@ -26,38 +26,46 @@ public final class PaymentSessionCreateRequest extends PaymentSessionInfo { /** * Creates a translated version of the page in the specified language. Default: "en-GB" + * [Optional] */ @Builder.Default private LocaleType locale = LocaleType.EN_GB; /** * A timestamp specifying when the PaymentSession should expire, as an ISO 8601 code. + * [Optional] + * Format: date-time (ISO 8601) */ private Instant expiresOn; /** * Specifies which payment method options to present to the customer. + * [Optional] */ private List enabledPaymentMethods; /** * Specifies which payment method options to not present to the customer. + * [Optional] */ private List disabledPaymentMethods; /** * Configurations for payment method-specific settings. + * [Optional] */ private PaymentMethodConfiguration paymentMethodConfiguration; /** * Configuration for asynchronous retries. + * [Optional] */ private CustomerRetry customerRetry; /** * Deprecated - The Customer's IP address. Only IPv4 and IPv6 addresses are accepted. + * [Optional] */ @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 index 80e543da..fa5eac5d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionInfo.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionInfo.java @@ -33,94 +33,116 @@ public abstract class PaymentSessionInfo extends PaymentSessionBase { /** - * The three-letter ISO currency code + * The three-letter ISO currency code. + * [Optional] + * min 3 max 3 */ private Currency currency; /** * The billing details. + * [Optional] */ private BillingInformation billing; /** - * Overrides the default success redirect URL configured on your account, + * Overrides the default success redirect URL configured on your account, * for payment methods that require a redirect. + * [Optional] + * Format: uri */ private String successUrl; /** - * Overrides the default failure redirect URL configured on your account, + * Overrides the default failure redirect URL configured on your account, * for payment methods that require a redirect. + * [Optional] + * Format: uri */ private String failureUrl; /** * A description of the purchase, which is displayed on the customer's statement. + * [Optional] */ private BillingDescriptor billingDescriptor; /** * A description for the payment. + * [Optional] */ private String description; /** * The customer's details. Required if source.type is tamara. + * [Optional] */ private Customer customer; /** - * The shipping details + * The shipping details. + * [Optional] */ private ShippingDetails shipping; /** * Information about the recipient of the payment's funds. + * [Optional] */ private PaymentRecipient recipient; /** - * Use the processing object to influence or override the data sent during card processing + * Use the processing object to influence or override the data sent during card processing. + * [Optional] */ private ProcessingSettings processing; /** * Details about the payment instruction. + * [Optional] */ private PaymentInstruction instruction; /** * The processing channel to use for the payment. + * [Optional] + * Pattern: ^(pc)_(\w{26})$ */ private String processingChannelId; /** * The sub-entities that the payment is being processed on behalf of. + * [Optional] */ private List amountAllocations; /** * Configures the risk assessment performed during payment processing. + * [Optional] */ private RiskRequest risk; /** * The merchant's display name. + * [Optional] */ private String displayName; /** * Allows you to store additional information about a transaction with custom fields. + * [Optional] */ private Map metadata; /** * The sender of the payment. + * [Optional] */ private PaymentSender sender; /** * Specifies whether to capture the payment, if applicable. Default: true + * [Optional] */ @Builder.Default private Boolean capture = true; @@ -128,6 +150,8 @@ public abstract class PaymentSessionInfo extends PaymentSessionBase { /** * A timestamp specifying when to capture the payment, as an ISO 8601 code. * If a value is provided, capture is automatically set to true. + * [Optional] + * Format: date-time (ISO 8601) */ 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 index fbfd45b4..8bc91a20 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionSubmitRequest.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/requests/PaymentSessionSubmitRequest.java @@ -9,7 +9,7 @@ /** * Request to submit 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. */ @@ -21,20 +21,23 @@ public final class PaymentSessionSubmitRequest extends PaymentSessionInfo { /** - * A unique token representing the additional customer data captured by Flow, + * A unique token representing the additional customer data captured by Flow, * as received from the handleSubmit callback. * Do not log or store this value. + * [Optional] */ private String sessionData; /** * Configurations for payment method-specific settings. + * [Optional] */ private PaymentMethodConfiguration paymentMethodConfiguration; /** * Deprecated - The Customer's IP address. Only IPv4 and IPv6 addresses are accepted. + * [Optional] */ @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 index a6893532..22a6c813 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java @@ -20,17 +20,20 @@ public final class ActionRequiredPaymentSubmissionResponse extends PaymentSubmis /** * Instruction for further payment action. + * [Optional] */ private PaymentAction action; /** - * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response) + * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response). + * [Optional] */ 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. + * [Optional] */ 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 index eb6603c2..9098cedc 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java @@ -18,13 +18,15 @@ public final class ApprovedPaymentSubmissionResponse extends PaymentSubmissionResponse { /** - * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response) + * The Payment Sessions unique identifier (only present in CreateAndSubmitPaymentSession response). + * [Optional] */ 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. + * [Optional] */ 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 index 5c14367f..3eac8166 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/DeclinedPaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/DeclinedPaymentSubmissionResponse.java @@ -18,6 +18,7 @@ public final class DeclinedPaymentSubmissionResponse extends PaymentSubmissionRe /** * The reason for the payment decline. + * [Optional] */ private String declineReason; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java index 2cef1fd8..2e2b9de1 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java @@ -19,19 +19,22 @@ public final class PaymentSessionResponse extends Resource { /** - * The Payment Sessions unique identifier + * The Payment Sessions unique identifier. + * [Optional] */ 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. + * [Optional] */ private String paymentSessionToken; /** * The secret used by Flow to authenticate payment session requests. * Do not log or store this value. + * [Optional] */ 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 index 557e18dc..cb2fd84c 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSubmissionResponse.java @@ -17,16 +17,19 @@ public abstract class PaymentSubmissionResponse extends Resource { /** * The payment identifier. + * [Optional] */ private String id; /** * The payment's status - used for polymorphic deserialization. + * [Optional] */ private PaymentSessionStatus status; /** * The payment method name. + * [Optional] */ private PaymentMethodType type; -} \ No newline at end of file +} From f1b7fff55a12172b94a675a9a78b67984d7a748a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:26:46 +0200 Subject: [PATCH 06/10] feat(payment-setups): add full payment methods coverage and billing Adds the complete set of 34 payment methods from the swagger spec, which previously had only 5: - New payment method classes (ach, alipay, alma, applepay, bancontact, benefit, card, dana, eps, gcash, googlepay, ideal, instrument, kakaopay, knet, mbway, mobilepay, multibanco, octopus, p24, paynow, qpay, sepa, sequra, swish, tamara, tng, truemoney, twint, vipps, wechatpay) - New shared enums: TerminalType, OsType, CardAccountHolderType, CardAccountHolder - Add billing field and PaymentSetupBilling entity - Add availablePaymentMethods (readOnly) to PaymentSetupsResponse - Update PaymentMethods, PaymentMethodAction, PaymentMethodBase - Update PaymentSetupSource and PaymentSetupsConfirmResponse Per swagger changelog entries 2026-04-08, 2026-03-11, 2025-11-20, 2025-09-26, 2025-03-24. --- .../entities/billing/PaymentSetupBilling.java | 22 ++ .../paymentMethods/PaymentMethods.java | 246 +++++++++++++++++- .../entities/paymentMethods/ach/Ach.java | 51 ++++ .../paymentMethods/ach/AchAccountHolder.java | 58 +++++ .../ach/AchAccountHolderType.java | 18 ++ .../paymentMethods/ach/AchAccountType.java | 18 ++ .../paymentMethods/ach/AchIdentification.java | 36 +++ .../paymentMethods/alipay/AlipayCn.java | 32 +++ .../paymentMethods/alipay/AlipayHk.java | 32 +++ .../entities/paymentMethods/alma/Alma.java | 13 + .../paymentMethods/applepay/ApplePay.java | 59 +++++ .../applepay/ApplePayTokenData.java | 40 +++ .../applepay/ApplePayTokenDataHeader.java | 38 +++ .../paymentMethods/bancontact/Bancontact.java | 22 ++ .../paymentMethods/benefit/Benefit.java | 13 + .../entities/paymentMethods/card/Card.java | 109 ++++++++ .../common/CardAccountHolder.java | 51 ++++ .../common/CardAccountHolderType.java | 18 ++ .../paymentMethods/common/OsType.java | 15 ++ .../common/PaymentMethodAction.java | 15 +- .../common/PaymentMethodBase.java | 6 +- .../paymentMethods/common/TerminalType.java | 19 ++ .../entities/paymentMethods/dana/Dana.java | 32 +++ .../entities/paymentMethods/eps/Eps.java | 13 + .../entities/paymentMethods/gcash/GCash.java | 32 +++ .../paymentMethods/googlepay/GooglePay.java | 59 +++++ .../googlepay/GooglePayTokenData.java | 44 ++++ .../entities/paymentMethods/ideal/Ideal.java | 21 ++ .../paymentMethods/instrument/Instrument.java | 26 ++ .../paymentMethods/kakaopay/KakaoPay.java | 32 +++ .../paymentMethods/klarna/Klarna.java | 8 +- .../klarna/KlarnaAccountHolder.java | 7 +- .../entities/paymentMethods/knet/Knet.java | 19 ++ .../paymentMethods/knet/KnetLanguage.java | 15 ++ .../entities/paymentMethods/mbway/MBWay.java | 13 + .../paymentMethods/mobilepay/MobilePay.java | 13 + .../paymentMethods/multibanco/Multibanco.java | 22 ++ .../paymentMethods/octopus/Octopus.java | 13 + .../entities/paymentMethods/p24/P24.java | 21 ++ .../paymentMethods/p24/P24AccountHolder.java | 29 +++ .../paymentMethods/paynow/PayNow.java | 13 + .../entities/paymentMethods/qpay/Qpay.java | 28 ++ .../entities/paymentMethods/sepa/Sepa.java | 48 ++++ .../sepa/SepaAccountHolder.java | 44 ++++ .../sepa/SepaAccountHolderType.java | 15 ++ .../paymentMethods/sepa/SepaMandate.java | 39 +++ .../paymentMethods/sepa/SepaMandateType.java | 15 ++ .../paymentMethods/sequra/Sequra.java | 13 + .../paymentMethods/stcpay/Stcpay.java | 14 +- .../entities/paymentMethods/swish/Swish.java | 28 ++ .../swish/SwishAccountHolder.java | 31 +++ .../entities/paymentMethods/tabby/Tabby.java | 8 +- .../paymentMethods/tamara/Tamara.java | 13 + .../entities/paymentMethods/tng/Tng.java | 32 +++ .../paymentMethods/truemoney/TrueMoney.java | 32 +++ .../entities/paymentMethods/twint/Twint.java | 13 + .../entities/paymentMethods/vipps/Vipps.java | 13 + .../paymentMethods/wechatpay/WeChatPay.java | 13 + .../setups/requests/PaymentSetupsRequest.java | 16 +- .../setups/responses/PaymentSetupSource.java | 75 ++++-- .../PaymentSetupsConfirmResponse.java | 75 ++++-- .../responses/PaymentSetupsResponse.java | 56 +++- 62 files changed, 1883 insertions(+), 101 deletions(-) create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/billing/PaymentSetupBilling.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolderType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alma/Alma.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenData.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/benefit/Benefit.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolderType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/OsType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/TerminalType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/eps/Eps.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ideal/Ideal.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/instrument/Instrument.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/Knet.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/KnetLanguage.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mbway/MBWay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mobilepay/MobilePay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/octopus/Octopus.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24AccountHolder.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/paynow/PayNow.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolderType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandateType.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sequra/Sequra.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tamara/Tamara.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/twint/Twint.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/vipps/Vipps.java create mode 100644 src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/wechatpay/WeChatPay.java diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/billing/PaymentSetupBilling.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/billing/PaymentSetupBilling.java new file mode 100644 index 00000000..02e28737 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/billing/PaymentSetupBilling.java @@ -0,0 +1,22 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.billing; + +import com.checkout.common.Address; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The billing details for the payment setup. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class PaymentSetupBilling { + + /** + * The billing address. + */ + private Address address; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java index 93cb3cee..82e88306 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java @@ -1,17 +1,50 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach.Ach; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alipay.AlipayCn; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alipay.AlipayHk; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alma.Alma; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.applepay.ApplePay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.bancontact.Bancontact; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.benefit.Benefit; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.bizum.Bizum; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.card.Card; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.dana.Dana; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.eps.Eps; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.gcash.GCash; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.googlepay.GooglePay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ideal.Ideal; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.instrument.Instrument; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.kakaopay.KakaoPay; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.klarna.Klarna; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.knet.Knet; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.mbway.MBWay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.mobilepay.MobilePay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.multibanco.Multibanco; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.octopus.Octopus; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.p24.P24; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.paynow.PayNow; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.paypal.PayPal; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.qpay.Qpay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa.Sepa; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sequra.Sequra; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.stcpay.Stcpay; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.swish.Swish; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.tabby.Tabby; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.tamara.Tamara; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.tng.Tng; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.truemoney.TrueMoney; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.twint.Twint; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.vipps.Vipps; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.wechatpay.WeChatPay; +import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** - * Payment methods configuration + * Payment methods configuration for a payment setup. */ @Data @Builder @@ -20,27 +53,226 @@ public final class PaymentMethods { /** - * Klarna payment method configuration + * Instrument (saved payment source) configuration. + * [Optional] + */ + private Instrument instrument; + + /** + * Klarna payment method configuration. + * [Optional] */ private Klarna klarna; /** - * STC Pay payment method configuration + * STC Pay payment method configuration. + * [Optional] */ private Stcpay stcpay; /** - * Tabby payment method configuration + * Tabby payment method configuration. + * [Optional] */ private Tabby tabby; /** - * PayPal payment method configuration + * PayPal payment method configuration. + * [Optional] */ private PayPal paypal; /** - * Bizum payment method configuration + * Bizum payment method configuration. + * [Optional] */ private Bizum bizum; -} \ No newline at end of file + + /** + * PayNow payment method configuration. + * [Optional] + */ + private PayNow paynow; + + /** + * QPay payment method configuration. + * [Optional] + */ + private Qpay qpay; + + /** + * EPS payment method configuration. + * [Optional] + */ + private Eps eps; + + /** + * iDEAL payment method configuration. + * [Optional] + */ + private Ideal ideal; + + /** + * KNET payment method configuration. + * [Optional] + */ + private Knet knet; + + /** + * Bancontact payment method configuration. + * [Optional] + */ + private Bancontact bancontact; + + /** + * Benefit payment method configuration. + * [Optional] + */ + private Benefit benefit; + + /** + * Vipps payment method configuration. + * [Optional] + */ + private Vipps vipps; + + /** + * Twint payment method configuration. + * [Optional] + */ + private Twint twint; + + /** + * Alipay CN payment method configuration. + * [Optional] + */ + @SerializedName("alipay_cn") + private AlipayCn alipayCn; + + /** + * Alipay HK payment method configuration. + * [Optional] + */ + @SerializedName("alipay_hk") + private AlipayHk alipayHk; + + /** + * GCash payment method configuration. + * [Optional] + */ + private GCash gcash; + + /** + * TNG payment method configuration. + * [Optional] + */ + private Tng tng; + + /** + * Dana payment method configuration. + * [Optional] + */ + private Dana dana; + + /** + * MobilePay payment method configuration. + * [Optional] + */ + private MobilePay mobilepay; + + /** + * Tamara payment method configuration. + * [Optional] + */ + private Tamara tamara; + + /** + * MBWay payment method configuration. + * [Optional] + */ + private MBWay mbway; + + /** + * Multibanco payment method configuration. + * [Optional] + */ + private Multibanco multibanco; + + /** + * WeChatPay payment method configuration. + * [Optional] + */ + private WeChatPay wechatpay; + + /** + * KakaoPay payment method configuration. + * [Optional] + */ + private KakaoPay kakaopay; + + /** + * TrueMoney payment method configuration. + * [Optional] + */ + private TrueMoney truemoney; + + /** + * Octopus payment method configuration. + * [Optional] + */ + private Octopus octopus; + + /** + * P24 (Przelewy24) payment method configuration. + * [Optional] + */ + private P24 p24; + + /** + * Alma payment method configuration. + * [Optional] + */ + private Alma alma; + + /** + * Swish payment method configuration. + * [Optional] + */ + private Swish swish; + + /** + * Sequra payment method configuration. + * [Optional] + */ + private Sequra sequra; + + /** + * ACH (Direct Debit) payment method configuration. + * [Optional] + */ + private Ach ach; + + /** + * SEPA (Direct Debit) payment method configuration. + * [Optional] + */ + private Sepa sepa; + + /** + * GooglePay payment method configuration. + * [Optional] + */ + private GooglePay googlepay; + + /** + * ApplePay payment method configuration. + * [Optional] + */ + private ApplePay applepay; + + /** + * Card payment method configuration. + * [Optional] + */ + private Card card; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java new file mode 100644 index 00000000..c38f9c88 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java @@ -0,0 +1,51 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The ACH payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Ach extends PaymentMethodBase { + + /** + * The type of Direct Debit account. + * [Optional] + */ + @SerializedName("account_type") + private AchAccountType accountType; + + /** + * The account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private AchAccountHolder accountHolder; + + /** + * The account number of the Direct Debit account. + * [Optional] + * min 4 characters, max 17 characters + */ + @SerializedName("account_number") + private String accountNumber; + + /** + * The bank code of the Direct Debit account. + * [Optional] + * min 8 characters, max 9 characters + */ + @SerializedName("bank_code") + private String bankCode; + + /** + * The two-letter ISO country code of the bank account. + * [Optional] + * max 2 characters + */ + private String country; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java new file mode 100644 index 00000000..93d7ba82 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java @@ -0,0 +1,58 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The ACH account holder details. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AchAccountHolder { + + /** + * The type of account holder. + * [Optional] + */ + private AchAccountHolderType type; + + /** + * The first name of the account holder. + * [Optional] + */ + @SerializedName("first_name") + private String firstName; + + /** + * The last name of the account holder. + * [Optional] + */ + @SerializedName("last_name") + private String lastName; + + /** + * The legal name of a registered company that holds the account. + * [Optional] + */ + @SerializedName("company_name") + private String companyName; + + /** + * The account holder's date of birth. + * [Optional] + * Format: yyyy-MM-dd + */ + @SerializedName("date_of_birth") + private String dateOfBirth; + + /** + * The account holder's government document identification. + * [Optional] + */ + private AchIdentification identification; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolderType.java new file mode 100644 index 00000000..a065458f --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolderType.java @@ -0,0 +1,18 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; + +import com.google.gson.annotations.SerializedName; + +/** + * The type of account holder. + */ +public enum AchAccountHolderType { + + @SerializedName("individual") + INDIVIDUAL, + + @SerializedName("corporate") + CORPORATE, + + @SerializedName("government") + GOVERNMENT +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountType.java new file mode 100644 index 00000000..bbd95284 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountType.java @@ -0,0 +1,18 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; + +import com.google.gson.annotations.SerializedName; + +/** + * The type of Direct Debit account. + */ +public enum AchAccountType { + + @SerializedName("savings") + SAVINGS, + + @SerializedName("current") + CURRENT, + + @SerializedName("cash") + CASH +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java new file mode 100644 index 00000000..0c07810a --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java @@ -0,0 +1,36 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The account holder's government document identification. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AchIdentification { + + /** + * The document type. + * [Optional] + */ + private String type; + + /** + * The country where the document was issued. + * [Optional] + */ + @SerializedName("issuing_country") + private String issuingCountry; + + /** + * The document number. + * [Optional] + */ + private String number; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java new file mode 100644 index 00000000..e259628b --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alipay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Alipay CN payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class AlipayCn extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java new file mode 100644 index 00000000..867ca7bd --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alipay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Alipay HK payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class AlipayHk extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alma/Alma.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alma/Alma.java new file mode 100644 index 00000000..45dc432c --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alma/Alma.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.alma; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Alma payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Alma extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java new file mode 100644 index 00000000..861896da --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java @@ -0,0 +1,59 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.applepay; + +import com.checkout.common.Phone; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.Instant; + +/** + * The Apple Pay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class ApplePay extends PaymentMethodBase { + + /** + * The Apple Pay encrypted payment token data. + * [Optional] + */ + @SerializedName("token_data") + private ApplePayTokenData tokenData; + + /** + * The Apple Pay payment token string. + * [Optional] + */ + private String token; + + /** + * The date and time the token expires. + * [Optional] + * Format: date-time (ISO 8601) + */ + @SerializedName("expires_on") + private Instant expiresOn; + + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. + * [Optional] + */ + @SerializedName("store_for_future_use") + private Boolean storeForFutureUse; + + /** + * The customer's phone number. + * [Optional] + */ + private Phone phone; + + /** + * The card account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private CardAccountHolder accountHolder; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenData.java new file mode 100644 index 00000000..85a2f841 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenData.java @@ -0,0 +1,40 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.applepay; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The Apple Pay encrypted payment token data. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ApplePayTokenData { + + /** + * The version of the payment token: EC_v1 for ECC-encrypted data, RSA_v1 for RSA-encrypted data. + * [Optional] + */ + private String version; + + /** + * The encrypted payment data, Base64-encoded. + * [Optional] + */ + private String data; + + /** + * The signature of the payment and header data. + * [Optional] + */ + private String signature; + + /** + * Additional version-dependent information used to decrypt and verify the payment. + * [Optional] + */ + private ApplePayTokenDataHeader header; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java new file mode 100644 index 00000000..e58921e3 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java @@ -0,0 +1,38 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.applepay; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Additional version-dependent information used to decrypt and verify the Apple Pay payment. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ApplePayTokenDataHeader { + + /** + * The ephemeral public key bytes. + * [Optional] + */ + @SerializedName("ephemeral_public_key") + private String ephemeralPublicKey; + + /** + * The hash of the X.509 encoded public key bytes of the merchant's certificate. + * [Optional] + */ + @SerializedName("public_key_hash") + private String publicKeyHash; + + /** + * The transaction identifier, generated on the device. + * [Optional] + */ + @SerializedName("transaction_id") + private String transactionId; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java new file mode 100644 index 00000000..33275f87 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java @@ -0,0 +1,22 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.bancontact; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Bancontact payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Bancontact extends PaymentMethodBase { + + /** + * The account holder's name. + * [Optional] + * min 3 characters, max 100 characters + */ + @SerializedName("account_holder_name") + private String accountHolderName; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/benefit/Benefit.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/benefit/Benefit.java new file mode 100644 index 00000000..55adfd46 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/benefit/Benefit.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.benefit; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Benefit payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Benefit extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java new file mode 100644 index 00000000..fa7cb0bf --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java @@ -0,0 +1,109 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.card; + +import com.checkout.common.Phone; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.Instant; + +/** + * The Card payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Card extends PaymentMethodBase { + + /** + * The card number (without separators). Write-only. + * [Optional] + */ + private String number; + + /** + * The last four digits of the card number. Read-only. + * [Optional] + */ + private String last4; + + /** + * The card issuer's Bank Identification Number (BIN). Read-only. + * [Optional] + */ + private String bin; + + /** + * The card scheme. Read-only. + * [Optional] + */ + private String scheme; + + /** + * The expiry month of the card. + * [Optional] + */ + @SerializedName("expiry_month") + private Integer expiryMonth; + + /** + * The expiry year of the card. + * [Optional] + */ + @SerializedName("expiry_year") + private Integer expiryYear; + + /** + * The cardholder's name. Write-only. + * [Optional] + */ + private String name; + + /** + * The card verification value/code. 3 digits, except for American Express (4 digits). Write-only. + * [Optional] + */ + private String cvv; + + /** + * Set to true for payments that use stored card details. Write-only. + * [Optional] + */ + private Boolean stored; + + /** + * The time by which the card details must be confirmed. Read-only. + * [Optional] + * Format: date-time (ISO 8601) + */ + @SerializedName("expires_on") + private Instant expiresOn; + + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. + * [Optional] + */ + @SerializedName("store_for_future_use") + private Boolean storeForFutureUse; + + /** + * The customer's phone number. + * [Optional] + */ + private Phone phone; + + /** + * The card account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private CardAccountHolder accountHolder; + + /** + * Indicates whether to use the Real-Time Account Updater to update the card information. + * [Optional] + */ + @SerializedName("allow_update") + private Boolean allowUpdate; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java new file mode 100644 index 00000000..4353722a --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java @@ -0,0 +1,51 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Card account holder information, shared by Card, GooglePay, and ApplePay payment methods. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class CardAccountHolder { + + /** + * The card account holder type. + * [Optional] + */ + private CardAccountHolderType type; + + /** + * The card account holder's first name. + * [Optional] + */ + @SerializedName("first_name") + private String firstName; + + /** + * The card account holder's last name. + * [Optional] + */ + @SerializedName("last_name") + private String lastName; + + /** + * The card account holder's middle name. + * [Optional] + */ + @SerializedName("middle_name") + private String middleName; + + /** + * Indicates whether the ANI (account name inquiry) check is performed with the card scheme. + * [Optional] + */ + @SerializedName("account_name_inquiry") + private Boolean accountNameInquiry; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolderType.java new file mode 100644 index 00000000..af0815fa --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolderType.java @@ -0,0 +1,18 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; + +import com.google.gson.annotations.SerializedName; + +/** + * The card account holder type. + */ +public enum CardAccountHolderType { + + @SerializedName("individual") + INDIVIDUAL, + + @SerializedName("government") + GOVERNMENT, + + @SerializedName("corporate") + CORPORATE +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/OsType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/OsType.java new file mode 100644 index 00000000..293c8ca7 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/OsType.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; + +import com.google.gson.annotations.SerializedName; + +/** + * The customer's operating system type. Required when terminal_type is not web. + */ +public enum OsType { + + @SerializedName("android") + ANDROID, + + @SerializedName("ios") + IOS +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java index 52bea3d9..a28c8bef 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java @@ -7,7 +7,7 @@ import lombok.NoArgsConstructor; /** - * Next-step action returned by the API for a payment method (read-only). + * Next-step action returned by the API for a payment method. */ @Data @Builder @@ -16,30 +16,29 @@ public final class PaymentMethodAction { /** - * The type of action. - *

[Read-only]

- * {@code sdk} or {@code otp} (varies by payment method). + * The type of action: sdk or otp (varies by payment method). + * [Optional] */ private String type; /** * The client token for the Klarna or PayPal SDK. - *

[Read-only]

+ * [Optional] */ @SerializedName("client_token") private String clientToken; /** * The session identifier for the Klarna payment method session. - *

[Read-only]

+ * [Optional] */ @SerializedName("session_id") private String sessionId; /** * The PayPal order ID to use with the PayPal SDK. - *

[Read-only]

+ * [Optional] */ @SerializedName("order_id") private String orderId; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodBase.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodBase.java index db991007..18422d00 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodBase.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodBase.java @@ -12,13 +12,13 @@ public abstract class PaymentMethodBase { /** * The payment method status. - *

[Read-only]

+ * [Optional] */ private PaymentMethodStatus status; /** * An array of error codes or indicators that highlight missing or invalid information. - *

[Read-only]

+ * [Optional] */ private List flags; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/TerminalType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/TerminalType.java new file mode 100644 index 00000000..4e115e24 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/TerminalType.java @@ -0,0 +1,19 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; + +import com.google.gson.annotations.SerializedName; + +/** + * The client-side terminal type. Indicates whether the customer is using a PC browser, + * mobile browser, or mobile application. + */ +public enum TerminalType { + + @SerializedName("web") + WEB, + + @SerializedName("wap") + WAP, + + @SerializedName("app") + APP +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java new file mode 100644 index 00000000..dae9f5b7 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.dana; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Dana payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Dana extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/eps/Eps.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/eps/Eps.java new file mode 100644 index 00000000..5de48a56 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/eps/Eps.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.eps; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The EPS payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Eps extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java new file mode 100644 index 00000000..8b792a22 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.gcash; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The GCash payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class GCash extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java new file mode 100644 index 00000000..62b49767 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java @@ -0,0 +1,59 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.googlepay; + +import com.checkout.common.Phone; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.time.Instant; + +/** + * The Google Pay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class GooglePay extends PaymentMethodBase { + + /** + * The Google Pay encrypted payment token data. + * [Optional] + */ + @SerializedName("token_data") + private GooglePayTokenData tokenData; + + /** + * The Google Pay payment token string. + * [Optional] + */ + private String token; + + /** + * The date and time the token expires. + * [Optional] + * Format: date-time (ISO 8601) + */ + @SerializedName("expires_on") + private Instant expiresOn; + + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. + * [Optional] + */ + @SerializedName("store_for_future_use") + private Boolean storeForFutureUse; + + /** + * The customer's phone number. + * [Optional] + */ + private Phone phone; + + /** + * The card account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private CardAccountHolder accountHolder; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java new file mode 100644 index 00000000..1f55202b --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java @@ -0,0 +1,44 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.googlepay; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The Google Pay payment token data. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class GooglePayTokenData { + + /** + * The encryption and signing scheme used to create this message. Defaults to ECv0. + * [Optional] + */ + @SerializedName("protocol_version") + private String protocolVersion; + + /** + * The signature that verifies the message came from Google, created using ECDSA. + * [Optional] + */ + private String signature; + + /** + * A serialized JSON string containing the encryptedMessage, ephemeralPublicKey, and tag. + * [Optional] + */ + @SerializedName("signed_message") + private String signedMessage; + + /** + * The public key provided to the Google API in the tokenizationSpecification.parameters field. + * [Optional] + */ + @SerializedName("tokenization_key") + private String tokenizationKey; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ideal/Ideal.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ideal/Ideal.java new file mode 100644 index 00000000..dc6ef3a5 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ideal/Ideal.java @@ -0,0 +1,21 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ideal; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The iDEAL payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Ideal extends PaymentMethodBase { + + /** + * A description of the products or services being paid for. + * Do not include HTML tags or special characters. + * [Optional] + * max 35 characters + */ + private String description; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/instrument/Instrument.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/instrument/Instrument.java new file mode 100644 index 00000000..d04e0c15 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/instrument/Instrument.java @@ -0,0 +1,26 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.instrument; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodAction; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The instrument payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Instrument extends PaymentMethodBase { + + /** + * The unique identifier of the selected instrument. + * [Optional] + */ + private String id; + + /** + * The next available action for the payment method. + * [Optional] + */ + private PaymentMethodAction action; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java new file mode 100644 index 00000000..45d4eb9e --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.kakaopay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The KakaoPay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class KakaoPay extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/Klarna.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/Klarna.java index 3ce72ada..428d2992 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/Klarna.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/Klarna.java @@ -15,13 +15,13 @@ public final class Klarna extends PaymentMethodBase { /** * The initialization state of the payment method. Defaults to disabled. - *

[Optional]

+ * [Optional] */ private PaymentMethodInitialization initialization = PaymentMethodInitialization.DISABLED; /** - * The next available action. Contains type {@code sdk}, {@code client_token}, {@code session_id}. - *

[Read-only]

+ * The next available action. Contains type, client_token, and session_id. + * [Optional] */ private PaymentMethodAction action; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java index 21f7a19b..96d302e2 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java @@ -8,7 +8,7 @@ import lombok.NoArgsConstructor; /** - * Klarna account holder information + * Klarna account holder information. */ @Data @Builder @@ -17,8 +17,9 @@ public final class KlarnaAccountHolder { /** - * The billing address of the Klarna account holder + * The billing address of the Klarna account holder. + * [Optional] */ @SerializedName("billing_address") private Address billingAddress; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/Knet.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/Knet.java new file mode 100644 index 00000000..173c7a99 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/Knet.java @@ -0,0 +1,19 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.knet; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The KNET payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Knet extends PaymentMethodBase { + + /** + * The customer's preferred language on the issuer's site. + * [Optional] + */ + private KnetLanguage language; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/KnetLanguage.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/KnetLanguage.java new file mode 100644 index 00000000..8aabe438 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/knet/KnetLanguage.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.knet; + +import com.google.gson.annotations.SerializedName; + +/** + * The customer's preferred language for KNET payments. + */ +public enum KnetLanguage { + + @SerializedName("en") + EN, + + @SerializedName("ar") + AR +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mbway/MBWay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mbway/MBWay.java new file mode 100644 index 00000000..0655871d --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mbway/MBWay.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.mbway; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The MBWay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class MBWay extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mobilepay/MobilePay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mobilepay/MobilePay.java new file mode 100644 index 00000000..597e0512 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/mobilepay/MobilePay.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.mobilepay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The MobilePay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class MobilePay extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java new file mode 100644 index 00000000..78d53c98 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java @@ -0,0 +1,22 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.multibanco; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Multibanco payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Multibanco extends PaymentMethodBase { + + /** + * The account holder's name. + * [Optional] + * min 3 characters, max 100 characters + */ + @SerializedName("account_holder_name") + private String accountHolderName; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/octopus/Octopus.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/octopus/Octopus.java new file mode 100644 index 00000000..8c4db543 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/octopus/Octopus.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.octopus; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Octopus payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Octopus extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java new file mode 100644 index 00000000..17111cf4 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java @@ -0,0 +1,21 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.p24; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The P24 (Przelewy24) payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class P24 extends PaymentMethodBase { + + /** + * The account holder's details. + * [Optional] + */ + @SerializedName("account_holder") + private P24AccountHolder accountHolder; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24AccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24AccountHolder.java new file mode 100644 index 00000000..2aee5637 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24AccountHolder.java @@ -0,0 +1,29 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.p24; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The P24 account holder's details. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class P24AccountHolder { + + /** + * The account holder's name. + * [Optional] + * min 3 characters, max 100 characters + */ + private String name; + + /** + * The account holder's email address. + * [Optional] + */ + private String email; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/paynow/PayNow.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/paynow/PayNow.java new file mode 100644 index 00000000..7c9f9579 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/paynow/PayNow.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.paynow; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The PayNow payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class PayNow extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java new file mode 100644 index 00000000..332179c8 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java @@ -0,0 +1,28 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.qpay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The QPay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Qpay extends PaymentMethodBase { + + /** + * The Qatari national ID. Must start with 2 or 3, followed by 10 digits. + * [Optional] + */ + @SerializedName("national_id") + private String nationalId; + + /** + * A description of the payment order. Alphanumeric characters only. + * [Optional] + * max 255 characters + */ + private String description; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java new file mode 100644 index 00000000..baed1ac6 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java @@ -0,0 +1,48 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.common.Currency; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The SEPA payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Sepa extends PaymentMethodBase { + + /** + * The account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private SepaAccountHolder accountHolder; + + /** + * The account holder's IBAN. + * [Optional] + */ + @SerializedName("account_number") + private String accountNumber; + + /** + * The account's country as an ISO 3166-1 alpha-2 code. + * [Optional] + * max 2 characters + */ + private String country; + + /** + * The account holder's account currency. + * [Optional] + */ + private Currency currency; + + /** + * The SEPA mandate details. + * [Optional] + */ + private SepaMandate mandate; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java new file mode 100644 index 00000000..a00b7a21 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java @@ -0,0 +1,44 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The SEPA account holder details. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class SepaAccountHolder { + + /** + * The type of account holder. + * [Optional] + */ + private SepaAccountHolderType type; + + /** + * The first name of the account holder. + * [Optional] + */ + @SerializedName("first_name") + private String firstName; + + /** + * The last name of the account holder. + * [Optional] + */ + @SerializedName("last_name") + private String lastName; + + /** + * The legal name of a registered company that holds the account. + * [Optional] + */ + @SerializedName("company_name") + private String companyName; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolderType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolderType.java new file mode 100644 index 00000000..507e1764 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolderType.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; + +import com.google.gson.annotations.SerializedName; + +/** + * The type of SEPA account holder. + */ +public enum SepaAccountHolderType { + + @SerializedName("individual") + INDIVIDUAL, + + @SerializedName("corporate") + CORPORATE +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java new file mode 100644 index 00000000..047ee59f --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java @@ -0,0 +1,39 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +/** + * The SEPA mandate details. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class SepaMandate { + + /** + * The ID of the mandate. + * [Optional] + */ + private String id; + + /** + * The type of mandate. + * [Optional] + */ + private SepaMandateType type; + + /** + * The date the mandate was signed. + * [Optional] + * Format: yyyy-MM-dd + */ + @SerializedName("date_of_signature") + private LocalDate dateOfSignature; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandateType.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandateType.java new file mode 100644 index 00000000..8fca68d6 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandateType.java @@ -0,0 +1,15 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; + +import com.google.gson.annotations.SerializedName; + +/** + * The type of SEPA mandate. + */ +public enum SepaMandateType { + + @SerializedName("core") + CORE, + + @SerializedName("b2b") + B2B +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sequra/Sequra.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sequra/Sequra.java new file mode 100644 index 00000000..e45d0b03 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sequra/Sequra.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sequra; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Sequra payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Sequra extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/stcpay/Stcpay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/stcpay/Stcpay.java index bfa232d3..5446286d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/stcpay/Stcpay.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/stcpay/Stcpay.java @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; /** - * STC Pay payment method configuration + * STC Pay payment method configuration. */ @Data @EqualsAndHashCode(callSuper = true) @@ -15,19 +15,19 @@ public final class Stcpay extends PaymentMethodBase { /** * The initialization state of the payment method. Defaults to disabled. - *

[Optional]

+ * [Optional] */ private PaymentMethodInitialization initialization = PaymentMethodInitialization.DISABLED; /** - * The one-time password (OTP) for stc pay. - *

[Write-only]

+ * The one-time password (OTP) for STC Pay. Write-only. + * [Optional] */ private String otp; /** - * The next available action. Contains type {@code otp} when an OTP is required. - *

[Read-only]

+ * The next available action. Contains type otp when an OTP is required. + * [Optional] */ private PaymentMethodAction action; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java new file mode 100644 index 00000000..b7f9d749 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java @@ -0,0 +1,28 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.swish; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Swish payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Swish extends PaymentMethodBase { + + /** + * A description that appears on the customer's billing statement. + * [Optional] + */ + @SerializedName("billing_descriptor") + private String billingDescriptor; + + /** + * The account holder's details. + * [Optional] + */ + @SerializedName("account_holder") + private SwishAccountHolder accountHolder; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java new file mode 100644 index 00000000..a1ab4496 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java @@ -0,0 +1,31 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.swish; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The Swish account holder's details. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class SwishAccountHolder { + + /** + * The account holder's first name. + * [Optional] + */ + @SerializedName("first_name") + private String firstName; + + /** + * The account holder's last name. + * [Optional] + */ + @SerializedName("last_name") + private String lastName; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java index 18a0e2a2..d26a7935 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java @@ -17,14 +17,14 @@ public final class Tabby extends PaymentMethodBase { /** * The initialization state of the payment method. Defaults to disabled. - *

[Optional]

+ * [Optional] */ private PaymentMethodInitialization initialization = PaymentMethodInitialization.DISABLED; /** - * The available payment types for Tabby (for example, {@code installments}). - *

[Read-only]

+ * The available payment types for Tabby (for example, installments). + * [Optional] */ @SerializedName("payment_types") private List paymentTypes; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tamara/Tamara.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tamara/Tamara.java new file mode 100644 index 00000000..93304016 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tamara/Tamara.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.tamara; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Tamara payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Tamara extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java new file mode 100644 index 00000000..dbd0ead5 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.tng; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The TNG payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Tng extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java new file mode 100644 index 00000000..d54b5d42 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java @@ -0,0 +1,32 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.truemoney; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The TrueMoney payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class TrueMoney extends PaymentMethodBase { + + /** + * The client-side terminal type. + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ + @SerializedName("terminal_type") + private TerminalType terminalType; + + /** + * The customer's operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ + @SerializedName("os_type") + private OsType osType; +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/twint/Twint.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/twint/Twint.java new file mode 100644 index 00000000..593035e8 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/twint/Twint.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.twint; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Twint payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Twint extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/vipps/Vipps.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/vipps/Vipps.java new file mode 100644 index 00000000..83eef920 --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/vipps/Vipps.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.vipps; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The Vipps payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class Vipps extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/wechatpay/WeChatPay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/wechatpay/WeChatPay.java new file mode 100644 index 00000000..461cb5ef --- /dev/null +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/wechatpay/WeChatPay.java @@ -0,0 +1,13 @@ +package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.wechatpay; + +import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * The WeChatPay payment method's details and configuration. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public final class WeChatPay extends PaymentMethodBase { +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java index 2f04f741..8eb91d7f 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java @@ -2,6 +2,7 @@ import com.checkout.common.Currency; import com.checkout.payments.PaymentType; +import com.checkout.handlepaymentsandpayouts.setups.entities.billing.PaymentSetupBilling; import com.checkout.handlepaymentsandpayouts.setups.entities.customer.Customer; import com.checkout.handlepaymentsandpayouts.setups.entities.industry.Industry; import com.checkout.handlepaymentsandpayouts.setups.entities.order.Order; @@ -23,8 +24,9 @@ public final class PaymentSetupsRequest { /** - * The processing channel to be used for the payment setup + * The processing channel to be used for the payment setup. * [Required] + * Pattern: ^(pc)_(\w{26})$ */ @SerializedName("processing_channel_id") private String processingChannelId; @@ -42,10 +44,10 @@ public final class PaymentSetupsRequest { private Currency currency; /** - * The type of payment. - //// You must provide this field for card payments in which the cardholder is not present. For example, if the transaction is a recurring payment, or a mail order/telephone order (MOTO) payment. - * Enum: "Regular" "Recurring" "MOTO" "Installment" "Unscheduled" + * The type of payment. Required for card payments where the cardholder is not present, + * such as recurring or MOTO payments. * [Optional] + * Enum: "Regular" "Recurring" "MOTO" "Installment" "PayLater" "Unscheduled" */ @Builder.Default private PaymentType paymentType = PaymentType.REGULAR; @@ -92,4 +94,10 @@ public final class PaymentSetupsRequest { * [Optional] */ private Industry industry; + + /** + * The billing details for the payment. + * [Optional] + */ + private PaymentSetupBilling billing; } \ No newline at end of file diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java index 41a98d92..f5b90d05 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java @@ -27,156 +27,183 @@ public final class PaymentSetupSource { /** - * The payment source type. sepabank_accountalipay_cnachcardcard + * The payment source type. + * [Optional] */ private PaymentSourceType type; /** - * The expiry month + * The expiry month. + * [Optional] */ @SerializedName("expiry_month") private Integer expiryMonth; /** - * The expiry year + * The expiry year. + * [Optional] */ @SerializedName("expiry_year") private Integer expiryYear; /** - * The last four digits of the card number + * The last four digits of the card number. + * [Optional] */ private String last4; /** * Uniquely identifies this particular card number. You can use this to compare cards across customers. + * [Optional] */ private String fingerprint; /** - * The card issuer's Bank Identification Number (BIN) + * The card issuer's Bank Identification Number (BIN). + * [Optional] */ private String bin; /** - * The payment source identifier that can be used for subsequent payments. For new sources, this will only be returned if the payment was approved + * The payment source identifier that can be used for subsequent payments. + * For new sources, this will only be returned if the payment was approved. + * [Optional] */ private String id; /** - * The payment source owner's billing address + * The payment source owner's billing address. + * [Optional] */ @SerializedName("billing_address") private Address billingAddress; /** - * The payment source owner's phone number + * The payment source owner's phone number. + * [Optional] */ private Phone phone; /** - * The cardholder's name + * The cardholder's name. + * [Optional] */ private String name; /** - * The card scheme + * The card scheme. + * [Optional] */ private String scheme; /** - * Deprecated Replaced by local_schemes - * The local co-branded card scheme. + * Deprecated. Replaced by local_schemes. The local co-branded card scheme. + * [Optional] */ @SerializedName("scheme_local") private String schemeLocal; /** * The local co-branded card schemes. + * [Optional] */ @SerializedName("local_schemes") private List localSchemes; /** - * The card type + * The card type. + * [Optional] */ @SerializedName("card_type") private CardType cardType; /** - * The card category + * The card category. + * [Optional] */ @SerializedName("card_category") private CardCategoryType cardCategory; /** - * The card wallet type + * The card wallet type. + * [Optional] */ @SerializedName("card_wallet_type") private CardWalletType cardWalletType; /** - * The name of the card issuer + * The name of the card issuer. + * [Optional] */ private String issuer; /** - * The card issuer's country (two-letter ISO code) + * The card issuer's country (two-letter ISO code). + * [Optional] */ @SerializedName("issuer_country") private String issuerCountry; /** - * The issuer/card scheme product identifier + * The issuer/card scheme product identifier. + * [Optional] */ @SerializedName("product_id") private String productId; /** - * The issuer/card scheme product type + * The issuer/card scheme product type. + * [Optional] */ @SerializedName("product_type") private String productType; /** - * The Address Verification System check result + * The Address Verification System check result. + * [Optional] */ @SerializedName("avs_check") private String avsCheck; /** - * The card verification value (CVV) check result + * The card verification value (CVV) check result. + * [Optional] */ @SerializedName("cvv_check") private String cvvCheck; /** - * A unique reference to the underlying card for network tokens (e.g., Apple Pay, Google Pay) + * A unique reference to the underlying card for network tokens (e.g., Apple Pay, Google Pay). + * [Optional] */ @SerializedName("payment_account_reference") private String paymentAccountReference; /** * The JWE encrypted full card number that has been updated by real-time account updater. + * [Optional] */ @SerializedName("encrypted_card_number") private String encryptedCardNumber; /** * Specifies what card information was updated by the Real-Time Account Updater. + * [Optional] */ @SerializedName("account_update_status") private AccountUpdateStatusType accountUpdateStatus; /** * Provides the failure code if the Real-Time Account Updater fails to update the card information. + * [Optional] */ @SerializedName("account_update_failure_code") private String accountUpdateFailureCode; /** - * Information about the account holder of the card + * Information about the account holder of the card. + * [Optional] */ @SerializedName("account_holder") private AbstractAccountHolder accountHolder; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java index 537c0806..3ae34533 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java @@ -29,127 +29,152 @@ public final class PaymentSetupsConfirmResponse extends Resource { /** - * The payment's unique identifier + * The payment's unique identifier. + * [Optional] */ private String id; /** - * The unique identifier for the action performed against this payment + * The unique identifier for the action performed against this payment. + * [Optional] */ @SerializedName("action_id") private String actionId; /** - * The payment amount + * The payment amount. + * [Optional] */ private Long amount; /** - * The three-letter ISO currency code of the payment + * The three-letter ISO currency code of the payment. + * [Optional] */ private Currency currency; /** - * Whether or not the authorization or capture was successful + * Whether or not the authorization or capture was successful. + * [Optional] */ private Boolean approved; /** - * The status of the payment + * The status of the payment. + * [Optional] */ private PaymentStatus status; /** - * The Gateway response code + * The Gateway response code. + * [Optional] */ @SerializedName("response_code") private String responseCode; /** - * The date and time at which the payment was processed + * The date and time at which the payment was processed. + * [Optional] + * Format: date-time (ISO 8601) */ @SerializedName("processed_on") private Instant processedOn; /** - * The full amount from the original authorization, if a partial authorization was requested and approved + * The full amount from the original authorization, if a partial authorization was requested and approved. + * [Optional] */ @SerializedName("amount_requested") private Long amountRequested; /** - * The acquirer authorization code if the payment was authorized + * The acquirer authorization code if the payment was authorized. + * [Optional] */ @SerializedName("auth_code") private String authCode; /** - * The Gateway response summary + * The Gateway response summary. + * [Optional] */ @SerializedName("response_summary") private String responseSummary; /** - * The timestamp (ISO 8601 code) for when the authorization's validity period expires + * The timestamp for when the authorization's validity period expires. + * [Optional] + * Format: date-time (ISO 8601) */ @SerializedName("expires_on") private String expiresOn; /** - * Provides 3D Secure enrollment status if the payment was downgraded to non-3D Secure + * Provides 3D Secure enrollment status if the payment was downgraded to non-3D Secure. + * [Optional] */ @SerializedName("3ds") private Threeds threeDSecure; /** - * Returns the payment's risk assessment results + * Returns the payment's risk assessment results. + * [Optional] */ private Risk risk; /** - * The source of the payment + * The source of the payment. + * [Optional] */ private PaymentSetupSource source; /** - * The customer associated with the payment, if provided in the request + * The customer associated with the payment, if provided in the request. + * [Optional] */ private Customer customer; /** - * The payment balances + * The payment balances. + * [Optional] */ private Balances balances; /** - * Your reference for the payment + * Your reference for the payment. + * [Optional] */ private String reference; /** - * The The details of the subscription + * The details of the subscription. + * [Optional] */ private Subscription subscription; /** - * Returns information related to the processing of the payment + * Returns information related to the processing of the payment. + * [Optional] */ private Processing processing; /** - * The final Electronic Commerce Indicator (ECI) security level used to authorize the payment. - * Applicable for 3D Secure and network token payments + * The final Electronic Commerce Indicator (ECI) security level used to authorize the payment. + * Applicable for 3D Secure and network token payments. + * [Optional] */ private String eci; /** - * The scheme transaction identifier + * The scheme transaction identifier. + * [Optional] */ @SerializedName("scheme_id") private String schemeId; /** - * The retry information + * The retry information. + * [Optional] */ private Retry retry; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java index c1172806..4fa87089 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java @@ -2,12 +2,16 @@ import com.checkout.common.Resource; import com.checkout.common.Currency; +import com.checkout.handlepaymentsandpayouts.setups.entities.billing.PaymentSetupBilling; import com.checkout.handlepaymentsandpayouts.setups.entities.customer.Customer; import com.checkout.handlepaymentsandpayouts.setups.entities.industry.Industry; import com.checkout.handlepaymentsandpayouts.setups.entities.order.Order; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.PaymentMethods; import com.checkout.handlepaymentsandpayouts.setups.entities.settings.Settings; import com.checkout.payments.PaymentType; +import com.google.gson.annotations.SerializedName; + +import java.util.List; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -26,61 +30,89 @@ public final class PaymentSetupsResponse extends Resource { /** * The unique identifier of the payment setup. + * [Optional] */ private String id; /** - * The processing channel used for the payment setup + * The processing channel used for the payment setup. + * [Required] + * Pattern: ^(pc)_(\w{26})$ */ private String processingChannelId; /** - * The payment amount. The exact format depends on the currency + * The payment amount in the minor currency unit. + * [Required] */ private Long amount; /** - * The three-letter ISO currency code + * The three-letter ISO currency code. + * [Required] */ private Currency currency; /** - * The type of payment method + * The type of payment. + * [Optional] + * Enum: "Regular" "Recurring" "MOTO" "Installment" "PayLater" "Unscheduled" */ private PaymentType paymentType; /** - * The reference identifier for this payment setup + * A reference you can use to identify the payment setup, such as an order number. + * [Optional] */ private String reference; /** - * A description of the payment setup + * A description of the payment setup. + * [Optional] */ private String description; /** - * The payment method configuration for this setup + * The payment method configuration for this setup. + * [Optional] */ private PaymentMethods paymentMethods; /** - * The payment setup configuration settings + * The payment setup configuration settings. + * [Optional] */ private Settings settings; /** - * Details about the customer + * Details about the customer. + * [Optional] */ private Customer customer; /** - * Details about the order associated with this payment setup + * Details about the order associated with this payment setup. + * [Optional] */ private Order order; /** - * Industry-specific information for specialized payment scenarios + * Industry-specific information for specialized payment scenarios. + * [Optional] */ private Industry industry; -} \ No newline at end of file + + /** + * The billing details for the payment. + * [Optional] + */ + private PaymentSetupBilling billing; + + /** + * An ordered list of available payment method names. The order indicates the recommended + * presentation priority, with the first item being the highest priority. + * [Optional] + */ + @SerializedName("available_payment_methods") + private List availablePaymentMethods; +} From 08cfc73b6cf68a9c4c678845166a76879082ccfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:27:36 +0200 Subject: [PATCH 07/10] feat(instruments): add SEPA/ACH update and card network token - InstrumentType: add ACH enum value - UpdateInstrumentSepaRequest/Response: new (SepaInstrumentData, accountHolder) - UpdateInstrumentAchRequest/Response: new (AchInstrumentData, accountHolder) - CreateInstrumentSepaRequest: add customer field - GetCardInstrumentResponse: add encrypted_card_number, network_token, card_wallet_type, regulated_indicator (per RetrieveCardInstrumentResponse schema) - InstrumentNetworkToken + NetworkTokenState: new types - UpdatePaymentInstrumentRequest: align with swagger - GsonSerializer: register SEPA/ACH update response subtypes - Add serialization tests for CreateInstrumentSepaRequest and GetCardInstrumentResponse --- .../java/com/checkout/GsonSerializer.java | 4 +- .../UpdatePaymentInstrumentRequest.java | 14 +- .../com/checkout/common/InstrumentType.java | 5 +- .../create/CreateInstrumentSepaRequest.java | 19 +- .../get/GetCardInstrumentResponse.java | 82 ++++++++ .../get/InstrumentNetworkToken.java | 22 ++ .../instruments/get/NetworkTokenState.java | 16 ++ .../update/UpdateInstrumentAchRequest.java | 62 ++++++ .../update/UpdateInstrumentAchResponse.java | 15 ++ .../update/UpdateInstrumentSepaRequest.java | 107 ++++++++++ .../update/UpdateInstrumentSepaResponse.java | 15 ++ ...nstrumentSepaRequestSerializationTest.java | 194 ++++++++++++++++++ ...rdInstrumentResponseSerializationTest.java | 187 +++++++++++++++++ 13 files changed, 737 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/checkout/instruments/get/InstrumentNetworkToken.java create mode 100644 src/main/java/com/checkout/instruments/get/NetworkTokenState.java create mode 100644 src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java create mode 100644 src/main/java/com/checkout/instruments/update/UpdateInstrumentAchResponse.java create mode 100644 src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java create mode 100644 src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaResponse.java create mode 100644 src/test/java/com/checkout/instruments/CreateInstrumentSepaRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/instruments/get/GetCardInstrumentResponseSerializationTest.java diff --git a/src/main/java/com/checkout/GsonSerializer.java b/src/main/java/com/checkout/GsonSerializer.java index ab47de5d..5f9b3db8 100644 --- a/src/main/java/com/checkout/GsonSerializer.java +++ b/src/main/java/com/checkout/GsonSerializer.java @@ -187,7 +187,9 @@ public final class GsonSerializer implements Serializer { .registerSubtype(com.checkout.instruments.get.GetSepaInstrumentResponse.class, identifier(InstrumentType.SEPA))) .registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(com.checkout.instruments.update.UpdateInstrumentResponse.class, CheckoutUtils.TYPE) .registerSubtype(com.checkout.instruments.update.UpdateInstrumentBankAccountResponse.class, identifier(InstrumentType.BANK_ACCOUNT)) - .registerSubtype(com.checkout.instruments.update.UpdateInstrumentCardResponse.class, identifier(InstrumentType.CARD))) + .registerSubtype(com.checkout.instruments.update.UpdateInstrumentCardResponse.class, identifier(InstrumentType.CARD)) + .registerSubtype(com.checkout.instruments.update.UpdateInstrumentSepaResponse.class, identifier(InstrumentType.SEPA)) + .registerSubtype(com.checkout.instruments.update.UpdateInstrumentAchResponse.class, identifier(InstrumentType.ACH))) // Workflows CS2 .registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(com.checkout.workflows.actions.response.WorkflowActionResponse.class, CheckoutUtils.TYPE) .registerSubtype(com.checkout.workflows.actions.response.WebhookWorkflowActionResponse.class, identifier(WorkflowActionType.WEBHOOK))) diff --git a/src/main/java/com/checkout/accounts/UpdatePaymentInstrumentRequest.java b/src/main/java/com/checkout/accounts/UpdatePaymentInstrumentRequest.java index 29aba57b..40fe2d68 100644 --- a/src/main/java/com/checkout/accounts/UpdatePaymentInstrumentRequest.java +++ b/src/main/java/com/checkout/accounts/UpdatePaymentInstrumentRequest.java @@ -8,10 +8,22 @@ @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) -public final class UpdatePaymentInstrumentRequest extends Headers{ +public final class UpdatePaymentInstrumentRequest extends Headers { + /** + * A reference that you can use to identify the payment instrument. + * [Optional] + */ private String label; + /** + * Whether the payment instrument should be set as the default payout destination. + * For ad-hoc payouts the instrument is specified explicitly; for scheduled payouts the first instrument + * created for a currency is used. To change the instrument for a payout schedule, update the schedule. + * [Optional] + * @deprecated Update the payout schedule instead. + */ + @Deprecated @SerializedName("default") private Boolean defaultDestination; } diff --git a/src/main/java/com/checkout/common/InstrumentType.java b/src/main/java/com/checkout/common/InstrumentType.java index 73d8e7b4..e6b606e6 100644 --- a/src/main/java/com/checkout/common/InstrumentType.java +++ b/src/main/java/com/checkout/common/InstrumentType.java @@ -17,6 +17,9 @@ public enum InstrumentType { CARD_TOKEN, @SerializedName("sepa") - SEPA + SEPA, + + @SerializedName("ach") + ACH } diff --git a/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java b/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java index a7fb7340..bf25dc8b 100644 --- a/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java +++ b/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java @@ -1,7 +1,6 @@ package com.checkout.instruments.create; import com.checkout.common.AccountHolder; -import com.checkout.common.AccountType; import com.checkout.common.InstrumentType; import com.google.gson.annotations.SerializedName; import lombok.Builder; @@ -16,18 +15,34 @@ @ToString(callSuper = true) public final class CreateInstrumentSepaRequest extends CreateInstrumentRequest { + /** + * The details of the SEPA mandate, including IBAN, country, currency, payment type, and mandate ID. + * [Required] + */ @SerializedName("instrument_data") private InstrumentData instrumentData; + /** + * The account holder details. Must include first_name, last_name, and billing_address. + * [Required] + */ @SerializedName("account_holder") private AccountHolder accountHolder; + /** + * The customer details. Associates the instrument with an existing or new customer. + * [Optional] + */ + private CreateCustomerInstrumentRequest customer; + @Builder private CreateInstrumentSepaRequest(final InstrumentData instrumentData, - final AccountHolder accountHolder) { + final AccountHolder accountHolder, + final CreateCustomerInstrumentRequest customer) { super(InstrumentType.SEPA); this.instrumentData = instrumentData; this.accountHolder = accountHolder; + this.customer = customer; } public CreateInstrumentSepaRequest() { diff --git a/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java b/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java index 46a53bd3..bca19ace 100644 --- a/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java +++ b/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java @@ -2,6 +2,7 @@ import com.checkout.common.CardCategory; import com.checkout.common.CardType; +import com.checkout.common.CardWalletType; import com.checkout.common.CountryCode; import com.checkout.common.InstrumentType; import com.google.gson.annotations.SerializedName; @@ -16,38 +17,119 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { private final InstrumentType type = InstrumentType.CARD; + /** + * The expiry month of the card. + * [Optional] + */ @SerializedName("expiry_month") private Integer expiryMonth; + /** + * The expiry year of the card. + * [Optional] + */ @SerializedName("expiry_year") private Integer expiryYear; + /** + * The name of the cardholder. + * [Optional] + */ private String name; + /** + * The card scheme. + * [Optional] + */ private String scheme; + /** + * The local card scheme. + * [Optional] + */ @SerializedName("scheme_local") private String schemeLocal; + /** + * The last four digits of the card number. + * [Optional] + */ private String last4; + /** + * The card BIN (Bank Identification Number). + * [Optional] + */ private String bin; + /** + * The card type. + * [Optional] + */ @SerializedName("card_type") private CardType cardType; + /** + * The card category. + * [Optional] + */ @SerializedName("card_category") private CardCategory cardCategory; + /** + * The name of the card issuer. + * [Optional] + */ private String issuer; + /** + * The country of the card issuer. + * [Optional] + */ @SerializedName("issuer_country") private CountryCode issuerCountry; + /** + * The card product identifier. + * [Optional] + */ @SerializedName("product_id") private String productId; + /** + * The card product type. + * [Optional] + */ @SerializedName("product_type") private String productType; + /** + * The JWE-encrypted full card number. This is only present if your level of PCI compliance is SAQ-D. + * [Optional] + */ + @SerializedName("encrypted_card_number") + private String encryptedCardNumber; + + /** + * The network token associated with this instrument. + * [Optional] + */ + @SerializedName("network_token") + private InstrumentNetworkToken networkToken; + + /** + * The card wallet type used for this instrument. + * [Optional] + * Enum: "googlepay" "applepay" + */ + @SerializedName("card_wallet_type") + private CardWalletType cardWalletType; + + /** + * Indicates whether the card is subject to interchange regulation. + * [Required] + */ + @SerializedName("regulated_indicator") + private Boolean regulatedIndicator; + } diff --git a/src/main/java/com/checkout/instruments/get/InstrumentNetworkToken.java b/src/main/java/com/checkout/instruments/get/InstrumentNetworkToken.java new file mode 100644 index 00000000..740fccc5 --- /dev/null +++ b/src/main/java/com/checkout/instruments/get/InstrumentNetworkToken.java @@ -0,0 +1,22 @@ +package com.checkout.instruments.get; + +import lombok.Data; + +@Data +public final class InstrumentNetworkToken { + + /** + * The unique identifier for the network token. + * [Optional] + * Pattern: ^(nt)_(\w{26})$ + */ + private String id; + + /** + * The state of the network token. + * [Optional] + * Enum: "active" "suspended" "inactive" + */ + private NetworkTokenState state; + +} diff --git a/src/main/java/com/checkout/instruments/get/NetworkTokenState.java b/src/main/java/com/checkout/instruments/get/NetworkTokenState.java new file mode 100644 index 00000000..5871e9bd --- /dev/null +++ b/src/main/java/com/checkout/instruments/get/NetworkTokenState.java @@ -0,0 +1,16 @@ +package com.checkout.instruments.get; + +import com.google.gson.annotations.SerializedName; + +public enum NetworkTokenState { + + @SerializedName("active") + ACTIVE, + + @SerializedName("suspended") + SUSPENDED, + + @SerializedName("inactive") + INACTIVE, + +} diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java new file mode 100644 index 00000000..528f1d5a --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java @@ -0,0 +1,62 @@ +package com.checkout.instruments.update; + +import com.checkout.common.AccountHolder; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.common.InstrumentType; +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.Setter; +import lombok.ToString; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public final class UpdateInstrumentAchRequest extends UpdateInstrumentRequest { + + @SerializedName("instrument_data") + private AchInstrumentData instrumentData; + + @SerializedName("account_holder") + private AccountHolder accountHolder; + + @Builder + private UpdateInstrumentAchRequest(final AchInstrumentData instrumentData, + final AccountHolder accountHolder) { + super(InstrumentType.ACH); + this.instrumentData = instrumentData; + this.accountHolder = accountHolder; + } + + public UpdateInstrumentAchRequest() { + super(InstrumentType.ACH); + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static final class AchInstrumentData { + + @SerializedName("account_type") + private String accountType; + + @SerializedName("account_number") + private String accountNumber; + + @SerializedName("bank_code") + private String bankCode; + + private Currency currency; + + private CountryCode country; + + } + +} diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchResponse.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchResponse.java new file mode 100644 index 00000000..cb825724 --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchResponse.java @@ -0,0 +1,15 @@ +package com.checkout.instruments.update; + +import com.checkout.common.InstrumentType; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public final class UpdateInstrumentAchResponse extends UpdateInstrumentResponse { + + private final InstrumentType type = InstrumentType.ACH; + +} diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java new file mode 100644 index 00000000..55f89b2f --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java @@ -0,0 +1,107 @@ +package com.checkout.instruments.update; + +import com.checkout.common.AccountHolder; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.common.InstrumentType; +import com.checkout.payments.PaymentType; +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.Setter; +import lombok.ToString; + +import java.time.LocalDate; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public final class UpdateInstrumentSepaRequest extends UpdateInstrumentRequest { + + /** + * SEPA-specific instrument data to update. + * [Optional] + */ + @SerializedName("instrument_data") + private SepaInstrumentData instrumentData; + + /** + * The account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private AccountHolder accountHolder; + + @Builder + private UpdateInstrumentSepaRequest(final SepaInstrumentData instrumentData, + final AccountHolder accountHolder) { + super(InstrumentType.SEPA); + this.instrumentData = instrumentData; + this.accountHolder = accountHolder; + } + + public UpdateInstrumentSepaRequest() { + super(InstrumentType.SEPA); + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static final class SepaInstrumentData { + + /** + * The SEPA instrument type. + * [Optional] + */ + private String type; + + /** + * The IBAN account number. + * [Optional] + */ + @SerializedName("account_number") + private String accountNumber; + + /** + * The two-letter ISO country code. + * [Optional] + */ + private CountryCode country; + + /** + * The three-letter ISO currency code. + * [Optional] + */ + private Currency currency; + + /** + * The SEPA payment type. + * [Optional] + */ + @SerializedName("payment_type") + private PaymentType paymentType; + + /** + * The SEPA mandate identifier. + * [Optional] + */ + @SerializedName("mandate_id") + private String mandateId; + + /** + * The date the SEPA mandate was signed. + * [Optional] + * Format: yyyy-MM-dd + */ + @SerializedName("date_of_signature") + private LocalDate dateOfSignature; + + } + +} diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaResponse.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaResponse.java new file mode 100644 index 00000000..87f43378 --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaResponse.java @@ -0,0 +1,15 @@ +package com.checkout.instruments.update; + +import com.checkout.common.InstrumentType; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public final class UpdateInstrumentSepaResponse extends UpdateInstrumentResponse { + + private final InstrumentType type = InstrumentType.SEPA; + +} diff --git a/src/test/java/com/checkout/instruments/CreateInstrumentSepaRequestSerializationTest.java b/src/test/java/com/checkout/instruments/CreateInstrumentSepaRequestSerializationTest.java new file mode 100644 index 00000000..01941859 --- /dev/null +++ b/src/test/java/com/checkout/instruments/CreateInstrumentSepaRequestSerializationTest.java @@ -0,0 +1,194 @@ +package com.checkout.instruments; + +import com.checkout.GsonSerializer; +import com.checkout.common.AccountHolder; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.instruments.create.CreateCustomerInstrumentRequest; +import com.checkout.instruments.create.CreateInstrumentSepaRequest; +import com.checkout.instruments.create.InstrumentData; +import com.checkout.payments.PaymentType; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class CreateInstrumentSepaRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeTypeAsSepa() { + final CreateInstrumentSepaRequest request = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder() + .accoountNumber("FR7630006000011234567890189") + .country(CountryCode.FR) + .currency(Currency.EUR) + .build()) + .accountHolder(AccountHolder.builder() + .firstName("Jane") + .lastName("Smith") + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"type\":\"sepa\"")); + } + + @Test + void shouldSerializeInstrumentData() { + final CreateInstrumentSepaRequest request = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder() + .accoountNumber("DE89370400440532013000") + .country(CountryCode.DE) + .currency(Currency.EUR) + .paymentType(PaymentType.RECURRING) + .build()) + .accountHolder(AccountHolder.builder() + .firstName("Hans") + .lastName("Muller") + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"instrument_data\"")); + assertTrue(json.contains("\"account_number\":\"DE89370400440532013000\"")); + assertTrue(json.contains("\"country\":\"DE\"")); + assertTrue(json.contains("\"currency\":\"EUR\"")); + } + + @Test + void shouldSerializeAccountHolder() { + final CreateInstrumentSepaRequest request = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder().build()) + .accountHolder(AccountHolder.builder() + .firstName("Marie") + .lastName("Dupont") + .billingAddress(Address.builder() + .addressLine1("10 Rue de la Paix") + .city("Paris") + .country(CountryCode.FR) + .build()) + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"account_holder\"")); + assertTrue(json.contains("\"first_name\":\"Marie\"")); + assertTrue(json.contains("\"last_name\":\"Dupont\"")); + assertTrue(json.contains("\"billing_address\"")); + } + + @Test + void shouldSerializeOptionalCustomer() { + final CreateInstrumentSepaRequest request = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder().build()) + .accountHolder(AccountHolder.builder().build()) + .customer(CreateCustomerInstrumentRequest.builder() + .email("customer@example.com") + .name("Jane Smith") + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"customer\"")); + assertTrue(json.contains("\"email\":\"customer@example.com\"")); + assertTrue(json.contains("\"name\":\"Jane Smith\"")); + } + + @Test + void shouldDeserializeInstrumentData() { + final String json = "{" + + "\"type\":\"sepa\"," + + "\"instrument_data\":{" + + " \"account_number\":\"FR7630006000011234567890189\"," + + " \"country\":\"FR\"," + + " \"currency\":\"EUR\"" + + "}," + + "\"account_holder\":{" + + " \"first_name\":\"Jean\"," + + " \"last_name\":\"Martin\"" + + "}" + + "}"; + + final CreateInstrumentSepaRequest request = serializer.fromJson(json, CreateInstrumentSepaRequest.class); + + assertNotNull(request); + assertNotNull(request.getInstrumentData()); + assertEquals("FR7630006000011234567890189", request.getInstrumentData().getAccoountNumber()); + assertEquals(CountryCode.FR, request.getInstrumentData().getCountry()); + assertEquals(Currency.EUR, request.getInstrumentData().getCurrency()); + assertNotNull(request.getAccountHolder()); + assertEquals("Jean", request.getAccountHolder().getFirstName()); + assertEquals("Martin", request.getAccountHolder().getLastName()); + } + + @Test + void shouldRoundTripSerialize() { + final CreateInstrumentSepaRequest original = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder() + .accoountNumber("ES9121000418450200051332") + .country(CountryCode.ES) + .currency(Currency.EUR) + .paymentType(PaymentType.RECURRING) + .build()) + .accountHolder(AccountHolder.builder() + .firstName("Carlos") + .lastName("García") + .billingAddress(Address.builder() + .addressLine1("Calle Mayor 1") + .city("Madrid") + .country(CountryCode.ES) + .build()) + .build()) + .build(); + + final String json = serializer.toJson(original); + final CreateInstrumentSepaRequest deserialized = serializer.fromJson(json, CreateInstrumentSepaRequest.class); + + assertNotNull(deserialized); + assertNotNull(deserialized.getInstrumentData()); + assertEquals("ES9121000418450200051332", deserialized.getInstrumentData().getAccoountNumber()); + assertEquals(CountryCode.ES, deserialized.getInstrumentData().getCountry()); + assertNotNull(deserialized.getAccountHolder()); + assertEquals("Carlos", deserialized.getAccountHolder().getFirstName()); + assertEquals("García", deserialized.getAccountHolder().getLastName()); + } + + @Test + void shouldNotSerializeNullOptionalCustomer() { + final CreateInstrumentSepaRequest request = CreateInstrumentSepaRequest.builder() + .instrumentData(InstrumentData.builder().build()) + .accountHolder(AccountHolder.builder().build()) + .build(); + + final String json = serializer.toJson(request); + + assertFalse(json.contains("\"customer\"")); + } + + @Test + void shouldHandleAbsentOptionalCustomer() { + final String json = "{" + + "\"type\":\"sepa\"," + + "\"instrument_data\":{}," + + "\"account_holder\":{}" + + "}"; + + final CreateInstrumentSepaRequest request = serializer.fromJson(json, CreateInstrumentSepaRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getCustomer()); + } +} diff --git a/src/test/java/com/checkout/instruments/get/GetCardInstrumentResponseSerializationTest.java b/src/test/java/com/checkout/instruments/get/GetCardInstrumentResponseSerializationTest.java new file mode 100644 index 00000000..06264525 --- /dev/null +++ b/src/test/java/com/checkout/instruments/get/GetCardInstrumentResponseSerializationTest.java @@ -0,0 +1,187 @@ +package com.checkout.instruments.get; + +import com.checkout.GsonSerializer; +import com.checkout.common.CardCategory; +import com.checkout.common.CardType; +import com.checkout.common.CardWalletType; +import com.checkout.common.CountryCode; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class GetCardInstrumentResponseSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldDeserializeMinimalResponse() { + final String json = "{" + + "\"type\":\"card\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"expiry_month\":6," + + "\"expiry_year\":2025," + + "\"last4\":\"1234\"," + + "\"regulated_indicator\":true" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + + assertNotNull(response); + assertEquals(6, response.getExpiryMonth()); + assertEquals(2025, response.getExpiryYear()); + assertEquals("1234", response.getLast4()); + assertTrue(response.getRegulatedIndicator()); + } + + @Test + void shouldDeserializeEncryptedCardNumber() { + final String json = "{" + + "\"type\":\"card\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"last4\":\"4242\"," + + "\"regulated_indicator\":false," + + "\"encrypted_card_number\":\"eyJhbGciOiJSU0EtT0FFUC0yNTYifQ...\"" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + + assertNotNull(response); + assertEquals("eyJhbGciOiJSU0EtT0FFUC0yNTYifQ...", response.getEncryptedCardNumber()); + } + + @Test + void shouldDeserializeNetworkToken() { + final String json = "{" + + "\"type\":\"card\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"last4\":\"4242\"," + + "\"regulated_indicator\":false," + + "\"network_token\":{" + + " \"id\":\"nt_abcdefghijklmnopqrstuvwxyz12\"," + + " \"state\":\"active\"" + + "}" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + + assertNotNull(response); + assertNotNull(response.getNetworkToken()); + assertEquals("nt_abcdefghijklmnopqrstuvwxyz12", response.getNetworkToken().getId()); + assertEquals(NetworkTokenState.ACTIVE, response.getNetworkToken().getState()); + } + + @Test + void shouldDeserializeNetworkTokenStates() { + for (final String state : new String[]{"active", "suspended", "inactive"}) { + final String json = "{\"type\":\"card\",\"last4\":\"4242\",\"regulated_indicator\":false," + + "\"network_token\":{\"id\":\"nt_abcdefghijklmnopqrstuvwxyz12\",\"state\":\"" + state + "\"}}"; + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + assertNotNull(response.getNetworkToken().getState(), "State should not be null for: " + state); + } + } + + @Test + void shouldDeserializeCardWalletType() { + final String jsonGpay = "{" + + "\"type\":\"card\",\"last4\":\"4242\",\"regulated_indicator\":false," + + "\"card_wallet_type\":\"googlepay\"" + + "}"; + final String jsonApay = "{" + + "\"type\":\"card\",\"last4\":\"4242\",\"regulated_indicator\":false," + + "\"card_wallet_type\":\"applepay\"" + + "}"; + + final GetCardInstrumentResponse gpay = serializer.fromJson(jsonGpay, GetCardInstrumentResponse.class); + final GetCardInstrumentResponse apay = serializer.fromJson(jsonApay, GetCardInstrumentResponse.class); + + assertEquals(CardWalletType.GOOGLEPAY, gpay.getCardWalletType()); + assertEquals(CardWalletType.APPLEPAY, apay.getCardWalletType()); + } + + @Test + void shouldDeserializeFullResponse() { + final String json = "{" + + "\"type\":\"card\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"fingerprint\":\"vnsdrvikkvre3dtrjpwv7ire7u\"," + + "\"expiry_month\":6," + + "\"expiry_year\":2025," + + "\"name\":\"John Smith\"," + + "\"scheme\":\"Visa\"," + + "\"scheme_local\":\"Cartes Bancaires\"," + + "\"last4\":\"4242\"," + + "\"bin\":\"424242\"," + + "\"card_type\":\"Credit\"," + + "\"card_category\":\"Consumer\"," + + "\"issuer\":\"JPMORGAN CHASE BANK NA\"," + + "\"issuer_country\":\"US\"," + + "\"product_id\":\"A\"," + + "\"product_type\":\"Visa Traditional\"," + + "\"encrypted_card_number\":\"eyJhbGciOiJSU0EtT0FFUC0yNTYifQ...\"," + + "\"network_token\":{\"id\":\"nt_abcdefghijklmnopqrstuvwxyz12\",\"state\":\"active\"}," + + "\"card_wallet_type\":\"googlepay\"," + + "\"regulated_indicator\":true" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + + assertNotNull(response); + assertEquals("src_wmlfc3zyhqzehihu7giusaaawu", response.getId()); + assertEquals(6, response.getExpiryMonth()); + assertEquals("John Smith", response.getName()); + assertEquals("Visa", response.getScheme()); + assertEquals("4242", response.getLast4()); + assertEquals(CardType.CREDIT, response.getCardType()); + assertEquals(CardCategory.CONSUMER, response.getCardCategory()); + assertEquals(CountryCode.US, response.getIssuerCountry()); + assertEquals("eyJhbGciOiJSU0EtT0FFUC0yNTYifQ...", response.getEncryptedCardNumber()); + assertNotNull(response.getNetworkToken()); + assertEquals(NetworkTokenState.ACTIVE, response.getNetworkToken().getState()); + assertEquals(CardWalletType.GOOGLEPAY, response.getCardWalletType()); + assertTrue(response.getRegulatedIndicator()); + } + + @Test + void shouldRoundTripSerialize() { + final String original = "{" + + "\"type\":\"card\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"last4\":\"4242\"," + + "\"encrypted_card_number\":\"eyJhbGciOiJSU0EtT0FFUC0yNTYifQ...\"," + + "\"network_token\":{\"id\":\"nt_abcdefghijklmnopqrstuvwxyz12\",\"state\":\"suspended\"}," + + "\"card_wallet_type\":\"applepay\"," + + "\"regulated_indicator\":true" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(original, GetCardInstrumentResponse.class); + final String reserialised = serializer.toJson(response); + final GetCardInstrumentResponse roundTripped = serializer.fromJson(reserialised, GetCardInstrumentResponse.class); + + assertNotNull(roundTripped); + assertEquals(response.getId(), roundTripped.getId()); + assertEquals(response.getEncryptedCardNumber(), roundTripped.getEncryptedCardNumber()); + assertEquals(response.getNetworkToken().getState(), roundTripped.getNetworkToken().getState()); + assertEquals(response.getCardWalletType(), roundTripped.getCardWalletType()); + assertEquals(response.getRegulatedIndicator(), roundTripped.getRegulatedIndicator()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{" + + "\"type\":\"card\"," + + "\"last4\":\"4242\"," + + "\"regulated_indicator\":false" + + "}"; + + final GetCardInstrumentResponse response = serializer.fromJson(json, GetCardInstrumentResponse.class); + + assertNotNull(response); + assertDoesNotThrow(() -> serializer.toJson(response)); + assertEquals(null, response.getEncryptedCardNumber()); + assertEquals(null, response.getNetworkToken()); + assertEquals(null, response.getCardWalletType()); + } +} From d5885db9e63d392d43cbef82720da6aba1dadf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:28:36 +0200 Subject: [PATCH 08/10] feat(payments): sync processing, sources and responses with swagger - PaymentProcessing: add reconciliationId, aggregator; new Aggregator type - ProcessingSettings: add surchargeAmount, accommodationData, serviceType (AchServiceType), foreignRetailerAmount, reconciliationId, aggregator - AccommodationData/AccommodationRoom/AccommodationGuest: new types - AchServiceType: new enum (SAME_DAY, STANDARD) - ThreeDSData: add eci, authenticationStatusReason, trustedListing - TrustedListing: new type (status, source) - PaymentRetryRequest: refactor to nest dunning/downtime; deprecate old flat fields - DunningRetryRequest, DowntimeRetryRequest: new - RequestIdSource, RequestCustomerSource: add billingAddress, phone, allowUpdate - PaymentRequest, HostedPaymentRequest, PaymentLinkRequest: deprecate paymentIp - PayoutRequest: add segment (PaymentSegment) per BankPayoutRequest schema - PayPalResponseSource: new (registered in GsonSerializer) - Link: add mobile (MobileRedirectLink) and qrCode (QrCode) - MobileRedirectLink, QrCode: new types for 202 response redirect/QR - Product: add url - PaymentIndividualSender: deprecate dob (renamed to date_of_birth) - APM sources: align with current swagger (new MandateType; deprecations for bizum.mobileNumber, sofort, trustly; field additions across sources) - Serialization tests added for all new/changed classes --- .../java/com/checkout/GsonSerializer.java | 3 +- src/main/java/com/checkout/common/Link.java | 28 +- .../checkout/common/MobileRedirectLink.java | 33 +++ .../java/com/checkout/common/Product.java | 24 ++ src/main/java/com/checkout/common/QrCode.java | 23 ++ .../checkout/payments/AccommodationData.java | 107 ++++++++ .../checkout/payments/AccommodationGuest.java | 39 +++ .../checkout/payments/AccommodationRoom.java | 28 ++ .../com/checkout/payments/AchServiceType.java | 13 + .../com/checkout/payments/Aggregator.java | 35 +++ .../checkout/payments/PaymentProcessing.java | 143 +++++++++- .../checkout/payments/PaymentRecipient.java | 30 +- .../checkout/payments/ProcessingSettings.java | 214 ++++++++++++++- .../com/checkout/payments/ThreeDSData.java | 64 +++++ .../com/checkout/payments/TrustedListing.java | 20 ++ .../payments/hosted/HostedPaymentRequest.java | 136 ++++++++++ .../payments/links/PaymentLinkRequest.java | 126 +++++++++ .../request/DowntimeRetryRequest.java | 20 ++ .../payments/request/DunningRetryRequest.java | 35 +++ .../payments/request/PaymentRequest.java | 164 ++++++++++- .../payments/request/PaymentRetryRequest.java | 28 ++ .../payments/request/PayoutRequest.java | 56 ++++ .../request/source/AbstractRequestSource.java | 4 + .../PayoutRequestCurrencyAccountSource.java | 4 + .../source/PayoutRequestEntitySource.java | 6 +- .../request/source/PayoutRequestSource.java | 8 + .../source/RequestBankAccountSource.java | 24 ++ .../request/source/RequestCardSource.java | 40 +++ .../request/source/RequestCustomerSource.java | 39 ++- .../request/source/RequestIdSource.java | 56 +++- .../source/RequestNetworkTokenSource.java | 52 ++++ .../source/RequestProviderTokenSource.java | 12 + .../request/source/RequestTokenSource.java | 24 ++ .../request/source/apm/MandateType.java | 13 + .../request/source/apm/RequestAchSource.java | 27 +- .../source/apm/RequestAfterPaySource.java | 4 + .../request/source/apm/RequestAlmaSource.java | 4 + .../source/apm/RequestBancontactSource.java | 17 ++ .../source/apm/RequestBizumSource.java | 8 +- .../source/apm/RequestCvConnectSource.java | 4 + .../request/source/apm/RequestEpsSource.java | 8 + .../source/apm/RequestFawrySource.java | 43 ++- .../source/apm/RequestGiropaySource.java | 18 ++ .../source/apm/RequestIdealSource.java | 9 + .../source/apm/RequestIllicadoSource.java | 4 + .../source/apm/RequestKlarnaSource.java | 6 +- .../request/source/apm/RequestKnetSource.java | 44 +++ .../source/apm/RequestMultiBancoSource.java | 13 + .../request/source/apm/RequestP24Source.java | 17 ++ .../source/apm/RequestPayPalSource.java | 4 + .../source/apm/RequestPlaidSource.java | 10 +- .../source/apm/RequestPostFinanceSource.java | 12 + .../request/source/apm/RequestQPaySource.java | 17 ++ .../request/source/apm/RequestSepaSource.java | 49 +++- .../source/apm/RequestSequraSource.java | 6 +- .../source/apm/RequestSofortSource.java | 13 + .../source/apm/RequestSwishSource.java | 12 + .../source/apm/RequestTamaraSource.java | 4 + .../source/apm/RequestTrustlySource.java | 9 + .../source/apm/RequestWeChatPaySource.java | 4 + .../response/source/PayPalResponseSource.java | 44 +++ .../sender/PaymentIndividualSender.java | 9 +- .../AccommodationDataSerializationTest.java | 165 +++++++++++ .../PaymentProcessingSerializationTest.java | 228 ++++++++++++++++ .../ProcessingSettingsSerializationTest.java | 205 ++++++++++++++ .../ThreeDSDataSerializationTest.java | 148 ++++++++++ ...HostedPaymentRequestSerializationTest.java | 222 +++++++++++++++ .../PaymentLinkRequestSerializationTest.java | 216 +++++++++++++++ .../PaymentRequestSerializationTest.java | 256 ++++++++++++++++++ .../PaymentRetryRequestSerializationTest.java | 126 +++++++++ .../PayoutRequestSerializationTest.java | 156 +++++++++++ ...equestCustomerSourceSerializationTest.java | 148 ++++++++++ .../RequestIdSourceSerializationTest.java | 172 ++++++++++++ .../RequestSepaSourceSerializationTest.java | 170 ++++++++++++ ...PayPalResponseSourceSerializationTest.java | 98 +++++++ 75 files changed, 4344 insertions(+), 36 deletions(-) create mode 100644 src/main/java/com/checkout/common/MobileRedirectLink.java create mode 100644 src/main/java/com/checkout/common/QrCode.java create mode 100644 src/main/java/com/checkout/payments/AccommodationData.java create mode 100644 src/main/java/com/checkout/payments/AccommodationGuest.java create mode 100644 src/main/java/com/checkout/payments/AccommodationRoom.java create mode 100644 src/main/java/com/checkout/payments/AchServiceType.java create mode 100644 src/main/java/com/checkout/payments/Aggregator.java create mode 100644 src/main/java/com/checkout/payments/TrustedListing.java create mode 100644 src/main/java/com/checkout/payments/request/DowntimeRetryRequest.java create mode 100644 src/main/java/com/checkout/payments/request/DunningRetryRequest.java create mode 100644 src/main/java/com/checkout/payments/request/source/apm/MandateType.java create mode 100644 src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java create mode 100644 src/test/java/com/checkout/payments/AccommodationDataSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/PaymentProcessingSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/ProcessingSettingsSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/hosted/HostedPaymentRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/links/PaymentLinkRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/PaymentRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/PaymentRetryRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/PayoutRequestSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/source/RequestCustomerSourceSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/source/RequestIdSourceSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/request/source/apm/RequestSepaSourceSerializationTest.java create mode 100644 src/test/java/com/checkout/payments/response/source/PayPalResponseSourceSerializationTest.java diff --git a/src/main/java/com/checkout/GsonSerializer.java b/src/main/java/com/checkout/GsonSerializer.java index 5f9b3db8..f40577af 100644 --- a/src/main/java/com/checkout/GsonSerializer.java +++ b/src/main/java/com/checkout/GsonSerializer.java @@ -161,7 +161,8 @@ public final class GsonSerializer implements Serializer { // Payments - source .registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(com.checkout.payments.response.source.ResponseSource.class, CheckoutUtils.TYPE, true, com.checkout.payments.response.source.AlternativePaymentSourceResponse.class) .registerSubtype(com.checkout.payments.response.source.CardResponseSource.class, identifier(PaymentSourceType.CARD)) - .registerSubtype(com.checkout.payments.response.source.CurrencyAccountResponseSource.class, identifier(PaymentSourceType.CURRENCY_ACCOUNT))) + .registerSubtype(com.checkout.payments.response.source.CurrencyAccountResponseSource.class, identifier(PaymentSourceType.CURRENCY_ACCOUNT)) + .registerSubtype(com.checkout.payments.response.source.PayPalResponseSource.class, identifier(PaymentSourceType.PAYPAL))) // Payment Contexts .registerTypeAdapterFactory(RuntimeTypeAdapterFactory.of(com.checkout.payments.response.source.contexts.ResponseSource.class, CheckoutUtils.TYPE, true, com.checkout.payments.response.source.contexts.AlternativePaymentSourceResponse.class) .registerSubtype(com.checkout.payments.response.source.contexts.PaymentContextsPayPalResponseSource.class, identifier(PaymentSourceType.PAYPAL)) diff --git a/src/main/java/com/checkout/common/Link.java b/src/main/java/com/checkout/common/Link.java index 92c90c96..df24a212 100644 --- a/src/main/java/com/checkout/common/Link.java +++ b/src/main/java/com/checkout/common/Link.java @@ -1,14 +1,40 @@ package com.checkout.common; +import com.google.gson.annotations.SerializedName; import lombok.Data; @Data public final class Link { + /** + * The link URL. + * [Optional] + */ private final String href; + /** + * The link title. + * [Optional] + */ private final String title; + /** + * The link relation type. + * [Optional] + */ private final String link; -} \ No newline at end of file + /** + * Mobile deep-link redirect URLs for Android and iOS redirect payments. + * [Optional] + */ + private MobileRedirectLink mobile; + + /** + * QR code data for redirect payments. + * [Optional] + */ + @SerializedName("qr_code") + private QrCode qrCode; + +} diff --git a/src/main/java/com/checkout/common/MobileRedirectLink.java b/src/main/java/com/checkout/common/MobileRedirectLink.java new file mode 100644 index 00000000..1b2911c0 --- /dev/null +++ b/src/main/java/com/checkout/common/MobileRedirectLink.java @@ -0,0 +1,33 @@ +package com.checkout.common; + +import lombok.Data; + +/** + * Mobile deep-link redirect URLs returned in 202 payment response _links.redirect. + */ +@Data +public final class MobileRedirectLink { + + /** + * The Android deep-link redirect URL. + * [Optional] + */ + private PlatformLink android; + + /** + * The iOS deep-link redirect URL. + * [Optional] + */ + private PlatformLink ios; + + @Data + public static final class PlatformLink { + + /** + * The deep-link URL. + * [Optional] + */ + private String href; + } + +} diff --git a/src/main/java/com/checkout/common/Product.java b/src/main/java/com/checkout/common/Product.java index a34be0b1..2f9fcc20 100644 --- a/src/main/java/com/checkout/common/Product.java +++ b/src/main/java/com/checkout/common/Product.java @@ -3,17 +3,41 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; @Data @Builder +@NoArgsConstructor @AllArgsConstructor public final class Product { + /** + * The name of the product. + * [Optional] + */ private String name; + /** + * The quantity of the product. + * [Optional] + */ private Long quantity; + /** + * The price of the product in minor currency units. + * [Optional] + */ private Long price; + /** + * A reference you can use to identify the product. + * [Optional] + */ private String reference; + + /** + * The URL of the product. + * [Optional] + */ + private String url; } diff --git a/src/main/java/com/checkout/common/QrCode.java b/src/main/java/com/checkout/common/QrCode.java new file mode 100644 index 00000000..4039bf51 --- /dev/null +++ b/src/main/java/com/checkout/common/QrCode.java @@ -0,0 +1,23 @@ +package com.checkout.common; + +import lombok.Data; + +/** + * QR code data returned for payment methods that require a QR code scan, in 202 responses. + */ +@Data +public final class QrCode { + + /** + * The QR code as a base64-encoded image. + * [Optional] + */ + private String image; + + /** + * The raw text encoded in the QR code. + * [Optional] + */ + private String text; + +} diff --git a/src/main/java/com/checkout/payments/AccommodationData.java b/src/main/java/com/checkout/payments/AccommodationData.java new file mode 100644 index 00000000..def5edf6 --- /dev/null +++ b/src/main/java/com/checkout/payments/AccommodationData.java @@ -0,0 +1,107 @@ +package com.checkout.payments; + +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +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; +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AccommodationData { + + /** + * The name of the accommodation property. + * [Optional] + */ + private String name; + + /** + * The booking reference for this accommodation. + * [Optional] + */ + @SerializedName("booking_reference") + private String bookingReference; + + /** + * The check-in date. + * [Optional] + * Format: date (yyyy-MM-dd) + */ + @SerializedName("check_in_date") + private LocalDate checkInDate; + + /** + * The check-out date. + * [Optional] + * Format: date (yyyy-MM-dd) + */ + @SerializedName("check_out_date") + private LocalDate checkOutDate; + + /** + * The address of the accommodation property. + * [Optional] + */ + private Address address; + + /** + * The state or region code where the property is located, as an ISO 3166-1 alpha-2 code. + * [Optional] + */ + private CountryCode state; + + /** + * The country where the property is located, as an ISO 3166-1 alpha-2 code. + * [Optional] + */ + private CountryCode country; + + /** + * The city where the property is located. + * [Optional] + */ + private String city; + + /** + * The number of rooms booked. + * [Optional] + */ + @SerializedName("number_of_rooms") + private Integer numberOfRooms; + + /** + * The list of guests for this booking. + * [Optional] + */ + private List guests; + + /** + * The room details for this booking. + * [Optional] + */ + private List room; + + /** + * The property's phone numbers. + * [Optional] + */ + @SerializedName("property_phone") + private List propertyPhone; + + /** + * The customer service phone numbers for the property. + * [Optional] + */ + @SerializedName("customer_service_phone") + private List customerServicePhone; + +} diff --git a/src/main/java/com/checkout/payments/AccommodationGuest.java b/src/main/java/com/checkout/payments/AccommodationGuest.java new file mode 100644 index 00000000..23129b59 --- /dev/null +++ b/src/main/java/com/checkout/payments/AccommodationGuest.java @@ -0,0 +1,39 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AccommodationGuest { + + /** + * The guest's first name. + * [Optional] + */ + @SerializedName("first_name") + private String firstName; + + /** + * The guest's last name. + * [Optional] + */ + @SerializedName("last_name") + private String lastName; + + /** + * The guest's date of birth. + * [Optional] + * Format: date (yyyy-MM-dd) + */ + @SerializedName("date_of_birth") + private LocalDate dateOfBirth; + +} diff --git a/src/main/java/com/checkout/payments/AccommodationRoom.java b/src/main/java/com/checkout/payments/AccommodationRoom.java new file mode 100644 index 00000000..47d93a2e --- /dev/null +++ b/src/main/java/com/checkout/payments/AccommodationRoom.java @@ -0,0 +1,28 @@ +package com.checkout.payments; + +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 AccommodationRoom { + + /** + * The room rate amount. + * [Optional] + */ + private String rate; + + /** + * The number of nights at the specified room rate. + * [Optional] + */ + @SerializedName("number_of_nights_at_room_rate") + private String numberOfNightsAtRoomRate; + +} diff --git a/src/main/java/com/checkout/payments/AchServiceType.java b/src/main/java/com/checkout/payments/AchServiceType.java new file mode 100644 index 00000000..162b03a7 --- /dev/null +++ b/src/main/java/com/checkout/payments/AchServiceType.java @@ -0,0 +1,13 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; + +public enum AchServiceType { + + @SerializedName("same_day") + SAME_DAY, + + @SerializedName("standard") + STANDARD + +} diff --git a/src/main/java/com/checkout/payments/Aggregator.java b/src/main/java/com/checkout/payments/Aggregator.java new file mode 100644 index 00000000..4a599248 --- /dev/null +++ b/src/main/java/com/checkout/payments/Aggregator.java @@ -0,0 +1,35 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * Information about the payment aggregator. + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class Aggregator { + + /** + * The sub-merchant ID. + */ + @SerializedName("sub_merchant_id") + private String subMerchantId; + + /** + * The Visa identifier for the payment aggregator. + */ + @SerializedName("aggregator_id_visa") + private String aggregatorIdVisa; + + /** + * The Mastercard identifier for the payment aggregator. + */ + @SerializedName("aggregator_id_mc") + private String aggregatorIdMc; +} diff --git a/src/main/java/com/checkout/payments/PaymentProcessing.java b/src/main/java/com/checkout/payments/PaymentProcessing.java index 6bf3ed27..c01a978a 100644 --- a/src/main/java/com/checkout/payments/PaymentProcessing.java +++ b/src/main/java/com/checkout/payments/PaymentProcessing.java @@ -9,91 +9,226 @@ @Data public final class PaymentProcessing { + /** + * A unique identifier for the authorization submitted to the card scheme during processing. + * [Optional] + */ @SerializedName("retrieval_reference_number") private String retrievalReferenceNumber; + /** + * A unique identifier for the transaction generated by the acquirer. + * [Optional] + */ @SerializedName("acquirer_transaction_id") private String acquirerTransactionId; + /** + * The name of the acquirer that processed the payment. + * [Optional] + */ @SerializedName("acquirer_name") private String acquirerName; + /** + * The two-letter ISO country code of the acquirer country. + * [Optional] + */ @SerializedName("acquirer_country_code") private CountryCode acquirerCountryCode; + /** + * A code representing the recommended follow-up action for the payment, as provided by Checkout.com. + * [Optional] + */ @SerializedName("recommendation_code") private String recommendationCode; - + + /** + * The scheme the transaction was processed with. + * [Optional] + */ private String scheme; - @SerializedName("partner_merchant_advice_code") + /** + * The Merchant Advice Code (MAC) provided by Mastercard with additional transaction information. + * [Optional] + */ + @SerializedName("partner_merchant_advice_code") private String partnerMerchantAdviceCode; - + + /** + * The original authorization response code sent by the scheme (raw response code). + * [Optional] + */ @SerializedName("partner_response_code") private String partnerResponseCode; + /** + * Unique order identification of an Afterpay payment. + * [Optional] + */ @SerializedName("partner_order_id") private String partnerOrderId; + /** + * The partner session identifier associated with the payment. + * [Optional] + */ @SerializedName("partner_session_id") private String partnerSessionId; + /** + * The client token returned by the partner for client-side initialization. + * [Optional] + */ @SerializedName("partner_client_token") private String partnerClientToken; + /** + * Unique identification of a payment provided by partner. + * [Optional] + */ @SerializedName("partner_payment_id") private String partnerPaymentId; + /** + * The type of Primary Account Number (PAN) used: fpan (full card) or dpan (network token). + * [Optional] + * Enum: "fpan" "dpan" + */ @SerializedName("pan_type_processed") private PanProcessedType panTypeProcessed; + /** + * A payload used to continue processing for multi-step payment flows. + * [Optional] + */ @SerializedName("continuation_payload") private String continuationPayload; + /** + * The Payment Unique Number (PUN) assigned to the payment. + * [Optional] + */ private String pun; + /** + * The status of the payment as reported by the partner. + * [Optional] + */ @SerializedName("partner_status") private String partnerStatus; + /** + * Unique transaction identification provided by partner. + * [Optional] + */ @SerializedName("partner_transaction_id") private String partnerTransactionId; + /** + * Error codes provided by the partner for a failed or declined payment. + * [Optional] + */ @SerializedName("partner_error_codes") private List partnerErrorCodes; + /** + * Error description provided by the partner. + * [Optional] + */ @SerializedName("partner_error_message") private String partnerErrorMessage; + /** + * Authorization code provided by the partner. + * [Optional] + */ @SerializedName("partner_authorization_code") private String partnerAuthorizationCode; + /** + * Authorization response code provided by the partner. + * [Optional] + */ @SerializedName("partner_authorization_response_code") private String partnerAuthorizationResponseCode; - + + /** + * Surcharge amount applied to the transaction in minor currency units. + * [Optional] + */ @SerializedName("surcharge_amount") private Long surchargeAmount; + /** + * Indicates whether a Checkout.com Network Token was available for the payment. + * [Optional] + */ @SerializedName("cko_network_token_available") private Boolean ckoNetworkTokenAvailable; + /** + * The country where the purchase was made. ISO 3166-1 alpha-2 country code. + * [Optional] + * max 2 characters + */ @SerializedName("purchase_country") private CountryCode purchaseCountry; + /** + * The merchant identifier configured with the scheme and used for the payment. + * [Optional] + */ @SerializedName("scheme_merchant_id") private String schemeMerchantId; + /** + * The foreign retailer amount applied by the merchant, in minor currency units. + * [Optional] + */ @SerializedName("foreign_retailer_amount") private Long foreignRetailerAmount; + /** + * Indicates whether a network token should be provisioned for the payment. + * [Optional] + */ @SerializedName("provision_network_token") private Boolean provisionNetworkToken; + /** + * The merchant category code (MCC) associated with the payment. + * [Optional] + */ @SerializedName("merchant_category_code") private String merchantCategoryCode; + /** + * Indicates whether this is an Account Funding Transaction (AFT). + * [Optional] + */ private Boolean aft; + /** + * The Bizum payment identifier returned when processing a Bizum payment. + * [Optional] + */ @SerializedName("bizum_payment_id") private String bizumPaymentId; + /** + * A reconciliation identifier for the payment. + * [Optional] + */ + @SerializedName("reconciliation_id") + private String reconciliationId; + + /** + * The aggregator information for this payment. + * [Optional] + */ + private Aggregator aggregator; + } diff --git a/src/main/java/com/checkout/payments/PaymentRecipient.java b/src/main/java/com/checkout/payments/PaymentRecipient.java index 8d006a19..6479a6dc 100644 --- a/src/main/java/com/checkout/payments/PaymentRecipient.java +++ b/src/main/java/com/checkout/payments/PaymentRecipient.java @@ -9,19 +9,47 @@ @Builder public final class PaymentRecipient { + /** + * The recipient's date of birth. + * [Optional] + * Format: yyyy-MM-dd + */ @SerializedName("dob") private String dateOfBirth; + /** + * Any identifier related to the primary recipient's account, such as part of the PAN, + * an IBAN, an internal account number, or a phone number. + * [Optional] + */ @SerializedName("account_number") private String accountNumber; + /** + * The recipient's address. + * [Optional] + */ private Address address; + /** + * The first part of the UK postcode (e.g., SW1A 1AA would be SW1A). Replaced by address.zip. + * [Optional] + * @deprecated Use {@code address.zip} instead. + */ + @Deprecated private String zip; + /** + * The recipient's first name. + * [Optional] + */ @SerializedName("first_name") private String firstName; + /** + * The recipient's last name. + * [Optional] + */ @SerializedName("last_name") private String lastName; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/ProcessingSettings.java b/src/main/java/com/checkout/payments/ProcessingSettings.java index d1642032..a7e221cd 100644 --- a/src/main/java/com/checkout/payments/ProcessingSettings.java +++ b/src/main/java/com/checkout/payments/ProcessingSettings.java @@ -19,116 +19,326 @@ @AllArgsConstructor public final class ProcessingSettings { + /** + * The cardholder-provided purchase order or invoice number. + * [Optional] + * max 15 characters + */ @SerializedName("order_id") private String orderId; + /** + * The total amount of sales tax on the total purchase amount. + * [Optional] + */ @SerializedName("tax_amount") private Long taxAmount; + /** + * The surcharge amount applied to the transaction in minor currency units by the merchant. + * [Optional] + */ + @SerializedName("surcharge_amount") + private Long surchargeAmount; + + /** + * The discount amount applied to the transaction by the merchant. + * [Optional] + */ @SerializedName("discount_amount") private Long discountAmount; + /** + * The total charges for any import or export duty included in the transaction. + * [Optional] + */ @SerializedName("duty_amount") private Long dutyAmount; + /** + * The total freight or shipping and handling charges for the transaction. + * [Optional] + */ @SerializedName("shipping_amount") private Long shippingAmount; + /** + * The tax amount on the freight or shipping and handling charges for the transaction. + * [Optional] + */ @SerializedName("shipping_tax_amount") private Long shippingTaxAmount; + /** + * Indicates if the payment is an Account Funding Transaction (AFT). + * [Optional] + */ private boolean aft; + /** + * The preferred scheme for co-badged card payment processing. + * [Optional] + * Enum: "mastercard" "visa" "cartes_bancaires" + */ @SerializedName("preferred_scheme") private PreferredSchema preferredScheme; + /** + * Indicates the reason for a merchant-initiated payment request. + * [Optional] + * Enum: "Delayed_charge" "Resubmission" "No_show" "Reauthorization" + */ @SerializedName("merchant_initiated_reason") private MerchantInitiatedReason merchantInitiatedReason; + /** + * Unique number of the campaign this payment will run in. Required for Afterpay campaign invoices. + * [Optional] + */ @SerializedName("campaign_id") private Long campaignId; + /** + * The product type of the payment. Required for wechatpay and sequra; optional for tamara. + * [Optional] + */ @SerializedName("product_type") private ProductType productType; + /** + * The OpenID obtained from WeChat Web Authorization API. Required for Official Account or Mini Program payments. + * [Optional] + */ @SerializedName("open_id") private String openId; + /** + * The original order amount when a payment is split. Indicates the full order price. + * [Optional] + */ @SerializedName("original_order_amount") private Long originalOrderAmount; + /** + * Merchant receipt ID. + * [Optional] + * max 32 characters + */ @SerializedName("receipt_id") private String receiptId; + /** + * The client-side terminal type: APP, WAP (mobile browser), or WEB (PC browser). + * [Optional] + * Enum: "APP" "WAP" "WEB" + */ @SerializedName("terminal_type") private TerminalType terminalType; + /** + * The operating system type. Required when terminal_type is not WEB. + * [Optional] + * Enum: "ANDROID" "IOS" + */ @SerializedName("os_type") private OsType osType; + /** + * Invoice ID number. + * [Optional] + * max 127 characters + */ @SerializedName("invoice_id") private String invoiceId; + /** + * The label that overrides the business name in the PayPal account on PayPal pages. + * [Optional] + * max 127 characters + */ @SerializedName("brand_name") private String brandName; + /** + * The language and region of the customer in ISO 639-2 format (e.g. en-US). + * [Optional] + * Pattern: ^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}))?$ + * min 2 characters, max 10 characters + */ private String locale; + /** + * Shipping preference for PayPal payments. + * [Optional] + * Enum: "no_shipping" "set_provided_address" "get_from_file" + */ @SerializedName("shipping_preference") private ShippingPreference shippingPreference; + /** + * Property required by PayPal to determine the appropriate payment flow. + * [Optional] + * Enum: "pay_now" "continue" + */ @SerializedName("user_action") private UserAction userAction; + /** + * An array of key-value pairs with merchant-specific transaction context data for PayPal. + * [Optional] + */ @SerializedName("set_transaction_context") private List> setTransactionContext; + /** + * Airline ticket and flight information for the payment. + * [Optional] + */ @SerializedName("airline_data") private List airlineData; + /** + * The accommodation data for hotel or lodging payments. + * [Optional] + */ + @SerializedName("accommodation_data") + private List accommodationData; + + /** + * A one-time password value for OTP-based payment flows. + * [Optional] + */ @SerializedName("otp_value") private String otpValue; + /** + * The two-letter ISO country code of the purchase country. + * [Optional] + * max 2 characters + */ @SerializedName("purchase_country") private CountryCode purchaseCountry; + /** + * Custom payment method IDs (Klarna promo codes) defining which payment options to show. + * [Optional] + */ @SerializedName("custom_payment_method_ids") private List customPaymentMethodIds; + /** + * A URL to notify the customer when the order has been created (used by some APMs). + * [Optional] + */ @SerializedName("merchant_callback_url") private String merchantCallbackUrl; + /** + * The line of business that the payment is associated with. + * [Optional] + */ @SerializedName("line_of_business") private String lineOfBusiness; + /** + * The number of days by which the shipping is delayed. + * [Optional] + */ @SerializedName("shipping_delay") private Long shippingDelay; + /** + * Shipping information for the transaction. + * [Optional] + */ @SerializedName("shipping_info") private List shippingInfo; + /** + * Indicates whether to provision a network token for the payment. + * [Optional] + */ @SerializedName("provision_network_token") private Boolean provisionNetworkToken; + /** + * Specifies the preferred type of Primary Account Number (PAN): fpan or dpan. + * [Optional] + * Enum: "fpan" "dpan" + */ @SerializedName("pan_preference") private PanProcessedType panPreference; + /** + * The ACH service type to use for the payment when source.type is ach. + * [Optional] + * Enum: "same_day" "standard" + */ + @SerializedName("service_type") + private AchServiceType serviceType; + + /** + * The foreign retailer amount the merchant applied to the transaction, in minor currency units. + * [Optional] + */ + @SerializedName("foreign_retailer_amount") + private Long foreignRetailerAmount; + + /** + * A reconciliation identifier for the payment. + * [Optional] + */ + @SerializedName("reconciliation_id") + private String reconciliationId; + + /** + * The aggregator information for this payment. + * [Optional] + */ + private Aggregator aggregator; + + /** + * The origination country for hub model payments. + * [Optional] + */ @SerializedName("hub_model_origination_country") private CountryCode hubModelOriginationCountry; - //Previous + /** + * DLocal-specific processing settings. Used for Previous API only. + * [Optional] + */ private DLocalProcessingSettings dlocal; + /** + * Sender information. Used for Previous API only. + * [Optional] + */ @SerializedName("senderInformation") private SenderInformation senderInformation; + /** + * Specifies whether to process the payment as credit or debit when a combo card is used. + * [Optional] + * Enum: "credit" "debit" + */ @SerializedName("card_type") private CardType cardType; + /** + * The unique identifier for a Visa-registered ramp provider. Must be alphanumeric. + * [Optional] + * Pattern: ^[a-zA-Z0-9]{1,15}$ + * max 15 characters + */ @SerializedName("affiliate_id") private String affiliateId; + /** + * The affiliate URL. Required if you are a Visa-registered ramp provider operating with affiliates. + * [Optional] + */ @SerializedName("affiliate_url") private String affiliateUrl; -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/ThreeDSData.java b/src/main/java/com/checkout/payments/ThreeDSData.java index 11b0ae05..c8365b09 100644 --- a/src/main/java/com/checkout/payments/ThreeDSData.java +++ b/src/main/java/com/checkout/payments/ThreeDSData.java @@ -8,30 +8,94 @@ @Data public final class ThreeDSData { + /** + * Whether the 3DS authentication was downgraded. + * [Optional] + */ private Boolean downgraded; + /** + * The 3DS enrollment status of the card. + * [Optional] + */ private ThreeDSEnrollmentStatus enrolled; + /** + * The reason for the 3DS upgrade. + * [Optional] + */ @SerializedName("upgrade_reason") private String upgradeReason; + /** + * Whether the 3DS signature is valid. + * [Optional] + */ @SerializedName("signature_valid") private String signatureValid; + /** + * The 3DS authentication response code. + * [Optional] + */ @SerializedName("authentication_response") private String authenticationResponse; + /** + * The 3DS cryptogram (CAVV) for the transaction. + * [Optional] + */ private String cryptogram; + /** + * The 3DS transaction identifier (XID). + * [Optional] + */ private String xid; + /** + * The 3DS protocol version used for authentication. + * [Optional] + */ private String version; + /** + * The 3DS exemption type applied to the payment. + * [Optional] + */ private Exemption exemption; + /** + * The 3DS exemption type that was applied by the issuer. + * [Optional] + */ @SerializedName("exemption_applied") private String exemptionApplied; + /** + * Whether the cardholder was challenged during authentication. + * [Optional] + */ private Boolean challenged; + /** + * The Electronic Commerce Indicator (ECI) value from the 3DS authentication. + * [Optional] + */ + private String eci; + + /** + * The reason for the authentication status result. + * [Optional] + */ + @SerializedName("authentication_status_reason") + private String authenticationStatusReason; + + /** + * The trusted listing status for the cardholder. + * [Optional] + */ + @SerializedName("trusted_listing") + private TrustedListing trustedListing; + } diff --git a/src/main/java/com/checkout/payments/TrustedListing.java b/src/main/java/com/checkout/payments/TrustedListing.java new file mode 100644 index 00000000..bd13e3db --- /dev/null +++ b/src/main/java/com/checkout/payments/TrustedListing.java @@ -0,0 +1,20 @@ +package com.checkout.payments; + +import lombok.Data; + +@Data +public final class TrustedListing { + + /** + * The trusted listing status for the cardholder. + * [Optional] + */ + private String status; + + /** + * The source of the trusted listing entry. + * [Optional] + */ + private String source; + +} diff --git a/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java b/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java index efa5c5bc..5ca103b3 100644 --- a/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java +++ b/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java @@ -30,81 +30,217 @@ @Builder public final class HostedPaymentRequest { + /** + * The three-letter ISO currency code of the payment. + * [Required] + * min 3 characters, max 3 characters + */ private Currency currency; + /** + * The billing information for the payment, including address and phone. + * [Required] + */ private BillingInformation billing; + /** + * For redirect payment methods, overrides the default success redirect URL configured on your account. + * [Required] + * Format: uri + * max 255 characters + */ @SerializedName("success_url") private String successUrl; + /** + * The URL to which the customer should be directed if they cancel the payment. + * [Required] + * Format: uri + * max 255 characters + */ @SerializedName("cancel_url") private String cancelUrl; + /** + * For redirect payment methods, overrides the default failure redirect URL configured on your account. + * [Required] + * Format: uri + * max 255 characters + */ @SerializedName("failure_url") private String failureUrl; + /** + * The payment amount in minor currency units. The exact format depends on the currency. + * [Optional] + * min 0 + */ private Long amount; + /** + * The type of payment. Must be specified for card payments where the cardholder is not present. + * [Optional] + * Enum: "Regular" "Recurring" + */ @Builder.Default @SerializedName("payment_type") private PaymentType paymentType = PaymentType.REGULAR; + /** + * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. + */ + @Deprecated @SerializedName("payment_ip") private String paymentIp; + /** + * An optional description displayed on the customer's statement identifying a purchase. + * [Optional] + */ @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; + /** + * A reference you can use to identify the payment, such as an order number. + * [Optional] + */ private String reference; + /** + * A description of the payment. + * [Optional] + * max 100 characters + */ private String description; + /** + * The merchant name to display to customers on the checkout page. + * [Optional] + */ @SerializedName("display_name") private String displayName; + /** + * The processing channel to be used for the payment. + * [Optional] + * Pattern: ^(pc)_(\w{26})$ + */ @SerializedName("processing_channel_id") private String processingChannelId; + /** + * The amount allocations for marketplace or split payments. + * [Optional] + */ @SerializedName("amount_allocations") private List amountAllocations; + /** + * The customer details. + * [Optional] + */ private CustomerRequest customer; + /** + * The shipping details. + * [Optional] + */ private ShippingDetails shipping; + /** + * The recipient of the payment. Used for financial regulations compliance. + * [Optional] + */ private PaymentRecipient recipient; + /** + * Use the processing object to influence or override data during payment processing. + * [Optional] + */ private ProcessingSettings processing; + /** + * Specifies which payment method options to present to the customer. + * [Optional] + */ @SerializedName("allow_payment_methods") private List allowPaymentMethods; + /** + * Specifies which payment method options to hide from the customer. + * [Optional] + */ @SerializedName("disabled_payment_methods") private List disabledPaymentMethods; + /** + * The line items or products included in the purchase. + * [Optional] + */ private List products; + /** + * The risk assessment configuration for the payment. + * [Optional] + */ private RiskRequest risk; + /** + * The customer retry configuration for failed payments. + * [Optional] + */ @SerializedName("customer_retry") private PaymentRetryRequest customerRetry; + /** + * The sender of the payment. Required for financial regulations in some jurisdictions. + * [Optional] + */ private Sender sender; + /** + * Key-value pairs to store additional information about the transaction. + * [Optional] + */ private Map metadata; + /** + * Creates a translated version of the hosted page in the specified language. + * [Optional] + */ private LocaleType locale; + /** + * The 3D Secure (3DS) authentication configuration for the payment. + * [Optional] + */ @SerializedName("3ds") private ThreeDSRequest threeDS; + /** + * Whether to capture the payment immediately (if applicable). + * [Optional] + */ private Boolean capture; + /** + * The date and time at which the payment should be captured (ISO 8601). + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("capture_on") private Instant captureOn; + /** + * The payment instruction details, such as purpose of payment. + * [Optional] + */ private PaymentInstruction instruction; + /** + * The payment method configuration for stored card and wallet methods. + * [Optional] + */ @SerializedName("payment_method_configuration") private PaymentMethodConfiguration paymentMethodConfiguration; } diff --git a/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java b/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java index 86ccbbf6..8dd8bde5 100644 --- a/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java +++ b/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java @@ -30,77 +30,203 @@ @Builder public final class PaymentLinkRequest { + /** + * The payment amount in minor currency units. The exact format depends on the currency. + * [Required] + * min 0 + */ private Long amount; + /** + * The three-letter ISO currency code of the payment. + * [Required] + * min 3 characters, max 3 characters + */ private Currency currency; + /** + * The billing information for the payment, including address and phone. + * [Required] + */ private BillingInformation billing; + /** + * The type of payment. Must be specified for card payments where the cardholder is not present. + * [Optional] + * Enum: "Regular" "Recurring" "MOTO" "Installment" "Unscheduled" + */ @SerializedName("payment_type") private PaymentType paymentType; + /** + * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. + */ + @Deprecated @SerializedName("payment_ip") private String paymentIp; + /** + * An optional description displayed on the customer's statement identifying a purchase. + * [Optional] + */ @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; + /** + * A reference you can use to identify the payment, such as an order number. + * [Optional] + */ private String reference; + /** + * A description of the payment. + * [Optional] + * max 100 characters + */ private String description; + /** + * The merchant name to display to customers on the checkout page. + * [Optional] + */ @SerializedName("display_name") private String displayName; + /** + * The processing channel to be used for the payment. + * [Optional] + * Pattern: ^(pc)_(\w{26})$ + */ @SerializedName("processing_channel_id") private String processingChannelId; + /** + * The amount allocations for marketplace or split payments. + * [Optional] + */ @SerializedName("amount_allocations") private List amountAllocations; + /** + * The time for which the Payment Link remains valid, in seconds. + * [Optional] + */ @SerializedName("expires_in") private Integer expiresIn; + /** + * The customer details. + * [Optional] + */ private CustomerRequest customer; + /** + * The shipping details. + * [Optional] + */ private ShippingDetails shipping; + /** + * The recipient of the payment. Used for financial regulations compliance. + * [Optional] + */ private PaymentRecipient recipient; + /** + * Use the processing object to influence or override data during payment processing. + * [Optional] + */ private ProcessingSettings processing; + /** + * Specifies which payment method options to present to the customer. + * [Optional] + */ @SerializedName("allow_payment_methods") private List allowPaymentMethods; + /** + * Specifies which payment method options to hide from the customer. + * [Optional] + */ @SerializedName("disabled_payment_methods") private List disabledPaymentMethods; + /** + * The line items or products included in the purchase. + * [Optional] + */ private List products; + /** + * Key-value pairs to store additional information about the transaction. + * [Optional] + */ private Map metadata; + /** + * The 3D Secure (3DS) authentication configuration for the payment. + * [Optional] + */ @SerializedName("3ds") private ThreeDSRequest threeDS; + /** + * The risk assessment configuration for the payment. + * [Optional] + */ private RiskRequest risk; + /** + * The customer retry configuration for failed payments. + * [Optional] + */ @SerializedName("customer_retry") private PaymentRetryRequest customerRetry; + /** + * The sender of the payment. Required for financial regulations in some jurisdictions. + * [Optional] + */ private PaymentSender sender; + /** + * If provided, the success page will include a button that redirects the customer to this URL. + * [Optional] + */ @SerializedName("return_url") private String returnUrl; + /** + * Creates a translated version of the hosted page in the specified language. + * [Optional] + */ private LocaleType locale; + /** + * Whether to capture the payment immediately (if applicable). + * [Optional] + */ private boolean capture; + /** + * The date and time at which the payment should be captured (ISO 8601). + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("capture_on") private Instant captureOn; + /** + * The payment instruction details, such as purpose of payment. + * [Optional] + */ private PaymentInstruction instruction; + /** + * The payment method configuration for stored card and wallet methods. + * [Optional] + */ @SerializedName("payment_method_configuration") private PaymentMethodConfiguration paymentMethodConfiguration; } diff --git a/src/main/java/com/checkout/payments/request/DowntimeRetryRequest.java b/src/main/java/com/checkout/payments/request/DowntimeRetryRequest.java new file mode 100644 index 00000000..422ace8d --- /dev/null +++ b/src/main/java/com/checkout/payments/request/DowntimeRetryRequest.java @@ -0,0 +1,20 @@ +package com.checkout.payments.request; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public final class DowntimeRetryRequest { + + /** + * Whether downtime retries are enabled. + * [Optional] + */ + private Boolean enabled; + +} diff --git a/src/main/java/com/checkout/payments/request/DunningRetryRequest.java b/src/main/java/com/checkout/payments/request/DunningRetryRequest.java new file mode 100644 index 00000000..d11fea1a --- /dev/null +++ b/src/main/java/com/checkout/payments/request/DunningRetryRequest.java @@ -0,0 +1,35 @@ +package com.checkout.payments.request; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public final class DunningRetryRequest { + + /** + * Whether dunning retries are enabled. + * [Optional] + */ + private Boolean enabled; + + /** + * The maximum number of retry attempts. + * [Optional] + */ + @SerializedName("max_attempts") + private Integer maxAttempts; + + /** + * The number of days after which retries stop. + * [Optional] + */ + @SerializedName("end_after_days") + private Integer endAfterDays; + +} diff --git a/src/main/java/com/checkout/payments/request/PaymentRequest.java b/src/main/java/com/checkout/payments/request/PaymentRequest.java index 0abe92b8..f48171e7 100644 --- a/src/main/java/com/checkout/payments/request/PaymentRequest.java +++ b/src/main/java/com/checkout/payments/request/PaymentRequest.java @@ -30,120 +30,264 @@ @Data @Builder public final class PaymentRequest { - + + /** + * The unique identifier of a Payment Context. Used to initiate a payment from a context. + * [Optional] + */ @SerializedName("payment_context_id") private String paymentContextId; + /** + * The source of the payment. Discriminated by type. + * [Optional] + */ private AbstractRequestSource source; + /** + * The payment amount in minor currency units. To perform a card verification, do not provide + * the amount or provide a value of 0. + * [Optional] + * min 0 + */ private Long amount; + /** + * The three-letter ISO currency code of the payment. + * [Required] + * min 3 characters, max 3 characters + */ private Currency currency; + /** + * The type of payment. Required for card payments where the cardholder is not present, + * such as recurring or MOTO payments. For MITs, must not be set to Regular. + * [Optional] + * Enum: "Regular" "Recurring" "MOTO" "Installment" "PayLater" "Unscheduled" + */ @Builder.Default @SerializedName("payment_type") private PaymentType paymentType = PaymentType.REGULAR; + /** + * The details of a recurring subscription or installment. + * [Optional] + */ @SerializedName("payment_plan") private PaymentPlan paymentPlan; + /** + * Whether the payment is a merchant-initiated transaction (MIT). + * Must be set to true for all MITs. If true, payment_type must not be Regular. + * [Optional] + */ @SerializedName("merchant_initiated") private Boolean merchantInitiated; + /** + * A reference you can use to identify the payment, such as an order number. + * [Optional] + * max 80 characters + */ private String reference; + /** + * A description of the payment. + * [Optional] + * max 100 characters + */ private String description; + /** + * Information required to authenticate the payment. + * [Optional] + */ private Authentication authentication; + /** + * The authorization type for the payment. + * [Optional] + * Enum: "Final" "Estimated" + */ @SerializedName("authorization_type") private AuthorizationType authorizationType; + /** + * The partial authorization configuration for the payment. + * [Optional] + */ @SerializedName("partial_authorization") private PartialAuthorization partialAuthorization; + /** + * Whether to capture the payment immediately (if applicable). + * [Optional] + */ private Boolean capture; + /** + * A timestamp (ISO 8601) that determines when the payment should be captured. + * Providing this field will automatically set capture to true. + * [Optional] + * Format: date-time (RFC 3339) + */ @SerializedName("capture_on") private Instant captureOn; /** * The date and time when the Multibanco payment expires in UTC. - *

* [Optional] - *

* Format: date-time (ISO 8601) */ @SerializedName("expire_on") private Instant expireOn; + /** + * The customer details for the payment. + * [Optional] + */ private CustomerRequest customer; + /** + * An optional description displayed on the customer's statement identifying a purchase. + * [Optional] + */ @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; + /** + * The shipping details for the payment. + * [Optional] + */ private ShippingDetails shipping; + /** + * Information required for 3D Secure authentication payments. + * [Optional] + */ @SerializedName("3ds") private ThreeDSRequest threeDS; + /** + * The processing channel to be used for the payment. + * [Optional] + * Pattern: ^(pc)_(\w{26})$ + */ @SerializedName("processing_channel_id") private String processingChannelId; + /** + * An identifier that links the payment to an existing series of payments. + * Only pass this field for merchant-initiated transactions (MITs) in a recurring payment series. + * [Optional] + * max 100 characters + */ @SerializedName("previous_payment_id") private String previousPaymentId; + /** + * The risk assessment configuration for the payment. + * [Optional] + */ private RiskRequest risk; + /** + * For redirect payment methods, overrides the default success redirect URL configured on your account. + * [Optional] + * Format: uri + * max 1024 characters + */ @SerializedName("success_url") private String successUrl; + /** + * For redirect payment methods, overrides the default failure redirect URL configured on your account. + * [Optional] + * Format: uri + * max 1024 characters + */ @SerializedName("failure_url") private String failureUrl; + /** + * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. + */ + @Deprecated @SerializedName("payment_ip") private String paymentIp; + /** + * The sender of the payment. Required for financial regulations in some jurisdictions. + * [Optional] + */ private PaymentSender sender; + /** + * The recipient of the payment. Used for financial regulations compliance. + * [Optional] + */ private PaymentRecipient recipient; /** - * @deprecated This property will be removed in the future, and should be used - * {@link PaymentRequest#amountAllocations} instead + * @deprecated Use {@link PaymentRequest#amountAllocations} instead. */ @Deprecated private MarketplaceData marketplace; + /** + * The amount allocations for marketplace or split payments. + * [Optional] + */ @SerializedName("amount_allocations") private List amountAllocations; + /** + * Use the processing object to influence or override data during payment processing. + * [Optional] + */ private ProcessingSettings processing; + /** + * The line items or products included in the purchase. + * [Optional] + */ private List items; + /** + * The retry configuration for failed payment attempts. + * [Optional] + */ private PaymentRetryRequest retry; /** - * The details of the subscription. - *

+ * The details of the subscription associated with this payment. * [Optional] - *

*/ private PaymentSubscription subscription; + /** + * Key-value pairs to store additional information about the transaction. + * Supports string, number, and boolean fields. Max 20 fields; each value max 255 characters. + * [Optional] + */ @Builder.Default private Map metadata = new HashMap<>(); + /** + * The segment data for the payment, used for analytics and reporting. + * [Optional] + */ private PaymentSegment segment; + /** + * The payment instruction details, such as purpose of payment. + * [Optional] + */ private PaymentInstruction instruction; /** * Controls processor attempts at the payment level. - *

* [Optional] - *

*/ private PaymentRouting routing; diff --git a/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java b/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java index 9b9a05ee..d3e40ac1 100644 --- a/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java +++ b/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java @@ -12,11 +12,39 @@ @NoArgsConstructor public final class PaymentRetryRequest { + /** + * Configuration of asynchronous Dunning retries. + * [Optional] + */ + private DunningRetryRequest dunning; + + /** + * Configuration of asynchronous Downtime retries. + * [Optional] + */ + private DowntimeRetryRequest downtime; + + // ======================================== + // Deprecated — use dunning.enabled instead + // ======================================== + + /** + * @deprecated Use {@link DunningRetryRequest#enabled} via {@link #dunning} instead. + */ + @Deprecated private Boolean enabled; + /** + * @deprecated Use {@link DunningRetryRequest#maxAttempts} via {@link #dunning} instead. + */ + @Deprecated @SerializedName("max_attempts") private Integer maxAttempts; + /** + * @deprecated Use {@link DunningRetryRequest#endAfterDays} via {@link #dunning} instead. + */ + @Deprecated @SerializedName("end_after_days") private Integer endAfterDays; diff --git a/src/main/java/com/checkout/payments/request/PayoutRequest.java b/src/main/java/com/checkout/payments/request/PayoutRequest.java index cbb7e39f..6296add2 100644 --- a/src/main/java/com/checkout/payments/request/PayoutRequest.java +++ b/src/main/java/com/checkout/payments/request/PayoutRequest.java @@ -15,28 +15,84 @@ @Builder public final class PayoutRequest { + /** + * The source of the payout. Discriminated by type. + * [Required] + */ private PayoutRequestSource source; + /** + * The destination of the payout. Discriminated by type. + * [Required] + */ private PaymentRequestDestination destination; + /** + * The amount to pay out in minor currency units. + * [Optional] + * min 0 + */ private Long amount; + /** + * The three-letter ISO 4217 currency code for the payout currency. + * [Required] + */ private Currency currency; + /** + * A custom reference to identify the payout, such as an order number. + * [Optional] + * max 50 characters + */ private String reference; + /** + * An optional description displayed on the recipient's statement identifying the payout. + * [Optional] + */ @SerializedName("billing_descriptor") private PayoutBillingDescriptor billingDescriptor; + /** + * The sender of the payout. Required for financial regulations in some jurisdictions. + * [Optional] + */ private PaymentSender sender; + /** + * Additional details about the payout instruction, such as purpose of payment. + * [Required] + */ private PaymentInstruction instruction; + /** + * The processing channel to be used for the payout. + * [Required] + * Pattern: ^(pc)_(\w{26})$ + * max 29 characters + */ @SerializedName("processing_channel_id") private String processingChannelId; + /** + * Use the processing object to influence or override data during payout processing. + * [Optional] + */ private ProcessingSettings processing; + /** + * The business segment dimension details for this payout. + * At least one dimension (brand, business_category, or market) required. + * [Optional] + */ + private PaymentSegment segment; + + /** + * Key-value pairs to store additional information about the payout. + * Supports primitive data types only; objects and arrays are not supported. + * [Optional] + */ private Map metadata; } diff --git a/src/main/java/com/checkout/payments/request/source/AbstractRequestSource.java b/src/main/java/com/checkout/payments/request/source/AbstractRequestSource.java index f6f31bde..47e56c89 100644 --- a/src/main/java/com/checkout/payments/request/source/AbstractRequestSource.java +++ b/src/main/java/com/checkout/payments/request/source/AbstractRequestSource.java @@ -6,6 +6,10 @@ @Data public abstract class AbstractRequestSource { + /** + * The payment source type. + * [Required] + */ protected final PaymentSourceType type; protected AbstractRequestSource(final PaymentSourceType type) { diff --git a/src/main/java/com/checkout/payments/request/source/PayoutRequestCurrencyAccountSource.java b/src/main/java/com/checkout/payments/request/source/PayoutRequestCurrencyAccountSource.java index 5446f09c..c8a60c0c 100644 --- a/src/main/java/com/checkout/payments/request/source/PayoutRequestCurrencyAccountSource.java +++ b/src/main/java/com/checkout/payments/request/source/PayoutRequestCurrencyAccountSource.java @@ -12,6 +12,10 @@ @ToString(callSuper = true) public final class PayoutRequestCurrencyAccountSource extends PayoutRequestSource { + /** + * The currency account identifier. + * [Required] + */ private String id; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/PayoutRequestEntitySource.java b/src/main/java/com/checkout/payments/request/source/PayoutRequestEntitySource.java index 8e94e2d1..22efa909 100644 --- a/src/main/java/com/checkout/payments/request/source/PayoutRequestEntitySource.java +++ b/src/main/java/com/checkout/payments/request/source/PayoutRequestEntitySource.java @@ -12,6 +12,10 @@ @ToString(callSuper = true) public final class PayoutRequestEntitySource extends PayoutRequestSource { + /** + * The entity identifier. + * [Required] + */ private String id; @Builder @@ -25,4 +29,4 @@ public PayoutRequestEntitySource() { super(PayoutSourceType.ENTITY); } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/PayoutRequestSource.java b/src/main/java/com/checkout/payments/request/source/PayoutRequestSource.java index cdfdedcf..5aae2188 100644 --- a/src/main/java/com/checkout/payments/request/source/PayoutRequestSource.java +++ b/src/main/java/com/checkout/payments/request/source/PayoutRequestSource.java @@ -7,8 +7,16 @@ @AllArgsConstructor public abstract class PayoutRequestSource { + /** + * The payout source type. + * [Required] + */ protected PayoutSourceType type; + /** + * The amount to debit from the source. If not provided, the full payment amount is used. + * [Optional] + */ protected Long amount; protected PayoutRequestSource(final PayoutSourceType type) { diff --git a/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java b/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java index 87ef573d..2a704345 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java @@ -17,20 +17,44 @@ @ToString(callSuper = true) public final class RequestBankAccountSource extends AbstractRequestSource { + /** + * The payment method to use. For example, "ach". + * [Optional] + */ @SerializedName("payment_method") private String paymentMethod; + /** + * The type of account. + * [Optional] + */ @SerializedName("account_type") private AccountType accountType; + /** + * The two-letter ISO country code of the bank account. + * [Optional] + */ private CountryCode country; + /** + * The account number. + * [Optional] + */ @SerializedName("account_number") private String accountNumber; + /** + * The bank routing code. + * [Optional] + */ @SerializedName("bank_code") private String bankCode; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/RequestCardSource.java b/src/main/java/com/checkout/payments/request/source/RequestCardSource.java index ddd352c0..9e2565d5 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestCardSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestCardSource.java @@ -17,28 +17,68 @@ @ToString(callSuper = true) public final class RequestCardSource extends AbstractRequestSource { + /** + * The card number (without separators). Write-only. + * [Optional] + */ private String number; + /** + * The expiry month of the card. + * [Optional] + */ @SerializedName("expiry_month") private Integer expiryMonth; + /** + * The expiry year of the card. + * [Optional] + */ @SerializedName("expiry_year") private Integer expiryYear; + /** + * The cardholder's name. Write-only. + * [Optional] + */ private String name; + /** + * The card verification value/code. 3 digits, except for American Express (4 digits). Write-only. + * [Optional] + */ private String cvv; + /** + * Set to true for payments that use stored card details. Write-only. + * [Optional] + */ private Boolean stored; + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. + * [Optional] + */ @SerializedName("store_for_future_use") private Boolean storeForFutureUse; + /** + * The payment source owner's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; + /** + * The payment source owner's phone number. + * [Optional] + */ private Phone phone; + /** + * The card account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java b/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java index 55b44694..b11a2bad 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java @@ -1,7 +1,9 @@ package com.checkout.payments.request.source; import com.checkout.common.AccountHolder; +import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; +import com.checkout.common.Phone; import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -15,17 +17,52 @@ @ToString(callSuper = true) public final class RequestCustomerSource extends AbstractRequestSource { + /** + * The unique identifier of an existing customer. + * [Optional] + * Pattern: ^(cus)_(\w{26})$ + */ private String id; + /** + * The customer's billing address. + * [Optional] + */ + @SerializedName("billing_address") + private Address billingAddress; + + /** + * The customer's phone number. + * [Optional] + */ + private Phone phone; + + /** + * The account holder information for the customer. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; + /** + * Whether to update the stored customer information with the data provided. + * [Optional] + */ + @SerializedName("allow_update") + private Boolean allowUpdate; + @Builder private RequestCustomerSource(final String id, - final AccountHolder accountHolder) { + final Address billingAddress, + final Phone phone, + final AccountHolder accountHolder, + final Boolean allowUpdate) { super(PaymentSourceType.CUSTOMER); this.id = id; + this.billingAddress = billingAddress; + this.phone = phone; this.accountHolder = accountHolder; + this.allowUpdate = allowUpdate; } public RequestCustomerSource() { diff --git a/src/main/java/com/checkout/payments/request/source/RequestIdSource.java b/src/main/java/com/checkout/payments/request/source/RequestIdSource.java index aa1c66a8..f0b5e557 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestIdSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestIdSource.java @@ -1,7 +1,9 @@ package com.checkout.payments.request.source; import com.checkout.common.AccountHolder; +import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; +import com.checkout.common.Phone; import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -15,35 +17,87 @@ @ToString(callSuper = true) public final class RequestIdSource extends AbstractRequestSource { + /** + * The payment instrument identifier. + * [Required] + * Pattern: ^(src)_(\w{26})$ + */ private String id; + /** + * The card verification value (CVV) of the card. + * [Optional] + * min 3 characters, max 4 characters + */ private String cvv; + /** + * The payment method to be used. + * [Optional] + */ @SerializedName("payment_method") private String paymentMethod; + /** + * Whether this payment instrument was previously stored for future use. + * [Optional] + */ private Boolean stored; + /** + * Whether to store the payment instrument for future use. + * [Optional] + */ @SerializedName("store_for_future_use") private Boolean storeForFutureUse; + /** + * The billing address associated with the payment instrument. + * [Optional] + */ + @SerializedName("billing_address") + private Address billingAddress; + + /** + * The phone number associated with the payment instrument. + * [Optional] + */ + private Phone phone; + + /** + * The account holder information for the payment instrument. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; + /** + * Whether to update the stored instrument information with the data provided. + * [Optional] + */ + @SerializedName("allow_update") + private Boolean allowUpdate; + @Builder private RequestIdSource(final String id, final String cvv, final String paymentMethod, final Boolean stored, final Boolean storeForFutureUse, - final AccountHolder accountHolder) { + final Address billingAddress, + final Phone phone, + final AccountHolder accountHolder, + final Boolean allowUpdate) { super(PaymentSourceType.ID); this.id = id; this.cvv = cvv; this.paymentMethod = paymentMethod; this.stored = stored; this.storeForFutureUse = storeForFutureUse; + this.billingAddress = billingAddress; + this.phone = phone; this.accountHolder = accountHolder; + this.allowUpdate = allowUpdate; } public RequestIdSource() { diff --git a/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java index 352c2968..15901034 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java @@ -19,35 +19,87 @@ @ToString(callSuper = true) public final class RequestNetworkTokenSource extends AbstractRequestSource { + /** + * The network token value. + * [Optional] + */ private String token; + /** + * The expiry month of the token. + * [Optional] + */ @SerializedName("expiry_month") private Integer expiryMonth; + /** + * The expiry year of the token. + * [Optional] + */ @SerializedName("expiry_year") private Integer expiryYear; + /** + * The network token type. + * [Optional] + */ @SerializedName("token_type") private NetworkTokenType tokenType; + /** + * The cryptogram for the network token (device pan). Required for Visa and Mastercard DPAN payments. + * [Optional] + */ private String cryptogram; + /** + * The Electronic Commerce Indicator (ECI) security level. + * [Optional] + */ private String eci; + /** + * Set to true for payments that use stored card details. Write-only. + * [Optional] + */ private Boolean stored; + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. + * [Optional] + */ @SerializedName("store_for_future_use") private Boolean storeForFutureUse; + /** + * The cardholder's name. Write-only. + * [Optional] + */ private String name; + /** + * The card verification value/code. 3 digits, except for American Express (4 digits). Write-only. + * [Optional] + */ private String cvv; + /** + * The payment source owner's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; + /** + * The payment source owner's phone number. + * [Optional] + */ private Phone phone; + /** + * The card account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java index dbb6c65f..d9a98008 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java @@ -15,11 +15,23 @@ @ToString(callSuper = true) public final class RequestProviderTokenSource extends AbstractRequestSource { + /** + * The payment method to use. + * [Optional] + */ @SerializedName("payment_method") private String paymentMethod; + /** + * The provider token value. + * [Optional] + */ private String token; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java index 07e10fba..ea01fe0e 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java @@ -17,18 +17,42 @@ @ToString(callSuper = true) public final class RequestTokenSource extends AbstractRequestSource { + /** + * The Checkout.com token value. + * [Optional] + */ private String token; + /** + * The payment source owner's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; + /** + * The payment source owner's phone number. + * [Optional] + */ private Phone phone; + /** + * Set to true for payments that use stored card details. Write-only. + * [Optional] + */ private Boolean stored; + /** + * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. + * [Optional] + */ @SerializedName("store_for_future_use") private Boolean storeForFutureUse; + /** + * The card account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/apm/MandateType.java b/src/main/java/com/checkout/payments/request/source/apm/MandateType.java new file mode 100644 index 00000000..08e89309 --- /dev/null +++ b/src/main/java/com/checkout/payments/request/source/apm/MandateType.java @@ -0,0 +1,13 @@ +package com.checkout.payments.request.source.apm; + +import com.google.gson.annotations.SerializedName; + +public enum MandateType { + + @SerializedName("Core") + CORE, + + @SerializedName("B2B") + B2B, + +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java index 231975d5..39ec3dde 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java @@ -18,18 +18,43 @@ @ToString(callSuper = true) public final class RequestAchSource extends AbstractRequestSource { + /** + * The type of Direct Debit account. + * [Required] + * Enum: "savings" "checking" "cash" + */ @SerializedName("account_type") private AccountType accountType; + /** + * The source country as an ISO 3166-1 alpha-2 code. + * [Required] + * min 2 characters, max 2 characters + */ @SerializedName("country") private CountryCode country; + /** + * The account number of the Direct Debit account. + * [Required] + * min 4 characters, max 17 characters + */ @SerializedName("account_number") private String accountNumber; + /** + * The bank code (ABA routing number) of the Direct Debit account. + * [Required] + * min 8 characters, max 9 characters + */ @SerializedName("bank_code") private String bankCode; + /** + * The account holder's personal information. + * Supports date_of_birth and identification (SSN) fields. + * [Required] + */ @SerializedName("account_holder") private AccountHolder accountHolder; @@ -51,4 +76,4 @@ private RequestAchSource( public RequestAchSource() { super(PaymentSourceType.ACH); } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java index c49cfe7c..b4ae4b68 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java @@ -16,6 +16,10 @@ @ToString(callSuper = true) public final class RequestAfterPaySource extends AbstractRequestSource { + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java index 2b58f2d3..812f62ae 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java @@ -16,6 +16,10 @@ @ToString(callSuper = true) public final class RequestAlmaSource extends AbstractRequestSource { + /** + * The customer's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java index f199a370..fd09301e 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java @@ -16,15 +16,32 @@ @ToString(callSuper = true) public final class RequestBancontactSource extends AbstractRequestSource { + /** + * The two-letter ISO country code of the payment. + * [Optional] + */ @SerializedName("payment_country") private CountryCode paymentCountry; + /** + * The account holder's name. + * [Optional] + * min 3 max 100 + */ @SerializedName("account_holder_name") private String accountHolderName; + /** + * A description of the purchase shown on the customer's statement. + * [Optional] + */ @SerializedName("billing_descriptor") private String billingDescriptor; + /** + * The language to display the payment page in. + * [Optional] + */ private String language; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java index eeae284e..dd8b833b 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java @@ -15,6 +15,12 @@ @ToString(callSuper = true) public final class RequestBizumSource extends AbstractRequestSource { + /** + * The customer's mobile number. + * [Optional] + * @deprecated Removed from the API on 2025/02/10. Use the customer object instead. + */ + @Deprecated @SerializedName("mobile_number") private String mobileNumber; @@ -27,4 +33,4 @@ private RequestBizumSource(final String mobileNumber) { public RequestBizumSource() { super(PaymentSourceType.BIZUM); } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java index 4c16b194..c8b07234 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java @@ -16,6 +16,10 @@ @ToString(callSuper = true) public final class RequestCvConnectSource extends AbstractRequestSource { + /** + * The customer's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java index e838fab3..300f56d6 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java @@ -16,8 +16,16 @@ @ToString(callSuper = true) public final class RequestEpsSource extends AbstractRequestSource { + /** + * The purpose of the payment. + * [Optional] + */ private String purpose; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java index a2cb0b09..5d53a09b 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java @@ -21,20 +21,45 @@ @ToString(callSuper = true) public final class RequestFawrySource extends AbstractRequestSource { + /** + * The description of the payment. + * [Optional] + */ private String description; + /** + * The customer's profile ID. + * [Optional] + */ @SerializedName("customer_profile_id") private String customerProfileId; + /** + * The customer's email address. + * [Optional] + */ @SerializedName("customer_email") private String customerEmail; + /** + * The customer's mobile number. + * [Optional] + */ @SerializedName("customer_mobile") private String customerMobile; + /** + * The timestamp after which the payment expires. + * [Optional] + * Format: date-time (ISO 8601) + */ @SerializedName("expires_on") private Instant expiresOn; + /** + * The products included in the order. + * [Optional] + */ private List products; @Builder @@ -63,15 +88,31 @@ public RequestFawrySource() { @AllArgsConstructor public static class Product { + /** + * The product identifier. + * [Optional] + */ @SerializedName("product_id") private String id; + /** + * The quantity of the product. + * [Optional] + */ private Long quantity; + /** + * The price of the product in minor currency units. + * [Optional] + */ private Long price; + /** + * The description of the product. + * [Optional] + */ private String description; } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java index 3378d909..3829fbb1 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java @@ -22,18 +22,26 @@ public final class RequestGiropaySource extends AbstractRequestSource { /** + * The purpose of the payment. + * [Optional] * @deprecated GiroPay doesn't support this field anymore, will be removed in the future */ @Deprecated private String purpose; /** + * Additional information fields for the payment. + * [Optional] * @deprecated GiroPay doesn't support this field anymore, will be removed in the future */ @Deprecated @SerializedName("info_fields") private List infoFields; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; @@ -56,7 +64,17 @@ public RequestGiropaySource() { @NoArgsConstructor @AllArgsConstructor public static class InfoFields { + + /** + * The label for the information field. + * [Optional] + */ private String label; + + /** + * The text content of the information field. + * [Optional] + */ private String text; } diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestIdealSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestIdealSource.java index 69473f41..6427c50b 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestIdealSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestIdealSource.java @@ -14,8 +14,17 @@ @ToString(callSuper = true) public final class RequestIdealSource extends AbstractRequestSource { + /** + * A description of the payment shown to the customer. + * [Optional] + * max 35 characters + */ private String description; + /** + * The language to display the payment page in. + * [Optional] + */ private String language; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestIllicadoSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestIllicadoSource.java index ab836d78..c41cbde1 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestIllicadoSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestIllicadoSource.java @@ -11,6 +11,10 @@ @ToString(callSuper = true) public final class RequestIllicadoSource extends AbstractRequestSource { + /** + * The customer's billing address. + * [Optional] + */ private Address billingAddress; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java index fe2cc1e9..ee4d888d 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java @@ -16,15 +16,17 @@ @ToString(callSuper = true) public final class RequestKlarnaSource extends AbstractRequestSource { + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; - @Builder private RequestKlarnaSource(final AccountHolder accountHolder) { super(PaymentSourceType.KLARNA); this.accountHolder = accountHolder; - } public RequestKlarnaSource() { diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java index fd6efb9a..eeafcc7f 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java @@ -17,34 +17,78 @@ @ToString(callSuper = true) public final class RequestKnetSource extends AbstractRequestSource { + /** + * The language to display the payment page in. + * [Optional] + */ private String language; + /** + * User-defined field 1. + * [Optional] + */ @SerializedName("user_defined_field1") private String userDefinedField1; + /** + * User-defined field 2. + * [Optional] + */ @SerializedName("user_defined_field2") private String userDefinedField2; + /** + * User-defined field 3. + * [Optional] + */ @SerializedName("user_defined_field3") private String userDefinedField3; + /** + * User-defined field 4. + * [Optional] + */ @SerializedName("user_defined_field4") private String userDefinedField4; + /** + * User-defined field 5. + * [Optional] + */ @SerializedName("user_defined_field5") private String userDefinedField5; + /** + * The card token for the payment. + * [Optional] + */ @SerializedName("card_token") private String cardToken; + /** + * The PTLF value. + * [Optional] + */ private String ptlf; + /** + * The type of token. + * [Optional] + */ @SerializedName("token_type") private String tokenType; + /** + * The token data for Apple Pay payments. + * [Optional] + */ @SerializedName("token_data") private ApplePayTokenData tokenData; + /** + * Additional payment method details. + * [Optional] + */ @SerializedName("payment_method_details") private PaymentMethodDetails paymentMethodDetails; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java index f5fc127d..af8ab9aa 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java @@ -16,12 +16,25 @@ @ToString(callSuper = true) public final class RequestMultiBancoSource extends AbstractRequestSource { + /** + * The two-letter ISO country code of the payment. + * [Optional] + */ @SerializedName("payment_country") private CountryCode paymentCountry; + /** + * The account holder's name. + * [Optional] + * min 3 max 100 + */ @SerializedName("account_holder_name") private String accountHolderName; + /** + * A description of the purchase shown on the customer's statement. + * [Optional] + */ @SerializedName("billing_descriptor") private String billingDescriptor; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java b/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java index 0216afb0..e6e780b2 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java @@ -16,15 +16,32 @@ @ToString(callSuper = true) public final class RequestP24Source extends AbstractRequestSource { + /** + * The two-letter ISO country code of the payment. + * [Optional] + */ @SerializedName("payment_country") private CountryCode paymentCountry; + /** + * The account holder's name. + * [Optional] + * min 3 max 100 + */ @SerializedName("account_holder_name") private String accountHolderName; + /** + * The account holder's email address. + * [Optional] + */ @SerializedName("account_holder_email") private String accountHolderEmail; + /** + * A description of the purchase shown on the customer's statement. + * [Optional] + */ @SerializedName("billing_descriptor") private String billingDescriptor; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestPayPalSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestPayPalSource.java index 3d1d2a41..ceec52c7 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestPayPalSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestPayPalSource.java @@ -15,6 +15,10 @@ @ToString(callSuper = true) public final class RequestPayPalSource extends AbstractRequestSource { + /** + * The billing plan details for recurring PayPal payments. + * [Optional] + */ private BillingPlan plan; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java index 730d1537..27a64fa6 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java @@ -16,9 +16,17 @@ @ToString(callSuper = true) public final class RequestPlaidSource extends AbstractRequestSource { + /** + * The Plaid processor token. + * [Optional] + */ @SerializedName("token") private String token; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; @@ -32,4 +40,4 @@ private RequestPlaidSource(final String token, final AccountHolder accountHolder public RequestPlaidSource() { super(PaymentSourceType.PLAID); } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java index 99400a20..171ed2f8 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java @@ -16,12 +16,24 @@ @ToString(callSuper = true) public final class RequestPostFinanceSource extends AbstractRequestSource { + /** + * The two-letter ISO country code of the payment. + * [Optional] + */ @SerializedName("payment_country") private CountryCode paymentCountry; + /** + * The account holder's name. + * [Optional] + */ @SerializedName("account_holder_name") private String accountHolderName; + /** + * A description of the purchase shown on the customer's statement. + * [Optional] + */ @SerializedName("billing_descriptor") private String billingDescriptor; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java index 990c34ba..ef28b1da 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java @@ -15,12 +15,29 @@ @ToString(callSuper = true) public final class RequestQPaySource extends AbstractRequestSource { + /** + * The number of items in the order. + * [Optional] + */ private Integer quantity; + /** + * A description of the payment. + * [Optional] + * max 255 + */ private String description; + /** + * The language to display the payment page in. + * [Optional] + */ private String language; + /** + * The customer's national ID. + * [Optional] + */ @SerializedName("national_id") private String nationalId; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java index 13bbd611..6e6bbebe 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java @@ -1,9 +1,16 @@ package com.checkout.payments.request.source.apm; -import com.checkout.common.*; +import com.checkout.common.AccountHolder; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; import com.google.gson.annotations.SerializedName; -import lombok.*; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; @Getter @Setter @@ -11,22 +18,58 @@ @ToString(callSuper = true) public final class RequestSepaSource extends AbstractRequestSource { + /** + * The account's country, as an ISO 3166-1 alpha-2 code. + * [Required] + */ private CountryCode country; + /** + * The account holder's IBAN. + * [Required] + */ @SerializedName("account_number") private String accountNumber; + /** + * The BIC/SWIFT code of the bank. + * [Optional] + */ @SerializedName("bank_code") private String bankCode; + /** + * The account holder's account currency. + * [Required] + */ private Currency currency; + /** + * The ID of the mandate. + * [Optional] + */ @SerializedName("mandate_id") private String mandateId; + /** + * The type of mandate. + * [Optional] + * Enum: "Core" "B2B" + */ + @SerializedName("mandate_type") + private MandateType mandateType; + + /** + * The date the mandate was signed, in the format yyyy-MM-dd. + * [Optional] + */ @SerializedName("date_of_signature") private String dateOfSignature; + /** + * The account holder's personal information. + * [Required] + */ @SerializedName("account_holder") private AccountHolder accountHolder; @@ -37,6 +80,7 @@ private RequestSepaSource( final String bankCode, final Currency currency, final String mandateId, + final MandateType mandateType, final String dateOfSignature, final AccountHolder accountHolder ) { @@ -46,6 +90,7 @@ private RequestSepaSource( this.bankCode = bankCode; this.currency = currency; this.mandateId = mandateId; + this.mandateType = mandateType; this.dateOfSignature = dateOfSignature; this.accountHolder = accountHolder; } diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java index fa2d3431..138c6387 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java @@ -16,6 +16,10 @@ @ToString(callSuper = true) public final class RequestSequraSource extends AbstractRequestSource { + /** + * The customer's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; @@ -28,4 +32,4 @@ private RequestSequraSource(final Address billingAddress) { public RequestSequraSource() { super(PaymentSourceType.SEQURA); } -} \ No newline at end of file +} diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java index 177a7581..3887e172 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java @@ -10,15 +10,27 @@ import lombok.Setter; import lombok.ToString; +/** + * @deprecated Sofort was deprecated as a payment source type on 2024/12/03. + */ +@Deprecated @Getter @Setter @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public final class RequestSofortSource extends AbstractRequestSource { + /** + * The ISO 3166-1 alpha-2 country code for the Sofort payment. + * [Optional] + */ @SerializedName("countryCode") private CountryCode countryCode; + /** + * The language code for the Sofort payment. + * [Optional] + */ @SerializedName("languageCode") private String languageCode; @@ -29,6 +41,7 @@ private RequestSofortSource(final CountryCode countryCode, final String language this.languageCode = languageCode; } + @Deprecated public RequestSofortSource() { super(PaymentSourceType.SOFORT); } diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java index 5a7a11f1..d2d9b350 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java @@ -17,12 +17,24 @@ @ToString(callSuper = true) public final class RequestSwishSource extends AbstractRequestSource { + /** + * The two-letter ISO country code of the payment. + * [Optional] + */ @SerializedName("payment_country") private String paymentCountry; + /** + * The account holder's details. + * [Optional] + */ @SerializedName("account_holder") private AccountHolder accountHolder; + /** + * A description of the purchase shown on the customer's statement. + * [Optional] + */ @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java index e8b2a283..24c493f2 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java @@ -19,6 +19,10 @@ public RequestTamaraSource() { super(PaymentSourceType.TAMARA); } + /** + * The customer's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java index b1ca8177..fdcde8a0 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java @@ -10,12 +10,20 @@ import lombok.Setter; import lombok.ToString; +/** + * @deprecated Trustly was removed as a payment method on 2024/09/17. + */ +@Deprecated @Getter @Setter @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public final class RequestTrustlySource extends AbstractRequestSource { + /** + * The billing address for the Trustly payment. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; @@ -25,6 +33,7 @@ private RequestTrustlySource(final Address billingAddress) { this.billingAddress = billingAddress; } + @Deprecated public RequestTrustlySource() { super(PaymentSourceType.TRUSTLY); } diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java index f00211d3..65a1ccfd 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java @@ -16,6 +16,10 @@ @EqualsAndHashCode(callSuper = true) public final class RequestWeChatPaySource extends AbstractRequestSource { + /** + * The customer's billing address. + * [Optional] + */ @SerializedName("billing_address") private Address billingAddress; diff --git a/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java b/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java new file mode 100644 index 00000000..fade970c --- /dev/null +++ b/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java @@ -0,0 +1,44 @@ +package com.checkout.payments.response.source; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import static com.checkout.common.PaymentSourceType.PAYPAL; + +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public final class PayPalResponseSource extends AbstractResponseSource implements ResponseSource { + + /** + * The PayPal account holder details. + * [Optional] + */ + @SerializedName("account_holder") + private AccountHolder accountHolder; + + public PayPalResponseSource() { + this.type = PAYPAL; + } + + @Data + public static final class AccountHolder { + + /** + * The PayPal account holder's email address. + * [Optional] + */ + private String email; + + /** + * The PayPal account holder's full name. + * [Optional] + */ + @SerializedName("full_name") + private String fullName; + + } + +} diff --git a/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java b/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java index 0f3bdc02..c380cc1b 100644 --- a/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java +++ b/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java @@ -40,10 +40,9 @@ public final class PaymentIndividualSender extends PaymentSender { private String lastName; /** - * The sender's date of birth. - * [Optional] - * Format: yyyy-MM-dd + * @deprecated Renamed to {@link #dateOfBirth} (date_of_birth) per API changelog 2025/02/21. */ + @Deprecated @SerializedName("dob") private String dob; @@ -74,10 +73,10 @@ public final class PaymentIndividualSender extends PaymentSender { private SourceOfFunds sourceOfFunds; /** - * The sender's date of birth (yyyy-MM-dd). + * The sender's date of birth. * [Optional] * Format: yyyy-MM-dd - * <= 10 characters + * max 10 characters */ @SerializedName("date_of_birth") private LocalDate dateOfBirth; diff --git a/src/test/java/com/checkout/payments/AccommodationDataSerializationTest.java b/src/test/java/com/checkout/payments/AccommodationDataSerializationTest.java new file mode 100644 index 00000000..e600277d --- /dev/null +++ b/src/test/java/com/checkout/payments/AccommodationDataSerializationTest.java @@ -0,0 +1,165 @@ +package com.checkout.payments; + +import com.checkout.GsonSerializer; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Phone; +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; +import java.util.Arrays; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +class AccommodationDataSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeWithRequiredFields() { + final AccommodationData data = AccommodationData.builder() + .name("Grand Hotel") + .checkInDate(LocalDate.of(2025, 6, 1)) + .checkOutDate(LocalDate.of(2025, 6, 5)) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(data)); + } + + @Test + void shouldSerializeWithAllOptionalFields() { + final AccommodationData data = AccommodationData.builder() + .name("Grand Hotel") + .bookingReference("BK-12345") + .checkInDate(LocalDate.of(2025, 6, 1)) + .checkOutDate(LocalDate.of(2025, 6, 5)) + .address(Address.builder() + .addressLine1("1 Hotel Plaza") + .city("Paris") + .country(CountryCode.FR) + .build()) + .country(CountryCode.FR) + .city("Paris") + .numberOfRooms(2) + .guests(Arrays.asList( + AccommodationGuest.builder() + .firstName("John") + .lastName("Smith") + .dateOfBirth(LocalDate.of(1985, 3, 15)) + .build() + )) + .room(Arrays.asList( + AccommodationRoom.builder() + .rate("150.00") + .numberOfNightsAtRoomRate("4") + .build() + )) + .propertyPhone(Arrays.asList( + Phone.builder().countryCode("+33").number("123456789").build() + )) + .customerServicePhone(Arrays.asList( + Phone.builder().countryCode("+33").number("987654321").build() + )) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(data)); + } + + @Test + void shouldSerializeDatesAsLocalDate() { + final AccommodationData data = AccommodationData.builder() + .checkInDate(LocalDate.of(2025, 6, 1)) + .checkOutDate(LocalDate.of(2025, 6, 5)) + .build(); + + final String json = serializer.toJson(data); + + assertNotNull(json); + } + + @Test + void shouldDeserializeFromJson() { + final String json = "{" + + "\"name\":\"Grand Hotel\"," + + "\"booking_reference\":\"BK-12345\"," + + "\"check_in_date\":\"2025-06-01\"," + + "\"check_out_date\":\"2025-06-05\"," + + "\"country\":\"FR\"," + + "\"city\":\"Paris\"," + + "\"number_of_rooms\":2," + + "\"guests\":[{" + + " \"first_name\":\"John\"," + + " \"last_name\":\"Smith\"," + + " \"date_of_birth\":\"1985-03-15\"" + + "}]," + + "\"room\":[{" + + " \"rate\":\"150.00\"," + + " \"number_of_nights_at_room_rate\":\"4\"" + + "}]" + + "}"; + + final AccommodationData data = serializer.fromJson(json, AccommodationData.class); + + assertNotNull(data); + assertEquals("Grand Hotel", data.getName()); + assertEquals("BK-12345", data.getBookingReference()); + assertEquals(LocalDate.of(2025, 6, 1), data.getCheckInDate()); + assertEquals(LocalDate.of(2025, 6, 5), data.getCheckOutDate()); + assertEquals(CountryCode.FR, data.getCountry()); + assertEquals("Paris", data.getCity()); + assertEquals(2, data.getNumberOfRooms()); + assertNotNull(data.getGuests()); + assertEquals(1, data.getGuests().size()); + assertEquals("John", data.getGuests().get(0).getFirstName()); + assertEquals(LocalDate.of(1985, 3, 15), data.getGuests().get(0).getDateOfBirth()); + assertNotNull(data.getRoom()); + assertEquals("150.00", data.getRoom().get(0).getRate()); + } + + @Test + void shouldRoundTripSerialize() { + final AccommodationData original = AccommodationData.builder() + .name("Grand Hotel") + .bookingReference("BK-12345") + .checkInDate(LocalDate.of(2025, 6, 1)) + .checkOutDate(LocalDate.of(2025, 6, 5)) + .country(CountryCode.FR) + .numberOfRooms(1) + .guests(Arrays.asList( + AccommodationGuest.builder() + .firstName("John") + .lastName("Smith") + .build() + )) + .build(); + + final String json = serializer.toJson(original); + final AccommodationData deserialized = serializer.fromJson(json, AccommodationData.class); + + assertNotNull(deserialized); + assertEquals("Grand Hotel", deserialized.getName()); + assertEquals("BK-12345", deserialized.getBookingReference()); + assertEquals(LocalDate.of(2025, 6, 1), deserialized.getCheckInDate()); + assertEquals(CountryCode.FR, deserialized.getCountry()); + assertEquals(1, deserialized.getNumberOfRooms()); + assertNotNull(deserialized.getGuests()); + assertEquals("John", deserialized.getGuests().get(0).getFirstName()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{}"; + + final AccommodationData data = serializer.fromJson(json, AccommodationData.class); + + assertNotNull(data); + assertDoesNotThrow(() -> serializer.toJson(data)); + assertNull(data.getName()); + assertNull(data.getCheckInDate()); + assertNull(data.getGuests()); + assertNull(data.getRoom()); + } +} diff --git a/src/test/java/com/checkout/payments/PaymentProcessingSerializationTest.java b/src/test/java/com/checkout/payments/PaymentProcessingSerializationTest.java new file mode 100644 index 00000000..16574973 --- /dev/null +++ b/src/test/java/com/checkout/payments/PaymentProcessingSerializationTest.java @@ -0,0 +1,228 @@ +package com.checkout.payments; + +import com.checkout.GsonSerializer; +import com.checkout.common.CountryCode; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +class PaymentProcessingSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldDeserializeRetrievalReferenceNumber() { + final String json = "{\"retrieval_reference_number\":\"RRN123456\"}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("RRN123456", processing.getRetrievalReferenceNumber()); + } + + @Test + void shouldDeserializeAcquirerFields() { + final String json = "{" + + "\"acquirer_transaction_id\":\"TXN001\"," + + "\"acquirer_name\":\"Test Acquirer\"," + + "\"acquirer_country_code\":\"US\"" + + "}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("TXN001", processing.getAcquirerTransactionId()); + assertEquals("Test Acquirer", processing.getAcquirerName()); + assertEquals(CountryCode.US, processing.getAcquirerCountryCode()); + } + + @Test + void shouldDeserializePanTypeProcessedFpan() { + final String json = "{\"pan_type_processed\":\"fpan\"}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals(PanProcessedType.FPAN, processing.getPanTypeProcessed()); + } + + @Test + void shouldDeserializePanTypeProcessedDpan() { + final String json = "{\"pan_type_processed\":\"dpan\"}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals(PanProcessedType.DPAN, processing.getPanTypeProcessed()); + } + + @Test + void shouldDeserializeCkoNetworkTokenAvailable() { + final String json = "{\"cko_network_token_available\":true}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals(Boolean.TRUE, processing.getCkoNetworkTokenAvailable()); + } + + @Test + void shouldDeserializeBizumPaymentId() { + final String json = "{\"bizum_payment_id\":\"bizum_abc123\"}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("bizum_abc123", processing.getBizumPaymentId()); + } + + @Test + void shouldDeserializeReconciliationId() { + final String json = "{\"reconciliation_id\":\"recon_001\"}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("recon_001", processing.getReconciliationId()); + } + + @Test + void shouldDeserializePartnerFields() { + final String json = "{" + + "\"partner_order_id\":\"po_001\"," + + "\"partner_session_id\":\"ps_001\"," + + "\"partner_client_token\":\"pct_001\"," + + "\"partner_payment_id\":\"pp_001\"," + + "\"partner_status\":\"APPROVED\"," + + "\"partner_transaction_id\":\"pt_001\"," + + "\"partner_merchant_advice_code\":\"01\"," + + "\"partner_response_code\":\"00\"," + + "\"partner_authorization_code\":\"auth_001\"," + + "\"partner_authorization_response_code\":\"resp_001\"," + + "\"partner_error_codes\":[\"ERR001\",\"ERR002\"]," + + "\"partner_error_message\":\"Declined\"" + + "}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("po_001", processing.getPartnerOrderId()); + assertEquals("ps_001", processing.getPartnerSessionId()); + assertEquals("pct_001", processing.getPartnerClientToken()); + assertEquals("pp_001", processing.getPartnerPaymentId()); + assertEquals("APPROVED", processing.getPartnerStatus()); + assertEquals("pt_001", processing.getPartnerTransactionId()); + assertEquals("01", processing.getPartnerMerchantAdviceCode()); + assertEquals("00", processing.getPartnerResponseCode()); + assertEquals("auth_001", processing.getPartnerAuthorizationCode()); + assertEquals("resp_001", processing.getPartnerAuthorizationResponseCode()); + assertEquals(Arrays.asList("ERR001", "ERR002"), processing.getPartnerErrorCodes()); + assertEquals("Declined", processing.getPartnerErrorMessage()); + } + + @Test + void shouldDeserializeSchemeMerchantId() { + final String json = "{" + + "\"scheme_merchant_id\":\"sm_001\"," + + "\"recommendation_code\":\"RC001\"," + + "\"merchant_category_code\":\"5411\"," + + "\"scheme\":\"Visa\"," + + "\"pun\":\"PUN123456\"" + + "}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("sm_001", processing.getSchemeMerchantId()); + assertEquals("RC001", processing.getRecommendationCode()); + assertEquals("5411", processing.getMerchantCategoryCode()); + assertEquals("Visa", processing.getScheme()); + assertEquals("PUN123456", processing.getPun()); + } + + @Test + void shouldDeserializeForeignRetailerAmount() { + final String json = "{" + + "\"foreign_retailer_amount\":750," + + "\"surcharge_amount\":50," + + "\"provision_network_token\":true," + + "\"aft\":true" + + "}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals(750L, processing.getForeignRetailerAmount()); + assertEquals(50L, processing.getSurchargeAmount()); + assertEquals(Boolean.TRUE, processing.getProvisionNetworkToken()); + assertEquals(Boolean.TRUE, processing.getAft()); + } + + @Test + void shouldDeserializeFullSwaggerExample() { + final String json = "{" + + "\"retrieval_reference_number\":\"RRN001\"," + + "\"acquirer_transaction_id\":\"ACQ001\"," + + "\"acquirer_name\":\"Acquirer Bank\"," + + "\"acquirer_country_code\":\"GB\"," + + "\"recommendation_code\":\"R001\"," + + "\"scheme\":\"Mastercard\"," + + "\"pan_type_processed\":\"fpan\"," + + "\"cko_network_token_available\":false," + + "\"purchase_country\":\"GB\"," + + "\"scheme_merchant_id\":\"SMI001\"," + + "\"foreign_retailer_amount\":100," + + "\"provision_network_token\":false," + + "\"merchant_category_code\":\"5812\"," + + "\"aft\":false," + + "\"bizum_payment_id\":\"biz_001\"," + + "\"reconciliation_id\":\"rec_001\"" + + "}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertEquals("RRN001", processing.getRetrievalReferenceNumber()); + assertEquals("ACQ001", processing.getAcquirerTransactionId()); + assertEquals("Acquirer Bank", processing.getAcquirerName()); + assertEquals(CountryCode.GB, processing.getAcquirerCountryCode()); + assertEquals(PanProcessedType.FPAN, processing.getPanTypeProcessed()); + assertEquals(Boolean.FALSE, processing.getCkoNetworkTokenAvailable()); + assertEquals(CountryCode.GB, processing.getPurchaseCountry()); + assertEquals("SMI001", processing.getSchemeMerchantId()); + assertEquals(100L, processing.getForeignRetailerAmount()); + assertEquals("biz_001", processing.getBizumPaymentId()); + assertEquals("rec_001", processing.getReconciliationId()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{}"; + + final PaymentProcessing processing = serializer.fromJson(json, PaymentProcessing.class); + + assertNotNull(processing); + assertDoesNotThrow(() -> serializer.toJson(processing)); + assertNull(processing.getRetrievalReferenceNumber()); + assertNull(processing.getPanTypeProcessed()); + assertNull(processing.getCkoNetworkTokenAvailable()); + assertNull(processing.getBizumPaymentId()); + } + + @Test + void shouldNotSerializeNullFields() { + final PaymentProcessing processing = new PaymentProcessing(); + + final String json = serializer.toJson(processing); + + assertFalse(json.contains("\"retrieval_reference_number\"")); + assertFalse(json.contains("\"pan_type_processed\"")); + assertFalse(json.contains("\"cko_network_token_available\"")); + } +} diff --git a/src/test/java/com/checkout/payments/ProcessingSettingsSerializationTest.java b/src/test/java/com/checkout/payments/ProcessingSettingsSerializationTest.java new file mode 100644 index 00000000..c890349b --- /dev/null +++ b/src/test/java/com/checkout/payments/ProcessingSettingsSerializationTest.java @@ -0,0 +1,205 @@ +package com.checkout.payments; + +import com.checkout.GsonSerializer; +import com.checkout.common.CardType; +import com.checkout.common.CountryCode; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class ProcessingSettingsSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializePanPreferenceFpan() { + final ProcessingSettings settings = ProcessingSettings.builder() + .panPreference(PanProcessedType.FPAN) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"pan_preference\":\"fpan\"")); + } + + @Test + void shouldSerializePanPreferenceDpan() { + final ProcessingSettings settings = ProcessingSettings.builder() + .panPreference(PanProcessedType.DPAN) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"pan_preference\":\"dpan\"")); + } + + @Test + void shouldSerializeServiceTypeSameDay() { + final ProcessingSettings settings = ProcessingSettings.builder() + .serviceType(AchServiceType.SAME_DAY) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"service_type\":\"same_day\"")); + } + + @Test + void shouldSerializeServiceTypeStandard() { + final ProcessingSettings settings = ProcessingSettings.builder() + .serviceType(AchServiceType.STANDARD) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"service_type\":\"standard\"")); + } + + @Test + void shouldSerializeAffiliateFields() { + final ProcessingSettings settings = ProcessingSettings.builder() + .affiliateId("AFFILIATE123") + .affiliateUrl("https://affiliate.example.com") + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"affiliate_id\":\"AFFILIATE123\"")); + assertTrue(json.contains("\"affiliate_url\":\"https://affiliate.example.com\"")); + } + + @Test + void shouldSerializeCardTypeCredit() { + final ProcessingSettings settings = ProcessingSettings.builder() + .cardType(CardType.CREDIT) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"card_type\":\"Credit\"")); + } + + @Test + void shouldSerializeCardTypeDebit() { + final ProcessingSettings settings = ProcessingSettings.builder() + .cardType(CardType.DEBIT) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"card_type\":\"Debit\"")); + } + + @Test + void shouldSerializeForeignRetailerAmount() { + final ProcessingSettings settings = ProcessingSettings.builder() + .foreignRetailerAmount(500L) + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"foreign_retailer_amount\":500")); + } + + @Test + void shouldSerializeReconciliationId() { + final ProcessingSettings settings = ProcessingSettings.builder() + .reconciliationId("recon_abc123") + .build(); + + final String json = serializer.toJson(settings); + + assertTrue(json.contains("\"reconciliation_id\":\"recon_abc123\"")); + } + + @Test + void shouldDeserializePanPreference() { + final String json = "{\"pan_preference\":\"fpan\",\"service_type\":\"standard\"}"; + + final ProcessingSettings settings = serializer.fromJson(json, ProcessingSettings.class); + + assertNotNull(settings); + assertEquals(PanProcessedType.FPAN, settings.getPanPreference()); + assertEquals(AchServiceType.STANDARD, settings.getServiceType()); + } + + @Test + void shouldDeserializeAffiliateAndCardType() { + final String json = "{" + + "\"affiliate_id\":\"AFF001\"," + + "\"affiliate_url\":\"https://aff.example.com\"," + + "\"card_type\":\"Debit\"," + + "\"foreign_retailer_amount\":1000," + + "\"reconciliation_id\":\"rec_001\"" + + "}"; + + final ProcessingSettings settings = serializer.fromJson(json, ProcessingSettings.class); + + assertNotNull(settings); + assertEquals("AFF001", settings.getAffiliateId()); + assertEquals("https://aff.example.com", settings.getAffiliateUrl()); + assertEquals(CardType.DEBIT, settings.getCardType()); + assertEquals(1000L, settings.getForeignRetailerAmount()); + assertEquals("rec_001", settings.getReconciliationId()); + } + + @Test + void shouldRoundTripSerialize() { + final ProcessingSettings original = ProcessingSettings.builder() + .panPreference(PanProcessedType.DPAN) + .serviceType(AchServiceType.SAME_DAY) + .affiliateId("AFF123") + .affiliateUrl("https://example.com") + .cardType(CardType.CREDIT) + .foreignRetailerAmount(250L) + .reconciliationId("rec_xyz") + .hubModelOriginationCountry(CountryCode.GB) + .build(); + + final String json = serializer.toJson(original); + final ProcessingSettings deserialized = serializer.fromJson(json, ProcessingSettings.class); + + assertNotNull(deserialized); + assertEquals(PanProcessedType.DPAN, deserialized.getPanPreference()); + assertEquals(AchServiceType.SAME_DAY, deserialized.getServiceType()); + assertEquals("AFF123", deserialized.getAffiliateId()); + assertEquals("https://example.com", deserialized.getAffiliateUrl()); + assertEquals(CardType.CREDIT, deserialized.getCardType()); + assertEquals(250L, deserialized.getForeignRetailerAmount()); + assertEquals("rec_xyz", deserialized.getReconciliationId()); + assertEquals(CountryCode.GB, deserialized.getHubModelOriginationCountry()); + } + + @Test + void shouldNotSerializeNullOptionalFields() { + final ProcessingSettings settings = ProcessingSettings.builder() + .orderId("order_001") + .build(); + + final String json = serializer.toJson(settings); + + assertFalse(json.contains("\"pan_preference\"")); + assertFalse(json.contains("\"service_type\"")); + assertFalse(json.contains("\"affiliate_id\"")); + assertFalse(json.contains("\"card_type\"")); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{}"; + + final ProcessingSettings settings = serializer.fromJson(json, ProcessingSettings.class); + + assertNotNull(settings); + assertDoesNotThrow(() -> serializer.toJson(settings)); + assertNull(settings.getPanPreference()); + assertNull(settings.getServiceType()); + assertNull(settings.getAffiliateId()); + assertNull(settings.getCardType()); + } +} diff --git a/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java b/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java new file mode 100644 index 00000000..15c67afc --- /dev/null +++ b/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java @@ -0,0 +1,148 @@ +package com.checkout.payments; + +import com.checkout.GsonSerializer; +import com.checkout.common.ThreeDSEnrollmentStatus; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class ThreeDSDataSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldDeserializeMinimalResponse() { + final String json = "{\"downgraded\":false}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertEquals(false, data.getDowngraded()); + } + + @Test + void shouldDeserializeEciField() { + final String json = "{" + + "\"eci\":\"05\"," + + "\"challenged\":true," + + "\"version\":\"2.1.0\"" + + "}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertEquals("05", data.getEci()); + assertTrue(data.getChallenged()); + assertEquals("2.1.0", data.getVersion()); + } + + @Test + void shouldDeserializeAuthenticationStatusReason() { + final String json = "{" + + "\"authentication_status_reason\":\"01\"," + + "\"eci\":\"06\"" + + "}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertEquals("01", data.getAuthenticationStatusReason()); + assertEquals("06", data.getEci()); + } + + @Test + void shouldDeserializeTrustedListing() { + final String json = "{" + + "\"trusted_listing\":{" + + " \"status\":\"Y\"," + + " \"source\":\"01\"" + + "}" + + "}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertNotNull(data.getTrustedListing()); + assertEquals("Y", data.getTrustedListing().getStatus()); + assertEquals("01", data.getTrustedListing().getSource()); + } + + @Test + void shouldDeserializeFullResponse() { + final String json = "{" + + "\"downgraded\":false," + + "\"enrolled\":\"Y\"," + + "\"upgrade_reason\":\"02\"," + + "\"signature_valid\":\"Y\"," + + "\"authentication_response\":\"Y\"," + + "\"cryptogram\":\"AgAAAAAAAIR8CQrXcIhbQAAAAAA\"," + + "\"xid\":\"MDAwMDAwMDAwMDAwMDAwMzIyNzY\"," + + "\"version\":\"2.1.0\"," + + "\"exemption_applied\":\"low_value\"," + + "\"challenged\":true," + + "\"eci\":\"05\"," + + "\"authentication_status_reason\":\"01\"," + + "\"trusted_listing\":{" + + " \"status\":\"Y\"," + + " \"source\":\"01\"" + + "}" + + "}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertEquals(false, data.getDowngraded()); + assertEquals(ThreeDSEnrollmentStatus.ISSUER_ENROLLED, data.getEnrolled()); + assertEquals("02", data.getUpgradeReason()); + assertEquals("Y", data.getSignatureValid()); + assertEquals("Y", data.getAuthenticationResponse()); + assertEquals("AgAAAAAAAIR8CQrXcIhbQAAAAAA", data.getCryptogram()); + assertEquals("MDAwMDAwMDAwMDAwMDAwMzIyNzY", data.getXid()); + assertEquals("2.1.0", data.getVersion()); + assertEquals("low_value", data.getExemptionApplied()); + assertTrue(data.getChallenged()); + assertEquals("05", data.getEci()); + assertEquals("01", data.getAuthenticationStatusReason()); + assertNotNull(data.getTrustedListing()); + assertEquals("Y", data.getTrustedListing().getStatus()); + } + + @Test + void shouldRoundTripSerialize() { + final String original = "{" + + "\"eci\":\"05\"," + + "\"authentication_status_reason\":\"01\"," + + "\"trusted_listing\":{\"status\":\"Y\",\"source\":\"01\"}," + + "\"challenged\":true," + + "\"version\":\"2.2.0\"" + + "}"; + + final ThreeDSData data = serializer.fromJson(original, ThreeDSData.class); + final String reserialised = serializer.toJson(data); + final ThreeDSData roundTripped = serializer.fromJson(reserialised, ThreeDSData.class); + + assertNotNull(roundTripped); + assertEquals(data.getEci(), roundTripped.getEci()); + assertEquals(data.getAuthenticationStatusReason(), roundTripped.getAuthenticationStatusReason()); + assertEquals(data.getTrustedListing().getStatus(), roundTripped.getTrustedListing().getStatus()); + assertEquals(data.getChallenged(), roundTripped.getChallenged()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{}"; + + final ThreeDSData data = serializer.fromJson(json, ThreeDSData.class); + + assertNotNull(data); + assertDoesNotThrow(() -> serializer.toJson(data)); + assertNull(data.getEci()); + assertNull(data.getAuthenticationStatusReason()); + assertNull(data.getTrustedListing()); + assertNull(data.getChallenged()); + } +} diff --git a/src/test/java/com/checkout/payments/hosted/HostedPaymentRequestSerializationTest.java b/src/test/java/com/checkout/payments/hosted/HostedPaymentRequestSerializationTest.java new file mode 100644 index 00000000..5378dca0 --- /dev/null +++ b/src/test/java/com/checkout/payments/hosted/HostedPaymentRequestSerializationTest.java @@ -0,0 +1,222 @@ +package com.checkout.payments.hosted; + +import com.checkout.GsonSerializer; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.payments.BillingInformation; +import com.checkout.payments.PaymentType; +import org.junit.jupiter.api.Test; + +import java.time.Instant; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class HostedPaymentRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeRequiredFields() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.USD) + .billing(BillingInformation.builder() + .address(Address.builder() + .addressLine1("123 Main St") + .city("New York") + .country(CountryCode.US) + .build()) + .build()) + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"currency\":\"USD\"")); + assertTrue(json.contains("\"billing\"")); + assertTrue(json.contains("\"success_url\":\"https://example.com/success\"")); + assertTrue(json.contains("\"cancel_url\":\"https://example.com/cancel\"")); + assertTrue(json.contains("\"failure_url\":\"https://example.com/failure\"")); + } + + @Test + void shouldSerializeAmount() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.GBP) + .amount(1000L) + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"amount\":1000")); + assertTrue(json.contains("\"currency\":\"GBP\"")); + } + + @Test + void shouldSerializePaymentType() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.EUR) + .paymentType(PaymentType.RECURRING) + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"payment_type\":\"Recurring\"")); + } + + @Test + void shouldSerializeProcessingChannelId() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.USD) + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"processing_channel_id\":\"pc_abcdefghijklmnopqrstuvwxyz\"")); + } + + @Test + void shouldSerializeCaptureFields() { + final Instant captureOn = Instant.parse("2026-06-01T12:00:00Z"); + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.USD) + .capture(true) + .captureOn(captureOn) + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"capture\":true")); + assertTrue(json.contains("\"capture_on\"")); + } + + @Test + void shouldSerializeReferenceAndDescription() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.USD) + .reference("ORD-12345") + .description("Test payment") + .displayName("My Shop") + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"reference\":\"ORD-12345\"")); + assertTrue(json.contains("\"description\":\"Test payment\"")); + assertTrue(json.contains("\"display_name\":\"My Shop\"")); + } + + @Test + void shouldDeserializeRequiredFields() { + final String json = "{" + + "\"currency\":\"USD\"," + + "\"success_url\":\"https://example.com/success\"," + + "\"cancel_url\":\"https://example.com/cancel\"," + + "\"failure_url\":\"https://example.com/failure\"," + + "\"amount\":500" + + "}"; + + final HostedPaymentRequest request = serializer.fromJson(json, HostedPaymentRequest.class); + + assertNotNull(request); + assertEquals(Currency.USD, request.getCurrency()); + assertEquals("https://example.com/success", request.getSuccessUrl()); + assertEquals("https://example.com/cancel", request.getCancelUrl()); + assertEquals("https://example.com/failure", request.getFailureUrl()); + assertEquals(500L, request.getAmount()); + } + + @Test + void shouldDeserializePaymentType() { + final String json = "{\"payment_type\":\"Recurring\",\"currency\":\"GBP\"}"; + + final HostedPaymentRequest request = serializer.fromJson(json, HostedPaymentRequest.class); + + assertNotNull(request); + assertEquals(PaymentType.RECURRING, request.getPaymentType()); + } + + @Test + void shouldRoundTripSerialize() { + final HostedPaymentRequest original = HostedPaymentRequest.builder() + .currency(Currency.EUR) + .amount(2500L) + .paymentType(PaymentType.REGULAR) + .reference("REF-001") + .description("Round trip test") + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(original); + final HostedPaymentRequest deserialized = serializer.fromJson(json, HostedPaymentRequest.class); + + assertNotNull(deserialized); + assertEquals(Currency.EUR, deserialized.getCurrency()); + assertEquals(2500L, deserialized.getAmount()); + assertEquals("REF-001", deserialized.getReference()); + assertEquals("Round trip test", deserialized.getDescription()); + assertEquals("pc_abcdefghijklmnopqrstuvwxyz", deserialized.getProcessingChannelId()); + assertEquals("https://example.com/success", deserialized.getSuccessUrl()); + assertEquals("https://example.com/cancel", deserialized.getCancelUrl()); + assertEquals("https://example.com/failure", deserialized.getFailureUrl()); + } + + @Test + void shouldNotSerializeNullOptionalFields() { + final HostedPaymentRequest request = HostedPaymentRequest.builder() + .currency(Currency.USD) + .successUrl("https://example.com/success") + .cancelUrl("https://example.com/cancel") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertFalse(json.contains("\"amount\"")); + assertFalse(json.contains("\"description\"")); + assertFalse(json.contains("\"processing_channel_id\"")); + assertFalse(json.contains("\"capture_on\"")); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"currency\":\"USD\"}"; + + final HostedPaymentRequest request = serializer.fromJson(json, HostedPaymentRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getAmount()); + assertNull(request.getReference()); + assertNull(request.getSuccessUrl()); + assertNull(request.getCancelUrl()); + assertNull(request.getFailureUrl()); + } +} diff --git a/src/test/java/com/checkout/payments/links/PaymentLinkRequestSerializationTest.java b/src/test/java/com/checkout/payments/links/PaymentLinkRequestSerializationTest.java new file mode 100644 index 00000000..edf89097 --- /dev/null +++ b/src/test/java/com/checkout/payments/links/PaymentLinkRequestSerializationTest.java @@ -0,0 +1,216 @@ +package com.checkout.payments.links; + +import com.checkout.GsonSerializer; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import com.checkout.payments.BillingInformation; +import com.checkout.payments.PaymentType; +import org.junit.jupiter.api.Test; + +import java.time.Instant; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class PaymentLinkRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeRequiredFields() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1500L) + .currency(Currency.GBP) + .billing(BillingInformation.builder() + .address(Address.builder() + .addressLine1("1 High Street") + .city("London") + .country(CountryCode.GB) + .build()) + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"amount\":1500")); + assertTrue(json.contains("\"currency\":\"GBP\"")); + assertTrue(json.contains("\"billing\"")); + } + + @Test + void shouldSerializeExpiresIn() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1000L) + .currency(Currency.USD) + .expiresIn(86400) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"expires_in\":86400")); + } + + @Test + void shouldSerializeReturnUrl() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1000L) + .currency(Currency.USD) + .returnUrl("https://example.com/return") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"return_url\":\"https://example.com/return\"")); + } + + @Test + void shouldSerializeProcessingChannelId() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1000L) + .currency(Currency.EUR) + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"processing_channel_id\":\"pc_abcdefghijklmnopqrstuvwxyz\"")); + } + + @Test + void shouldSerializePaymentType() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(500L) + .currency(Currency.USD) + .paymentType(PaymentType.RECURRING) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"payment_type\":\"Recurring\"")); + } + + @Test + void shouldSerializeCaptureFields() { + final Instant captureOn = Instant.parse("2026-07-01T10:00:00Z"); + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1000L) + .currency(Currency.USD) + .capture(true) + .captureOn(captureOn) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"capture\":true")); + assertTrue(json.contains("\"capture_on\"")); + } + + @Test + void shouldSerializeReferenceAndDescription() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(750L) + .currency(Currency.USD) + .reference("ORD-2024-001") + .description("Order payment") + .displayName("My Store") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"reference\":\"ORD-2024-001\"")); + assertTrue(json.contains("\"description\":\"Order payment\"")); + assertTrue(json.contains("\"display_name\":\"My Store\"")); + } + + @Test + void shouldDeserializeRequiredFields() { + final String json = "{" + + "\"amount\":2000," + + "\"currency\":\"EUR\"," + + "\"expires_in\":3600," + + "\"return_url\":\"https://example.com/return\"," + + "\"processing_channel_id\":\"pc_test\"" + + "}"; + + final PaymentLinkRequest request = serializer.fromJson(json, PaymentLinkRequest.class); + + assertNotNull(request); + assertEquals(2000L, request.getAmount()); + assertEquals(Currency.EUR, request.getCurrency()); + assertEquals(3600, request.getExpiresIn()); + assertEquals("https://example.com/return", request.getReturnUrl()); + assertEquals("pc_test", request.getProcessingChannelId()); + } + + @Test + void shouldDeserializePaymentType() { + final String json = "{\"payment_type\":\"Installment\",\"amount\":500,\"currency\":\"USD\"}"; + + final PaymentLinkRequest request = serializer.fromJson(json, PaymentLinkRequest.class); + + assertNotNull(request); + assertEquals(PaymentType.INSTALLMENT, request.getPaymentType()); + } + + @Test + void shouldRoundTripSerialize() { + final PaymentLinkRequest original = PaymentLinkRequest.builder() + .amount(3000L) + .currency(Currency.GBP) + .expiresIn(7200) + .returnUrl("https://example.com/return") + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .reference("REF-RT-001") + .description("Round-trip test") + .paymentType(PaymentType.REGULAR) + .capture(true) + .build(); + + final String json = serializer.toJson(original); + final PaymentLinkRequest deserialized = serializer.fromJson(json, PaymentLinkRequest.class); + + assertNotNull(deserialized); + assertEquals(3000L, deserialized.getAmount()); + assertEquals(Currency.GBP, deserialized.getCurrency()); + assertEquals(7200, deserialized.getExpiresIn()); + assertEquals("https://example.com/return", deserialized.getReturnUrl()); + assertEquals("pc_abcdefghijklmnopqrstuvwxyz", deserialized.getProcessingChannelId()); + assertEquals("REF-RT-001", deserialized.getReference()); + assertEquals("Round-trip test", deserialized.getDescription()); + assertTrue(deserialized.isCapture()); + } + + @Test + void shouldNotSerializeNullOptionalFields() { + final PaymentLinkRequest request = PaymentLinkRequest.builder() + .amount(1000L) + .currency(Currency.USD) + .build(); + + final String json = serializer.toJson(request); + + assertFalse(json.contains("\"expires_in\"")); + assertFalse(json.contains("\"return_url\"")); + assertFalse(json.contains("\"description\"")); + assertFalse(json.contains("\"processing_channel_id\"")); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"amount\":500,\"currency\":\"USD\"}"; + + final PaymentLinkRequest request = serializer.fromJson(json, PaymentLinkRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getExpiresIn()); + assertNull(request.getReturnUrl()); + assertNull(request.getDescription()); + } +} diff --git a/src/test/java/com/checkout/payments/request/PaymentRequestSerializationTest.java b/src/test/java/com/checkout/payments/request/PaymentRequestSerializationTest.java new file mode 100644 index 00000000..3e84216d --- /dev/null +++ b/src/test/java/com/checkout/payments/request/PaymentRequestSerializationTest.java @@ -0,0 +1,256 @@ +package com.checkout.payments.request; + +import com.checkout.GsonSerializer; +import com.checkout.common.Currency; +import com.checkout.payments.AuthorizationType; +import com.checkout.payments.PaymentType; +import org.junit.jupiter.api.Test; + +import java.time.Instant; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class PaymentRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeRequiredCurrencyField() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"currency\":\"USD\"")); + } + + @Test + void shouldSerializePaymentContextId() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .paymentContextId("ctx_abc123") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"payment_context_id\":\"ctx_abc123\"")); + } + + @Test + void shouldSerializeMerchantInitiated() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .merchantInitiated(true) + .paymentType(PaymentType.RECURRING) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"merchant_initiated\":true")); + assertTrue(json.contains("\"payment_type\":\"Recurring\"")); + } + + @Test + void shouldSerializePaymentTypeEnum() { + for (final PaymentType paymentType : PaymentType.values()) { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .paymentType(paymentType) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(request)); + } + } + + @Test + void shouldSerializeAuthorizationType() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .authorizationType(AuthorizationType.ESTIMATED) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"authorization_type\":\"Estimated\"")); + } + + @Test + void shouldSerializeCaptureFields() { + final Instant captureOn = Instant.parse("2026-08-01T14:00:00Z"); + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .capture(true) + .captureOn(captureOn) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"capture\":true")); + assertTrue(json.contains("\"capture_on\"")); + } + + @Test + void shouldSerializeProcessingChannelId() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.GBP) + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"processing_channel_id\":\"pc_abcdefghijklmnopqrstuvwxyz\"")); + } + + @Test + void shouldSerializePreviousPaymentId() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .previousPaymentId("pay_cr4hxwizzp6k7biycuk2ibltnm") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"previous_payment_id\":\"pay_cr4hxwizzp6k7biycuk2ibltnm\"")); + } + + @Test + void shouldSerializeSuccessAndFailureUrls() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .successUrl("https://example.com/success") + .failureUrl("https://example.com/failure") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"success_url\":\"https://example.com/success\"")); + assertTrue(json.contains("\"failure_url\":\"https://example.com/failure\"")); + } + + @Test + void shouldSerializeReferenceAndDescription() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.EUR) + .reference("ORD-001") + .description("Test order") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"reference\":\"ORD-001\"")); + assertTrue(json.contains("\"description\":\"Test order\"")); + } + + @Test + void shouldSerializeAmount() { + final PaymentRequest request = PaymentRequest.builder() + .amount(4999L) + .currency(Currency.USD) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"amount\":4999")); + } + + @Test + void shouldDeserializeKeyFields() { + final String json = "{" + + "\"payment_context_id\":\"ctx_001\"," + + "\"amount\":1500," + + "\"currency\":\"GBP\"," + + "\"payment_type\":\"Unscheduled\"," + + "\"merchant_initiated\":true," + + "\"reference\":\"REF-001\"," + + "\"description\":\"Test\"," + + "\"processing_channel_id\":\"pc_test\"," + + "\"previous_payment_id\":\"pay_abc\"," + + "\"success_url\":\"https://example.com/success\"," + + "\"failure_url\":\"https://example.com/failure\"," + + "\"capture\":false" + + "}"; + + final PaymentRequest request = serializer.fromJson(json, PaymentRequest.class); + + assertNotNull(request); + assertEquals("ctx_001", request.getPaymentContextId()); + assertEquals(1500L, request.getAmount()); + assertEquals(Currency.GBP, request.getCurrency()); + assertEquals(PaymentType.UNSCHEDULED, request.getPaymentType()); + assertEquals(Boolean.TRUE, request.getMerchantInitiated()); + assertEquals("REF-001", request.getReference()); + assertEquals("Test", request.getDescription()); + assertEquals("pc_test", request.getProcessingChannelId()); + assertEquals("pay_abc", request.getPreviousPaymentId()); + assertEquals("https://example.com/success", request.getSuccessUrl()); + assertEquals("https://example.com/failure", request.getFailureUrl()); + assertEquals(Boolean.FALSE, request.getCapture()); + } + + @Test + void shouldRoundTripSerialize() { + final PaymentRequest original = PaymentRequest.builder() + .amount(2000L) + .currency(Currency.USD) + .paymentType(PaymentType.MOTO) + .reference("RT-001") + .description("Round-trip") + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .previousPaymentId("pay_prev") + .successUrl("https://example.com/success") + .failureUrl("https://example.com/failure") + .capture(true) + .merchantInitiated(false) + .build(); + + final String json = serializer.toJson(original); + final PaymentRequest deserialized = serializer.fromJson(json, PaymentRequest.class); + + assertNotNull(deserialized); + assertEquals(2000L, deserialized.getAmount()); + assertEquals(Currency.USD, deserialized.getCurrency()); + assertEquals(PaymentType.MOTO, deserialized.getPaymentType()); + assertEquals("RT-001", deserialized.getReference()); + assertEquals("pc_abcdefghijklmnopqrstuvwxyz", deserialized.getProcessingChannelId()); + assertEquals("pay_prev", deserialized.getPreviousPaymentId()); + assertEquals("https://example.com/success", deserialized.getSuccessUrl()); + assertEquals("https://example.com/failure", deserialized.getFailureUrl()); + assertEquals(Boolean.TRUE, deserialized.getCapture()); + } + + @Test + void shouldNotSerializeNullOptionalFields() { + final PaymentRequest request = PaymentRequest.builder() + .currency(Currency.USD) + .build(); + + final String json = serializer.toJson(request); + + assertFalse(json.contains("\"payment_context_id\"")); + assertFalse(json.contains("\"previous_payment_id\"")); + assertFalse(json.contains("\"success_url\"")); + assertFalse(json.contains("\"failure_url\"")); + assertFalse(json.contains("\"merchant_initiated\"")); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"currency\":\"USD\"}"; + + final PaymentRequest request = serializer.fromJson(json, PaymentRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getPaymentContextId()); + assertNull(request.getAmount()); + assertNull(request.getMerchantInitiated()); + assertNull(request.getPreviousPaymentId()); + } +} diff --git a/src/test/java/com/checkout/payments/request/PaymentRetryRequestSerializationTest.java b/src/test/java/com/checkout/payments/request/PaymentRetryRequestSerializationTest.java new file mode 100644 index 00000000..2922a5ad --- /dev/null +++ b/src/test/java/com/checkout/payments/request/PaymentRetryRequestSerializationTest.java @@ -0,0 +1,126 @@ +package com.checkout.payments.request; + +import com.checkout.GsonSerializer; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class PaymentRetryRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeWithDunningConfig() { + final PaymentRetryRequest request = PaymentRetryRequest.builder() + .dunning(DunningRetryRequest.builder() + .enabled(true) + .maxAttempts(3) + .endAfterDays(7) + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"dunning\"")); + assertTrue(json.contains("\"enabled\":true")); + assertTrue(json.contains("\"max_attempts\":3")); + assertTrue(json.contains("\"end_after_days\":7")); + } + + @Test + void shouldSerializeWithDowntimeConfig() { + final PaymentRetryRequest request = PaymentRetryRequest.builder() + .downtime(DowntimeRetryRequest.builder() + .enabled(true) + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"downtime\"")); + assertTrue(json.contains("\"enabled\":true")); + } + + @Test + void shouldSerializeWithBothDunningAndDowntime() { + final PaymentRetryRequest request = PaymentRetryRequest.builder() + .dunning(DunningRetryRequest.builder() + .enabled(true) + .maxAttempts(5) + .endAfterDays(14) + .build()) + .downtime(DowntimeRetryRequest.builder() + .enabled(false) + .build()) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(request)); + } + + @Test + void shouldDeserializeDunningFromJson() { + final String json = "{" + + "\"dunning\":{" + + " \"enabled\":true," + + " \"max_attempts\":3," + + " \"end_after_days\":7" + + "}," + + "\"downtime\":{" + + " \"enabled\":false" + + "}" + + "}"; + + final PaymentRetryRequest request = serializer.fromJson(json, PaymentRetryRequest.class); + + assertNotNull(request); + assertNotNull(request.getDunning()); + assertTrue(request.getDunning().getEnabled()); + assertEquals(3, request.getDunning().getMaxAttempts()); + assertEquals(7, request.getDunning().getEndAfterDays()); + assertNotNull(request.getDowntime()); + assertEquals(false, request.getDowntime().getEnabled()); + } + + @Test + void shouldRoundTripSerialize() { + final PaymentRetryRequest original = PaymentRetryRequest.builder() + .dunning(DunningRetryRequest.builder() + .enabled(true) + .maxAttempts(3) + .endAfterDays(7) + .build()) + .downtime(DowntimeRetryRequest.builder() + .enabled(true) + .build()) + .build(); + + final String json = serializer.toJson(original); + final PaymentRetryRequest deserialized = serializer.fromJson(json, PaymentRetryRequest.class); + + assertNotNull(deserialized); + assertNotNull(deserialized.getDunning()); + assertEquals(true, deserialized.getDunning().getEnabled()); + assertEquals(3, deserialized.getDunning().getMaxAttempts()); + assertEquals(7, deserialized.getDunning().getEndAfterDays()); + assertNotNull(deserialized.getDowntime()); + assertEquals(true, deserialized.getDowntime().getEnabled()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{}"; + + final PaymentRetryRequest request = serializer.fromJson(json, PaymentRetryRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getDunning()); + assertNull(request.getDowntime()); + } +} diff --git a/src/test/java/com/checkout/payments/request/PayoutRequestSerializationTest.java b/src/test/java/com/checkout/payments/request/PayoutRequestSerializationTest.java new file mode 100644 index 00000000..7f1a7aeb --- /dev/null +++ b/src/test/java/com/checkout/payments/request/PayoutRequestSerializationTest.java @@ -0,0 +1,156 @@ +package com.checkout.payments.request; + +import com.checkout.GsonSerializer; +import com.checkout.common.Currency; +import com.checkout.payments.request.source.PayoutRequestCurrencyAccountSource; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class PayoutRequestSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeCurrencyAndAmount() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.USD) + .amount(5000L) + .source(PayoutRequestCurrencyAccountSource.builder().id("ca_abc123").build()) + .build(); + + final String json = serializer.toJson(request); + + assertNotNull(json); + assertTrue(json.contains("\"currency\":\"USD\"")); + assertTrue(json.contains("\"amount\":5000")); + } + + @Test + void shouldSerializeReference() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.GBP) + .reference("PO-2024-001") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"reference\":\"PO-2024-001\"")); + } + + @Test + void shouldSerializeProcessingChannelId() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.EUR) + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"processing_channel_id\":\"pc_abcdefghijklmnopqrstuvwxyz\"")); + } + + @Test + void shouldSerializeBillingDescriptor() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.USD) + .billingDescriptor(PayoutBillingDescriptor.builder() + .reference("Payout reference") + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"billing_descriptor\"")); + assertTrue(json.contains("\"reference\":\"Payout reference\"")); + } + + @Test + void shouldSerializeInstruction() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.USD) + .instruction(PaymentInstruction.builder() + .purpose("salary") + .build()) + .build(); + + final String json = serializer.toJson(request); + + assertTrue(json.contains("\"instruction\"")); + assertTrue(json.contains("\"purpose\":\"salary\"")); + } + + @Test + void shouldDeserializeKeyFields() { + final String json = "{" + + "\"amount\":10000," + + "\"currency\":\"GBP\"," + + "\"reference\":\"PO-001\"," + + "\"processing_channel_id\":\"pc_test\"" + + "}"; + + final PayoutRequest request = serializer.fromJson(json, PayoutRequest.class); + + assertNotNull(request); + assertEquals(10000L, request.getAmount()); + assertEquals(Currency.GBP, request.getCurrency()); + assertEquals("PO-001", request.getReference()); + assertEquals("pc_test", request.getProcessingChannelId()); + } + + @Test + void shouldRoundTripSerialize() { + final PayoutRequest original = PayoutRequest.builder() + .currency(Currency.EUR) + .amount(7500L) + .reference("RT-PAYOUT-001") + .processingChannelId("pc_abcdefghijklmnopqrstuvwxyz") + .billingDescriptor(PayoutBillingDescriptor.builder() + .reference("RT descriptor") + .build()) + .build(); + + final String json = serializer.toJson(original); + final PayoutRequest deserialized = serializer.fromJson(json, PayoutRequest.class); + + assertNotNull(deserialized); + assertEquals(Currency.EUR, deserialized.getCurrency()); + assertEquals(7500L, deserialized.getAmount()); + assertEquals("RT-PAYOUT-001", deserialized.getReference()); + assertEquals("pc_abcdefghijklmnopqrstuvwxyz", deserialized.getProcessingChannelId()); + assertNotNull(deserialized.getBillingDescriptor()); + assertEquals("RT descriptor", deserialized.getBillingDescriptor().getReference()); + } + + @Test + void shouldNotSerializeNullOptionalFields() { + final PayoutRequest request = PayoutRequest.builder() + .currency(Currency.USD) + .build(); + + final String json = serializer.toJson(request); + + assertFalse(json.contains("\"amount\"")); + assertFalse(json.contains("\"reference\"")); + assertFalse(json.contains("\"billing_descriptor\"")); + assertFalse(json.contains("\"processing_channel_id\"")); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"currency\":\"USD\"}"; + + final PayoutRequest request = serializer.fromJson(json, PayoutRequest.class); + + assertNotNull(request); + assertDoesNotThrow(() -> serializer.toJson(request)); + assertNull(request.getAmount()); + assertNull(request.getReference()); + assertNull(request.getBillingDescriptor()); + } +} diff --git a/src/test/java/com/checkout/payments/request/source/RequestCustomerSourceSerializationTest.java b/src/test/java/com/checkout/payments/request/source/RequestCustomerSourceSerializationTest.java new file mode 100644 index 00000000..73ec0652 --- /dev/null +++ b/src/test/java/com/checkout/payments/request/source/RequestCustomerSourceSerializationTest.java @@ -0,0 +1,148 @@ +package com.checkout.payments.request.source; + +import com.checkout.GsonSerializer; +import com.checkout.common.AccountHolder; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Phone; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class RequestCustomerSourceSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeWithCustomerId() { + final RequestCustomerSource source = RequestCustomerSource.builder() + .id("cus_y3oqhf46pyzuxjbcn2giaqnb44") + .build(); + + final String json = serializer.toJson(source); + + assertNotNull(json); + assertTrue(json.contains("\"type\":\"customer\"")); + assertTrue(json.contains("\"id\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"")); + } + + @Test + void shouldSerializeWithAllOptionalFields() { + final RequestCustomerSource source = RequestCustomerSource.builder() + .id("cus_y3oqhf46pyzuxjbcn2giaqnb44") + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .city("London") + .zip("SW1A 1AA") + .country(CountryCode.GB) + .build()) + .phone(Phone.builder() + .countryCode("+44") + .number("7911123456") + .build()) + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .build()) + .allowUpdate(true) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(source)); + } + + @Test + void shouldSerializeBillingAddress() { + final RequestCustomerSource source = RequestCustomerSource.builder() + .id("cus_y3oqhf46pyzuxjbcn2giaqnb44") + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .country(CountryCode.GB) + .build()) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"billing_address\"")); + assertTrue(json.contains("\"address_line1\":\"123 High Street\"")); + } + + @Test + void shouldSerializeAllowUpdate() { + final RequestCustomerSource source = RequestCustomerSource.builder() + .id("cus_y3oqhf46pyzuxjbcn2giaqnb44") + .allowUpdate(true) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"allow_update\":true")); + } + + @Test + void shouldDeserializeSwaggerExample() { + final String swaggerJson = "{" + + "\"type\":\"customer\"," + + "\"id\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"," + + "\"billing_address\":{" + + " \"address_line1\":\"123 High Street\"," + + " \"city\":\"London\"," + + " \"zip\":\"SW1A 1AA\"," + + " \"country\":\"GB\"" + + "}," + + "\"phone\":{" + + " \"country_code\":\"+44\"," + + " \"number\":\"7911123456\"" + + "}," + + "\"allow_update\":true" + + "}"; + + final RequestCustomerSource source = serializer.fromJson(swaggerJson, RequestCustomerSource.class); + + assertNotNull(source); + assertEquals("cus_y3oqhf46pyzuxjbcn2giaqnb44", source.getId()); + assertNotNull(source.getBillingAddress()); + assertEquals("123 High Street", source.getBillingAddress().getAddressLine1()); + assertNotNull(source.getPhone()); + assertEquals("+44", source.getPhone().getCountryCode()); + assertTrue(source.getAllowUpdate()); + } + + @Test + void shouldRoundTripSerialize() { + final RequestCustomerSource original = RequestCustomerSource.builder() + .id("cus_y3oqhf46pyzuxjbcn2giaqnb44") + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .country(CountryCode.GB) + .build()) + .allowUpdate(true) + .build(); + + final String json = serializer.toJson(original); + final RequestCustomerSource deserialized = serializer.fromJson(json, RequestCustomerSource.class); + + assertNotNull(deserialized); + assertEquals("cus_y3oqhf46pyzuxjbcn2giaqnb44", deserialized.getId()); + assertNotNull(deserialized.getBillingAddress()); + assertEquals("123 High Street", deserialized.getBillingAddress().getAddressLine1()); + assertTrue(deserialized.getAllowUpdate()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"type\":\"customer\",\"id\":\"cus_y3oqhf46pyzuxjbcn2giaqnb44\"}"; + + final RequestCustomerSource source = serializer.fromJson(json, RequestCustomerSource.class); + + assertNotNull(source); + assertDoesNotThrow(() -> serializer.toJson(source)); + assertNull(source.getBillingAddress()); + assertNull(source.getPhone()); + assertNull(source.getAccountHolder()); + assertNull(source.getAllowUpdate()); + } +} diff --git a/src/test/java/com/checkout/payments/request/source/RequestIdSourceSerializationTest.java b/src/test/java/com/checkout/payments/request/source/RequestIdSourceSerializationTest.java new file mode 100644 index 00000000..01dcd223 --- /dev/null +++ b/src/test/java/com/checkout/payments/request/source/RequestIdSourceSerializationTest.java @@ -0,0 +1,172 @@ +package com.checkout.payments.request.source; + +import com.checkout.GsonSerializer; +import com.checkout.common.AccountHolder; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Phone; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class RequestIdSourceSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeWithRequiredId() { + final RequestIdSource source = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .build(); + + final String json = serializer.toJson(source); + + assertNotNull(json); + assertTrue(json.contains("\"type\":\"id\"")); + assertTrue(json.contains("\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"")); + } + + @Test + void shouldSerializeWithAllOptionalFields() { + final RequestIdSource source = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .cvv("100") + .paymentMethod("visa") + .stored(true) + .storeForFutureUse(false) + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .city("London") + .zip("SW1A 1AA") + .country(CountryCode.GB) + .build()) + .phone(Phone.builder() + .countryCode("+44") + .number("7911123456") + .build()) + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .build()) + .allowUpdate(true) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(source)); + } + + @Test + void shouldSerializeBillingAddress() { + final RequestIdSource source = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .country(CountryCode.GB) + .build()) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"billing_address\"")); + assertTrue(json.contains("\"address_line1\":\"123 High Street\"")); + } + + @Test + void shouldSerializeAllowUpdate() { + final RequestIdSource source = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .allowUpdate(true) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"allow_update\":true")); + } + + @Test + void shouldSerializeStoreForFutureUse() { + final RequestIdSource source = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .storeForFutureUse(true) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"store_for_future_use\":true")); + } + + @Test + void shouldDeserializeSwaggerExample() { + final String swaggerJson = "{" + + "\"type\":\"id\"," + + "\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"," + + "\"cvv\":\"100\"," + + "\"stored\":false," + + "\"billing_address\":{" + + " \"address_line1\":\"123 High Street\"," + + " \"city\":\"London\"," + + " \"zip\":\"SW1A 1AA\"," + + " \"country\":\"GB\"" + + "}," + + "\"phone\":{" + + " \"country_code\":\"+44\"," + + " \"number\":\"7911123456\"" + + "}," + + "\"allow_update\":false" + + "}"; + + final RequestIdSource source = serializer.fromJson(swaggerJson, RequestIdSource.class); + + assertNotNull(source); + assertEquals("src_wmlfc3zyhqzehihu7giusaaawu", source.getId()); + assertEquals("100", source.getCvv()); + assertEquals(false, source.getStored()); + assertNotNull(source.getBillingAddress()); + assertEquals("123 High Street", source.getBillingAddress().getAddressLine1()); + assertEquals(CountryCode.GB, source.getBillingAddress().getCountry()); + assertNotNull(source.getPhone()); + assertEquals("+44", source.getPhone().getCountryCode()); + assertEquals(false, source.getAllowUpdate()); + } + + @Test + void shouldRoundTripSerialize() { + final RequestIdSource original = RequestIdSource.builder() + .id("src_wmlfc3zyhqzehihu7giusaaawu") + .cvv("100") + .stored(true) + .billingAddress(Address.builder() + .addressLine1("123 High Street") + .country(CountryCode.GB) + .build()) + .allowUpdate(true) + .build(); + + final String json = serializer.toJson(original); + final RequestIdSource deserialized = serializer.fromJson(json, RequestIdSource.class); + + assertNotNull(deserialized); + assertEquals("src_wmlfc3zyhqzehihu7giusaaawu", deserialized.getId()); + assertEquals("100", deserialized.getCvv()); + assertTrue(deserialized.getStored()); + assertNotNull(deserialized.getBillingAddress()); + assertTrue(deserialized.getAllowUpdate()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"type\":\"id\",\"id\":\"src_wmlfc3zyhqzehihu7giusaaawu\"}"; + + final RequestIdSource source = serializer.fromJson(json, RequestIdSource.class); + + assertNotNull(source); + assertDoesNotThrow(() -> serializer.toJson(source)); + assertNull(source.getCvv()); + assertNull(source.getBillingAddress()); + assertNull(source.getPhone()); + assertNull(source.getAllowUpdate()); + } +} diff --git a/src/test/java/com/checkout/payments/request/source/apm/RequestSepaSourceSerializationTest.java b/src/test/java/com/checkout/payments/request/source/apm/RequestSepaSourceSerializationTest.java new file mode 100644 index 00000000..e717e5e3 --- /dev/null +++ b/src/test/java/com/checkout/payments/request/source/apm/RequestSepaSourceSerializationTest.java @@ -0,0 +1,170 @@ +package com.checkout.payments.request.source.apm; + +import com.checkout.GsonSerializer; +import com.checkout.common.AccountHolder; +import com.checkout.common.AccountHolderType; +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.checkout.common.Currency; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class RequestSepaSourceSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldSerializeWithRequiredFields() { + final RequestSepaSource source = RequestSepaSource.builder() + .country(CountryCode.FR) + .accountNumber("FR7630006000011234567890189") + .currency(Currency.EUR) + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .billingAddress(Address.builder() + .addressLine1("123 Rue de la Paix") + .city("Paris") + .zip("75000") + .country(CountryCode.FR) + .build()) + .build()) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(source)); + } + + @Test + void shouldSerializeWithAllOptionalFields() { + final RequestSepaSource source = RequestSepaSource.builder() + .country(CountryCode.FR) + .accountNumber("FR7630006000011234567890189") + .currency(Currency.EUR) + .mandateId("123456") + .mandateType(MandateType.B2B) + .dateOfSignature("2022-08-02") + .accountHolder(AccountHolder.builder() + .type(AccountHolderType.CORPORATE) + .firstName("John") + .lastName("Smith") + .companyName("Acme Corp") + .billingAddress(Address.builder() + .addressLine1("123 Rue de la Paix") + .city("Paris") + .zip("75000") + .country(CountryCode.FR) + .build()) + .build()) + .build(); + + assertDoesNotThrow(() -> serializer.toJson(source)); + } + + @Test + void shouldSerializeMandateTypeB2B() { + final RequestSepaSource source = RequestSepaSource.builder() + .country(CountryCode.FR) + .accountNumber("FR7630006000011234567890189") + .currency(Currency.EUR) + .mandateType(MandateType.B2B) + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .billingAddress(Address.builder() + .country(CountryCode.FR).build()) + .build()) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"mandate_type\":\"B2B\""), + "mandate_type should serialize as 'B2B'. Got: " + json); + } + + @Test + void shouldSerializeMandateTypeCore() { + final RequestSepaSource source = RequestSepaSource.builder() + .country(CountryCode.FR) + .accountNumber("FR7630006000011234567890189") + .currency(Currency.EUR) + .mandateType(MandateType.CORE) + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .billingAddress(Address.builder() + .country(CountryCode.FR).build()) + .build()) + .build(); + + final String json = serializer.toJson(source); + + assertTrue(json.contains("\"mandate_type\":\"Core\""), + "mandate_type should serialize as 'Core'. Got: " + json); + } + + @Test + void shouldRoundTripSerialize() { + final RequestSepaSource original = RequestSepaSource.builder() + .country(CountryCode.FR) + .accountNumber("FR7630006000011234567890189") + .currency(Currency.EUR) + .mandateId("123456") + .mandateType(MandateType.B2B) + .dateOfSignature("2022-08-02") + .accountHolder(AccountHolder.builder() + .firstName("John") + .lastName("Smith") + .billingAddress(Address.builder() + .country(CountryCode.FR).build()) + .build()) + .build(); + + final String json = serializer.toJson(original); + final RequestSepaSource deserialized = serializer.fromJson(json, RequestSepaSource.class); + + assertNotNull(deserialized); + assertEquals(CountryCode.FR, deserialized.getCountry()); + assertEquals("FR7630006000011234567890189", deserialized.getAccountNumber()); + assertEquals(MandateType.B2B, deserialized.getMandateType()); + assertEquals("123456", deserialized.getMandateId()); + } + + @Test + void shouldDeserializeSwaggerExample() { + final String swaggerJson = "{" + + "\"type\":\"sepa\"," + + "\"country\":\"FR\"," + + "\"account_number\":\"FR7630006000011234567890189\"," + + "\"currency\":\"EUR\"," + + "\"mandate_id\":\"123456\"," + + "\"mandate_type\":\"B2B\"," + + "\"date_of_signature\":\"2022-08-02\"," + + "\"account_holder\":{" + + " \"first_name\":\"John\"," + + " \"last_name\":\"Wick\"," + + " \"type\":\"Corporate\"," + + " \"company_name\":\"Checkout.com\"," + + " \"billing_address\":{" + + " \"address_line1\":\"Evergreen Terrace\"," + + " \"address_line2\":\"742\"," + + " \"city\":\"Paris\"," + + " \"zip\":\"75000\"," + + " \"country\":\"FR\"" + + " }" + + "}" + + "}"; + + final RequestSepaSource source = serializer.fromJson(swaggerJson, RequestSepaSource.class); + + assertNotNull(source); + assertEquals(CountryCode.FR, source.getCountry()); + assertEquals("FR7630006000011234567890189", source.getAccountNumber()); + assertEquals(MandateType.B2B, source.getMandateType()); + assertNotNull(source.getAccountHolder()); + assertEquals("John", source.getAccountHolder().getFirstName()); + } +} diff --git a/src/test/java/com/checkout/payments/response/source/PayPalResponseSourceSerializationTest.java b/src/test/java/com/checkout/payments/response/source/PayPalResponseSourceSerializationTest.java new file mode 100644 index 00000000..2864b92a --- /dev/null +++ b/src/test/java/com/checkout/payments/response/source/PayPalResponseSourceSerializationTest.java @@ -0,0 +1,98 @@ +package com.checkout.payments.response.source; + +import com.checkout.GsonSerializer; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +class PayPalResponseSourceSerializationTest { + + private final GsonSerializer serializer = new GsonSerializer(); + + @Test + void shouldDeserializeWithAccountHolder() { + final String json = "{" + + "\"type\":\"paypal\"," + + "\"account_holder\":{" + + " \"email\":\"john.smith@example.com\"," + + " \"full_name\":\"John Smith\"" + + "}" + + "}"; + + final PayPalResponseSource source = serializer.fromJson(json, PayPalResponseSource.class); + + assertNotNull(source); + assertNotNull(source.getAccountHolder()); + assertEquals("john.smith@example.com", source.getAccountHolder().getEmail()); + assertEquals("John Smith", source.getAccountHolder().getFullName()); + } + + @Test + void shouldDeserializeWithEmailOnly() { + final String json = "{" + + "\"type\":\"paypal\"," + + "\"account_holder\":{" + + " \"email\":\"buyer@example.com\"" + + "}" + + "}"; + + final PayPalResponseSource source = serializer.fromJson(json, PayPalResponseSource.class); + + assertNotNull(source); + assertNotNull(source.getAccountHolder()); + assertEquals("buyer@example.com", source.getAccountHolder().getEmail()); + assertNull(source.getAccountHolder().getFullName()); + } + + @Test + void shouldDeserializeSwaggerExample() { + final String swaggerJson = "{" + + "\"type\":\"paypal\"," + + "\"account_holder\":{" + + " \"email\":\"payer@example.com\"," + + " \"full_name\":\"Jane Doe\"" + + "}" + + "}"; + + final PayPalResponseSource source = serializer.fromJson(swaggerJson, PayPalResponseSource.class); + + assertNotNull(source); + assertNotNull(source.getAccountHolder()); + assertEquals("payer@example.com", source.getAccountHolder().getEmail()); + assertEquals("Jane Doe", source.getAccountHolder().getFullName()); + } + + @Test + void shouldRoundTripSerialize() { + final String original = "{" + + "\"type\":\"paypal\"," + + "\"account_holder\":{" + + " \"email\":\"john.smith@example.com\"," + + " \"full_name\":\"John Smith\"" + + "}" + + "}"; + + final PayPalResponseSource source = serializer.fromJson(original, PayPalResponseSource.class); + final String reserialised = serializer.toJson(source); + final PayPalResponseSource roundTripped = serializer.fromJson(reserialised, PayPalResponseSource.class); + + assertNotNull(roundTripped); + assertNotNull(roundTripped.getAccountHolder()); + assertEquals("john.smith@example.com", roundTripped.getAccountHolder().getEmail()); + assertEquals("John Smith", roundTripped.getAccountHolder().getFullName()); + } + + @Test + void shouldHandleAbsentOptionalFields() { + final String json = "{\"type\":\"paypal\"}"; + + final PayPalResponseSource source = serializer.fromJson(json, PayPalResponseSource.class); + + assertNotNull(source); + assertDoesNotThrow(() -> serializer.toJson(source)); + assertNull(source.getAccountHolder()); + } +} From c84863d01b4d855d17fa8227e346c851e41171c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:39:56 +0200 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20address=20PR=20review=20findings?= =?UTF-8?q?=20=E2=80=94=20serialization=20bugs=20and=20type=20safety?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AccommodationData.state: CountryCode → String (ISO 3166-2, e.g. "FL") - SepaInstrumentData.paymentType: new SepaPaymentType enum with lowercase "recurring"/"regular" values; PaymentType serialised PascalCase and was wrong - SepaInstrumentData.type: String → MandateType ("Core"/"B2B") - AchInstrumentData.accountType: new AchInstrumentAccountType enum with "savings"/"checking" (swagger values); existing AchAccountType has different values - TrustedListing.status: new TrustedListingStatus enum (Y/N/E/P/R/U) - Remove ~398 redundant @SerializedName annotations handled automatically by GsonSerializer's LOWER_CASE_WITH_UNDERSCORES naming policy --- src/main/java/com/checkout/common/Link.java | 2 - .../checkout/disputes/CompellingEvidence.java | 12 ------ .../java/com/checkout/disputes/Dispute.java | 17 -------- .../flow/entities/Customer.java | 1 - ...tionRequiredPaymentSubmissionResponse.java | 1 - .../ApprovedPaymentSubmissionResponse.java | 1 - .../responses/PaymentSessionResponse.java | 1 - .../paymentMethods/PaymentMethods.java | 3 -- .../entities/paymentMethods/ach/Ach.java | 5 --- .../paymentMethods/ach/AchAccountHolder.java | 5 --- .../paymentMethods/ach/AchIdentification.java | 2 - .../paymentMethods/alipay/AlipayCn.java | 3 -- .../paymentMethods/alipay/AlipayHk.java | 3 -- .../paymentMethods/applepay/ApplePay.java | 5 --- .../applepay/ApplePayTokenDataHeader.java | 4 -- .../paymentMethods/bancontact/Bancontact.java | 2 - .../entities/paymentMethods/card/Card.java | 7 ---- .../common/CardAccountHolder.java | 5 --- .../common/PaymentMethodAction.java | 4 -- .../entities/paymentMethods/dana/Dana.java | 3 -- .../entities/paymentMethods/gcash/GCash.java | 3 -- .../paymentMethods/googlepay/GooglePay.java | 5 --- .../googlepay/GooglePayTokenData.java | 4 -- .../paymentMethods/kakaopay/KakaoPay.java | 3 -- .../klarna/KlarnaAccountHolder.java | 2 - .../paymentMethods/multibanco/Multibanco.java | 2 - .../entities/paymentMethods/p24/P24.java | 2 - .../entities/paymentMethods/qpay/Qpay.java | 2 - .../entities/paymentMethods/sepa/Sepa.java | 3 -- .../sepa/SepaAccountHolder.java | 4 -- .../paymentMethods/sepa/SepaMandate.java | 2 - .../entities/paymentMethods/swish/Swish.java | 3 -- .../swish/SwishAccountHolder.java | 3 -- .../entities/paymentMethods/tabby/Tabby.java | 2 - .../entities/paymentMethods/tng/Tng.java | 3 -- .../paymentMethods/truemoney/TrueMoney.java | 3 -- .../setups/requests/PaymentSetupsRequest.java | 3 -- .../setups/responses/PaymentSetupSource.java | 19 --------- .../PaymentSetupsConfirmResponse.java | 8 ---- .../responses/PaymentSetupsResponse.java | 2 - .../create/CreateInstrumentSepaRequest.java | 3 -- .../get/GetCardInstrumentResponse.java | 13 ------ .../update/AchInstrumentAccountType.java | 13 ++++++ .../instruments/update/SepaPaymentType.java | 13 ++++++ .../update/UpdateInstrumentAchRequest.java | 8 +--- .../update/UpdateInstrumentSepaRequest.java | 15 ++----- .../requests/create/ShippingInstruction.java | 4 -- .../checkout/payments/AccommodationData.java | 11 +---- .../checkout/payments/AccommodationGuest.java | 4 -- .../checkout/payments/AccommodationRoom.java | 2 - .../com/checkout/payments/Aggregator.java | 4 -- .../checkout/payments/PaymentProcessing.java | 29 ------------- .../checkout/payments/PaymentRecipient.java | 3 -- .../checkout/payments/ProcessingSettings.java | 41 ------------------- .../com/checkout/payments/ThreeDSData.java | 7 ---- .../com/checkout/payments/TrustedListing.java | 2 +- .../payments/TrustedListingStatus.java | 31 ++++++++++++++ .../payments/contexts/PaymentContexts.java | 6 --- .../PaymentContextsAccommodationData.java | 9 ---- .../payments/hosted/HostedPaymentRequest.java | 14 ------- .../payments/links/PaymentLinkRequest.java | 13 ------ .../payments/request/DunningRetryRequest.java | 3 -- .../payments/request/PaymentRequest.java | 15 ------- .../payments/request/PaymentRetryRequest.java | 3 -- .../payments/request/PayoutRequest.java | 3 -- .../source/RequestBankAccountSource.java | 6 --- .../request/source/RequestCardSource.java | 6 --- .../request/source/RequestCustomerSource.java | 4 -- .../request/source/RequestIdSource.java | 6 --- .../source/RequestNetworkTokenSource.java | 7 ---- .../source/RequestProviderTokenSource.java | 3 -- .../request/source/RequestTokenSource.java | 4 -- .../request/source/apm/RequestAchSource.java | 6 --- .../source/apm/RequestAfterPaySource.java | 2 - .../request/source/apm/RequestAlmaSource.java | 2 - .../source/apm/RequestBancontactSource.java | 4 -- .../source/apm/RequestBizumSource.java | 2 - .../source/apm/RequestCvConnectSource.java | 2 - .../request/source/apm/RequestEpsSource.java | 2 - .../source/apm/RequestFawrySource.java | 4 -- .../source/apm/RequestGiropaySource.java | 3 -- .../source/apm/RequestKlarnaSource.java | 2 - .../request/source/apm/RequestKnetSource.java | 10 ----- .../source/apm/RequestMultiBancoSource.java | 4 -- .../request/source/apm/RequestP24Source.java | 5 --- .../source/apm/RequestPlaidSource.java | 3 -- .../source/apm/RequestPostFinanceSource.java | 4 -- .../request/source/apm/RequestQPaySource.java | 2 - .../request/source/apm/RequestSepaSource.java | 7 ---- .../source/apm/RequestSequraSource.java | 2 - .../source/apm/RequestSofortSource.java | 3 -- .../source/apm/RequestSwishSource.java | 4 -- .../source/apm/RequestTamaraSource.java | 2 - .../source/apm/RequestTrustlySource.java | 2 - .../source/apm/RequestWeChatPaySource.java | 2 - .../response/source/PayPalResponseSource.java | 3 -- .../sender/PaymentIndividualSender.java | 7 ---- 97 files changed, 65 insertions(+), 493 deletions(-) create mode 100644 src/main/java/com/checkout/instruments/update/AchInstrumentAccountType.java create mode 100644 src/main/java/com/checkout/instruments/update/SepaPaymentType.java create mode 100644 src/main/java/com/checkout/payments/TrustedListingStatus.java diff --git a/src/main/java/com/checkout/common/Link.java b/src/main/java/com/checkout/common/Link.java index df24a212..059f59b6 100644 --- a/src/main/java/com/checkout/common/Link.java +++ b/src/main/java/com/checkout/common/Link.java @@ -1,6 +1,5 @@ package com.checkout.common; -import com.google.gson.annotations.SerializedName; import lombok.Data; @Data @@ -34,7 +33,6 @@ public final class Link { * QR code data for redirect payments. * [Optional] */ - @SerializedName("qr_code") private QrCode qrCode; } diff --git a/src/main/java/com/checkout/disputes/CompellingEvidence.java b/src/main/java/com/checkout/disputes/CompellingEvidence.java index d0472df5..0ad4d24a 100644 --- a/src/main/java/com/checkout/disputes/CompellingEvidence.java +++ b/src/main/java/com/checkout/disputes/CompellingEvidence.java @@ -1,7 +1,5 @@ package com.checkout.disputes; -import com.google.gson.annotations.SerializedName; - import java.time.Instant; import java.util.List; @@ -12,7 +10,6 @@ public final class CompellingEvidence { * [Required] * Enum: "Merchandise" "Services" */ - @SerializedName("merchandise_or_service") private String merchandiseOrService; /** @@ -20,7 +17,6 @@ public final class CompellingEvidence { * [Required] * min 1 character, max 5000 characters */ - @SerializedName("merchandise_or_service_desc") private String merchandiseOrServiceDesc; /** @@ -28,14 +24,12 @@ public final class CompellingEvidence { * [Required] * Format: date-time (RFC 3339) */ - @SerializedName("merchandise_or_service_provided_date") private Instant merchandiseOrServiceProvidedDate; /** * The shipping or delivery status of the merchandise. * [Optional] */ - @SerializedName("shipping_delivery_status") private ShippingDeliveryStatusType shippingDeliveryStatus; /** @@ -43,7 +37,6 @@ public final class CompellingEvidence { * [Optional] * max 50 characters */ - @SerializedName("tracking_information") private TrackingInformationType trackingInformation; /** @@ -51,14 +44,12 @@ public final class CompellingEvidence { * [Optional] * max 50 characters */ - @SerializedName("user_id") private String userId; /** * The IP address used for the transaction (IPv4 or IPv6). * [Optional] */ - @SerializedName("ip_address") private String ipAddress; /** @@ -66,14 +57,12 @@ public final class CompellingEvidence { * [Optional] * min 15 characters, max 64 characters */ - @SerializedName("device_id") private String deviceId; /** * The shipping address used for the transaction. * [Optional] */ - @SerializedName("shipping_address") private ShippingAddress shippingAddress; /** @@ -81,7 +70,6 @@ public final class CompellingEvidence { * At least 2 items required. * [Required] */ - @SerializedName("historical_transactions") private List historicalTransactions; } diff --git a/src/main/java/com/checkout/disputes/Dispute.java b/src/main/java/com/checkout/disputes/Dispute.java index be2c4d1d..48f88b79 100644 --- a/src/main/java/com/checkout/disputes/Dispute.java +++ b/src/main/java/com/checkout/disputes/Dispute.java @@ -2,7 +2,6 @@ import com.checkout.common.Currency; import com.checkout.common.Resource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; @@ -51,42 +50,36 @@ public final class Dispute extends Resource { * The card scheme reason code for the dispute. * [Optional] */ - @SerializedName("reason_code") private String reasonCode; /** * The payment identifier. * [Optional] */ - @SerializedName("payment_id") private String paymentId; /** * The payment action identifier. * [Optional] */ - @SerializedName("payment_action_id") private String paymentActionId; /** * The payment reference or order ID. * [Optional] */ - @SerializedName("payment_reference") private String paymentReference; /** * The acquirer reference number for the payment. * [Optional] */ - @SerializedName("payment_arn") private String paymentArn; /** * The payment method or card scheme. * [Optional] */ - @SerializedName("payment_method") private String paymentMethod; /** @@ -94,7 +87,6 @@ public final class Dispute extends Resource { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("evidence_required_by") private Instant evidenceRequiredBy; /** @@ -102,7 +94,6 @@ public final class Dispute extends Resource { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("received_on") private Instant receivedOn; /** @@ -110,7 +101,6 @@ public final class Dispute extends Resource { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("last_update") private Instant lastUpdate; /** @@ -118,14 +108,12 @@ public final class Dispute extends Resource { * [Optional] * Enum: "rapid_dispute_resolution" "negative_amount" "already_refunded" */ - @SerializedName("resolved_reason") private DisputeResolvedReason resolvedReason; /** * Whether the dispute is eligible for Visa Compelling Evidence 3.0. * [Optional] */ - @SerializedName("is_ce_candidate") private Boolean isCeCandidate; // Not available on Previous API @@ -134,35 +122,30 @@ public final class Dispute extends Resource { * The client entity linked to this dispute. * [Optional] */ - @SerializedName("entity_id") private String entityId; /** * The sub-entity linked to this dispute. * [Optional] */ - @SerializedName("sub_entity_id") private String subEntityId; /** * The processing channel linked to this dispute. * [Optional] */ - @SerializedName("processing_channel") private String processingChannel; /** * The business segment identifier. * [Optional] */ - @SerializedName("segment_id") private String segmentId; /** * The merchant category code for the payment. * [Optional] */ - @SerializedName("payment_mcc") private String paymentMcc; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java index dea1bda3..b15f3bca 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/Customer.java @@ -1,7 +1,6 @@ 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; diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java index 22a6c813..e555037d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ActionRequiredPaymentSubmissionResponse.java @@ -1,7 +1,6 @@ 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; diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java index 9098cedc..9d3e6e66 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/ApprovedPaymentSubmissionResponse.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.flow.responses; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java index 2e2b9de1..125d10de 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/flow/responses/PaymentSessionResponse.java @@ -1,7 +1,6 @@ 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; diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java index 82e88306..4e8ed4bf 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/PaymentMethods.java @@ -37,7 +37,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.twint.Twint; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.vipps.Vipps; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.wechatpay.WeChatPay; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -146,14 +145,12 @@ public final class PaymentMethods { * Alipay CN payment method configuration. * [Optional] */ - @SerializedName("alipay_cn") private AlipayCn alipayCn; /** * Alipay HK payment method configuration. * [Optional] */ - @SerializedName("alipay_hk") private AlipayHk alipayHk; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java index c38f9c88..6fb15431 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/Ach.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -16,14 +15,12 @@ public final class Ach extends PaymentMethodBase { * The type of Direct Debit account. * [Optional] */ - @SerializedName("account_type") private AchAccountType accountType; /** * The account holder details. * [Optional] */ - @SerializedName("account_holder") private AchAccountHolder accountHolder; /** @@ -31,7 +28,6 @@ public final class Ach extends PaymentMethodBase { * [Optional] * min 4 characters, max 17 characters */ - @SerializedName("account_number") private String accountNumber; /** @@ -39,7 +35,6 @@ public final class Ach extends PaymentMethodBase { * [Optional] * min 8 characters, max 9 characters */ - @SerializedName("bank_code") private String bankCode; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java index 93d7ba82..b5cbeef4 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchAccountHolder.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,21 +24,18 @@ public final class AchAccountHolder { * The first name of the account holder. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The last name of the account holder. * [Optional] */ - @SerializedName("last_name") private String lastName; /** * The legal name of a registered company that holds the account. * [Optional] */ - @SerializedName("company_name") private String companyName; /** @@ -47,7 +43,6 @@ public final class AchAccountHolder { * [Optional] * Format: yyyy-MM-dd */ - @SerializedName("date_of_birth") private String dateOfBirth; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java index 0c07810a..af8096b9 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/ach/AchIdentification.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.ach; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,7 +24,6 @@ public final class AchIdentification { * The country where the document was issued. * [Optional] */ - @SerializedName("issuing_country") private String issuingCountry; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java index e259628b..1686e69f 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayCn.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class AlipayCn extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class AlipayCn extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java index 867ca7bd..6c082815 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/alipay/AlipayHk.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class AlipayHk extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class AlipayHk extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java index 861896da..82b2195b 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePay.java @@ -3,7 +3,6 @@ import com.checkout.common.Phone; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -20,7 +19,6 @@ public final class ApplePay extends PaymentMethodBase { * The Apple Pay encrypted payment token data. * [Optional] */ - @SerializedName("token_data") private ApplePayTokenData tokenData; /** @@ -34,14 +32,12 @@ public final class ApplePay extends PaymentMethodBase { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expires_on") private Instant expiresOn; /** * Set to true if you intend to reuse the payment credentials in subsequent payments. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** @@ -54,6 +50,5 @@ public final class ApplePay extends PaymentMethodBase { * The card account holder details. * [Optional] */ - @SerializedName("account_holder") private CardAccountHolder accountHolder; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java index e58921e3..a57d996a 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/applepay/ApplePayTokenDataHeader.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.applepay; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,20 +18,17 @@ public final class ApplePayTokenDataHeader { * The ephemeral public key bytes. * [Optional] */ - @SerializedName("ephemeral_public_key") private String ephemeralPublicKey; /** * The hash of the X.509 encoded public key bytes of the merchant's certificate. * [Optional] */ - @SerializedName("public_key_hash") private String publicKeyHash; /** * The transaction identifier, generated on the device. * [Optional] */ - @SerializedName("transaction_id") private String transactionId; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java index 33275f87..b7ef329e 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/bancontact/Bancontact.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.bancontact; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -17,6 +16,5 @@ public final class Bancontact extends PaymentMethodBase { * [Optional] * min 3 characters, max 100 characters */ - @SerializedName("account_holder_name") private String accountHolderName; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java index fa7cb0bf..d2956f63 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/card/Card.java @@ -3,7 +3,6 @@ import com.checkout.common.Phone; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -44,14 +43,12 @@ public final class Card extends PaymentMethodBase { * The expiry month of the card. * [Optional] */ - @SerializedName("expiry_month") private Integer expiryMonth; /** * The expiry year of the card. * [Optional] */ - @SerializedName("expiry_year") private Integer expiryYear; /** @@ -77,14 +74,12 @@ public final class Card extends PaymentMethodBase { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expires_on") private Instant expiresOn; /** * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** @@ -97,13 +92,11 @@ public final class Card extends PaymentMethodBase { * The card account holder details. * [Optional] */ - @SerializedName("account_holder") private CardAccountHolder accountHolder; /** * Indicates whether to use the Real-Time Account Updater to update the card information. * [Optional] */ - @SerializedName("allow_update") private Boolean allowUpdate; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java index 4353722a..3f9c1669 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/CardAccountHolder.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,27 +24,23 @@ public final class CardAccountHolder { * The card account holder's first name. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The card account holder's last name. * [Optional] */ - @SerializedName("last_name") private String lastName; /** * The card account holder's middle name. * [Optional] */ - @SerializedName("middle_name") private String middleName; /** * Indicates whether the ANI (account name inquiry) check is performed with the card scheme. * [Optional] */ - @SerializedName("account_name_inquiry") private Boolean accountNameInquiry; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java index a28c8bef..d844fa76 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/common/PaymentMethodAction.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,20 +24,17 @@ public final class PaymentMethodAction { * The client token for the Klarna or PayPal SDK. * [Optional] */ - @SerializedName("client_token") private String clientToken; /** * The session identifier for the Klarna payment method session. * [Optional] */ - @SerializedName("session_id") private String sessionId; /** * The PayPal order ID to use with the PayPal SDK. * [Optional] */ - @SerializedName("order_id") private String orderId; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java index dae9f5b7..2b754c27 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/dana/Dana.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class Dana extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class Dana extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java index 8b792a22..1b339d9b 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/gcash/GCash.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class GCash extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class GCash extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java index 62b49767..abdc9737 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePay.java @@ -3,7 +3,6 @@ import com.checkout.common.Phone; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.CardAccountHolder; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -20,7 +19,6 @@ public final class GooglePay extends PaymentMethodBase { * The Google Pay encrypted payment token data. * [Optional] */ - @SerializedName("token_data") private GooglePayTokenData tokenData; /** @@ -34,14 +32,12 @@ public final class GooglePay extends PaymentMethodBase { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expires_on") private Instant expiresOn; /** * Set to true if you intend to reuse the payment credentials in subsequent payments. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** @@ -54,6 +50,5 @@ public final class GooglePay extends PaymentMethodBase { * The card account holder details. * [Optional] */ - @SerializedName("account_holder") private CardAccountHolder accountHolder; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java index 1f55202b..9450eb69 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/googlepay/GooglePayTokenData.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.googlepay; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,7 +18,6 @@ public final class GooglePayTokenData { * The encryption and signing scheme used to create this message. Defaults to ECv0. * [Optional] */ - @SerializedName("protocol_version") private String protocolVersion; /** @@ -32,13 +30,11 @@ public final class GooglePayTokenData { * A serialized JSON string containing the encryptedMessage, ephemeralPublicKey, and tag. * [Optional] */ - @SerializedName("signed_message") private String signedMessage; /** * The public key provided to the Google API in the tokenizationSpecification.parameters field. * [Optional] */ - @SerializedName("tokenization_key") private String tokenizationKey; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java index 45d4eb9e..bc3faedd 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/kakaopay/KakaoPay.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class KakaoPay extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class KakaoPay extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java index 96d302e2..7f8d10bc 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/klarna/KlarnaAccountHolder.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.klarna; import com.checkout.common.Address; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,6 +19,5 @@ public final class KlarnaAccountHolder { * The billing address of the Klarna account holder. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java index 78d53c98..7d7a2c9b 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/multibanco/Multibanco.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.multibanco; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -17,6 +16,5 @@ public final class Multibanco extends PaymentMethodBase { * [Optional] * min 3 characters, max 100 characters */ - @SerializedName("account_holder_name") private String accountHolderName; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java index 17111cf4..1763a6cb 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/p24/P24.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.p24; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -16,6 +15,5 @@ public final class P24 extends PaymentMethodBase { * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private P24AccountHolder accountHolder; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java index 332179c8..1b883419 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/qpay/Qpay.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.qpay; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -16,7 +15,6 @@ public final class Qpay extends PaymentMethodBase { * The Qatari national ID. Must start with 2 or 3, followed by 10 digits. * [Optional] */ - @SerializedName("national_id") private String nationalId; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java index baed1ac6..fece1a8c 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/Sepa.java @@ -2,7 +2,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.common.Currency; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -17,14 +16,12 @@ public final class Sepa extends PaymentMethodBase { * The account holder details. * [Optional] */ - @SerializedName("account_holder") private SepaAccountHolder accountHolder; /** * The account holder's IBAN. * [Optional] */ - @SerializedName("account_number") private String accountNumber; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java index a00b7a21..569e3b0d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaAccountHolder.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,20 +24,17 @@ public final class SepaAccountHolder { * The first name of the account holder. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The last name of the account holder. * [Optional] */ - @SerializedName("last_name") private String lastName; /** * The legal name of a registered company that holds the account. * [Optional] */ - @SerializedName("company_name") private String companyName; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java index 047ee59f..1a91574a 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/sepa/SepaMandate.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.sepa; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -34,6 +33,5 @@ public final class SepaMandate { * [Optional] * Format: yyyy-MM-dd */ - @SerializedName("date_of_signature") private LocalDate dateOfSignature; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java index b7f9d749..93061b52 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/Swish.java @@ -1,7 +1,6 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.swish; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -16,13 +15,11 @@ public final class Swish extends PaymentMethodBase { * A description that appears on the customer's billing statement. * [Optional] */ - @SerializedName("billing_descriptor") private String billingDescriptor; /** * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private SwishAccountHolder accountHolder; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java index a1ab4496..2acaf06f 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/swish/SwishAccountHolder.java @@ -1,6 +1,5 @@ package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.swish; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -19,13 +18,11 @@ public final class SwishAccountHolder { * The account holder's first name. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The account holder's last name. * [Optional] */ - @SerializedName("last_name") private String lastName; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java index d26a7935..fe3f5eb6 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tabby/Tabby.java @@ -2,7 +2,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodInitialization; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -25,6 +24,5 @@ public final class Tabby extends PaymentMethodBase { * The available payment types for Tabby (for example, installments). * [Optional] */ - @SerializedName("payment_types") private List paymentTypes; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java index dbd0ead5..b213d398 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/tng/Tng.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class Tng extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class Tng extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java index d54b5d42..8b89c7f3 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/truemoney/TrueMoney.java @@ -3,7 +3,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.OsType; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.TerminalType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ public final class TrueMoney extends PaymentMethodBase { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -27,6 +25,5 @@ public final class TrueMoney extends PaymentMethodBase { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java index 8eb91d7f..4676f78d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/requests/PaymentSetupsRequest.java @@ -8,7 +8,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.order.Order; import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.PaymentMethods; import com.checkout.handlepaymentsandpayouts.setups.entities.settings.Settings; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,7 +27,6 @@ public final class PaymentSetupsRequest { * [Required] * Pattern: ^(pc)_(\w{26})$ */ - @SerializedName("processing_channel_id") private String processingChannelId; /** @@ -68,7 +66,6 @@ public final class PaymentSetupsRequest { * The payment methods that are enabled on your account and available for use * [Optional] */ - @SerializedName("payment_methods") private PaymentMethods paymentMethods; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java index f5b90d05..707f973d 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupSource.java @@ -11,7 +11,6 @@ import com.checkout.handlepaymentsandpayouts.payments.common.source.cardsource.AccountUpdateStatusType; import com.checkout.handlepaymentsandpayouts.payments.common.source.cardsource.accountholder.AbstractAccountHolder; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -36,14 +35,12 @@ public final class PaymentSetupSource { * The expiry month. * [Optional] */ - @SerializedName("expiry_month") private Integer expiryMonth; /** * The expiry year. * [Optional] */ - @SerializedName("expiry_year") private Integer expiryYear; /** @@ -75,7 +72,6 @@ public final class PaymentSetupSource { * The payment source owner's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -100,35 +96,30 @@ public final class PaymentSetupSource { * Deprecated. Replaced by local_schemes. The local co-branded card scheme. * [Optional] */ - @SerializedName("scheme_local") private String schemeLocal; /** * The local co-branded card schemes. * [Optional] */ - @SerializedName("local_schemes") private List localSchemes; /** * The card type. * [Optional] */ - @SerializedName("card_type") private CardType cardType; /** * The card category. * [Optional] */ - @SerializedName("card_category") private CardCategoryType cardCategory; /** * The card wallet type. * [Optional] */ - @SerializedName("card_wallet_type") private CardWalletType cardWalletType; /** @@ -141,69 +132,59 @@ public final class PaymentSetupSource { * The card issuer's country (two-letter ISO code). * [Optional] */ - @SerializedName("issuer_country") private String issuerCountry; /** * The issuer/card scheme product identifier. * [Optional] */ - @SerializedName("product_id") private String productId; /** * The issuer/card scheme product type. * [Optional] */ - @SerializedName("product_type") private String productType; /** * The Address Verification System check result. * [Optional] */ - @SerializedName("avs_check") private String avsCheck; /** * The card verification value (CVV) check result. * [Optional] */ - @SerializedName("cvv_check") private String cvvCheck; /** * A unique reference to the underlying card for network tokens (e.g., Apple Pay, Google Pay). * [Optional] */ - @SerializedName("payment_account_reference") private String paymentAccountReference; /** * The JWE encrypted full card number that has been updated by real-time account updater. * [Optional] */ - @SerializedName("encrypted_card_number") private String encryptedCardNumber; /** * Specifies what card information was updated by the Real-Time Account Updater. * [Optional] */ - @SerializedName("account_update_status") private AccountUpdateStatusType accountUpdateStatus; /** * Provides the failure code if the Real-Time Account Updater fails to update the card information. * [Optional] */ - @SerializedName("account_update_failure_code") private String accountUpdateFailureCode; /** * Information about the account holder of the card. * [Optional] */ - @SerializedName("account_holder") private AbstractAccountHolder accountHolder; } diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java index 3ae34533..dcd31577 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsConfirmResponse.java @@ -38,7 +38,6 @@ public final class PaymentSetupsConfirmResponse extends Resource { * The unique identifier for the action performed against this payment. * [Optional] */ - @SerializedName("action_id") private String actionId; /** @@ -69,7 +68,6 @@ public final class PaymentSetupsConfirmResponse extends Resource { * The Gateway response code. * [Optional] */ - @SerializedName("response_code") private String responseCode; /** @@ -77,28 +75,24 @@ public final class PaymentSetupsConfirmResponse extends Resource { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("processed_on") private Instant processedOn; /** * The full amount from the original authorization, if a partial authorization was requested and approved. * [Optional] */ - @SerializedName("amount_requested") private Long amountRequested; /** * The acquirer authorization code if the payment was authorized. * [Optional] */ - @SerializedName("auth_code") private String authCode; /** * The Gateway response summary. * [Optional] */ - @SerializedName("response_summary") private String responseSummary; /** @@ -106,7 +100,6 @@ public final class PaymentSetupsConfirmResponse extends Resource { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expires_on") private String expiresOn; /** @@ -169,7 +162,6 @@ public final class PaymentSetupsConfirmResponse extends Resource { * The scheme transaction identifier. * [Optional] */ - @SerializedName("scheme_id") private String schemeId; /** diff --git a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java index 4fa87089..868b8b9c 100644 --- a/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java +++ b/src/main/java/com/checkout/handlepaymentsandpayouts/setups/responses/PaymentSetupsResponse.java @@ -9,7 +9,6 @@ import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.PaymentMethods; import com.checkout.handlepaymentsandpayouts.setups.entities.settings.Settings; import com.checkout.payments.PaymentType; -import com.google.gson.annotations.SerializedName; import java.util.List; import lombok.AllArgsConstructor; @@ -113,6 +112,5 @@ public final class PaymentSetupsResponse extends Resource { * presentation priority, with the first item being the highest priority. * [Optional] */ - @SerializedName("available_payment_methods") private List availablePaymentMethods; } diff --git a/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java b/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java index bf25dc8b..b8811d86 100644 --- a/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java +++ b/src/main/java/com/checkout/instruments/create/CreateInstrumentSepaRequest.java @@ -2,7 +2,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.InstrumentType; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -19,14 +18,12 @@ public final class CreateInstrumentSepaRequest extends CreateInstrumentRequest { * The details of the SEPA mandate, including IBAN, country, currency, payment type, and mandate ID. * [Required] */ - @SerializedName("instrument_data") private InstrumentData instrumentData; /** * The account holder details. Must include first_name, last_name, and billing_address. * [Required] */ - @SerializedName("account_holder") private AccountHolder accountHolder; /** diff --git a/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java b/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java index bca19ace..c4e2f944 100644 --- a/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java +++ b/src/main/java/com/checkout/instruments/get/GetCardInstrumentResponse.java @@ -5,7 +5,6 @@ import com.checkout.common.CardWalletType; import com.checkout.common.CountryCode; import com.checkout.common.InstrumentType; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -21,14 +20,12 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { * The expiry month of the card. * [Optional] */ - @SerializedName("expiry_month") private Integer expiryMonth; /** * The expiry year of the card. * [Optional] */ - @SerializedName("expiry_year") private Integer expiryYear; /** @@ -47,7 +44,6 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { * The local card scheme. * [Optional] */ - @SerializedName("scheme_local") private String schemeLocal; /** @@ -66,14 +62,12 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { * The card type. * [Optional] */ - @SerializedName("card_type") private CardType cardType; /** * The card category. * [Optional] */ - @SerializedName("card_category") private CardCategory cardCategory; /** @@ -86,35 +80,30 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { * The country of the card issuer. * [Optional] */ - @SerializedName("issuer_country") private CountryCode issuerCountry; /** * The card product identifier. * [Optional] */ - @SerializedName("product_id") private String productId; /** * The card product type. * [Optional] */ - @SerializedName("product_type") private String productType; /** * The JWE-encrypted full card number. This is only present if your level of PCI compliance is SAQ-D. * [Optional] */ - @SerializedName("encrypted_card_number") private String encryptedCardNumber; /** * The network token associated with this instrument. * [Optional] */ - @SerializedName("network_token") private InstrumentNetworkToken networkToken; /** @@ -122,14 +111,12 @@ public final class GetCardInstrumentResponse extends GetInstrumentResponse { * [Optional] * Enum: "googlepay" "applepay" */ - @SerializedName("card_wallet_type") private CardWalletType cardWalletType; /** * Indicates whether the card is subject to interchange regulation. * [Required] */ - @SerializedName("regulated_indicator") private Boolean regulatedIndicator; } diff --git a/src/main/java/com/checkout/instruments/update/AchInstrumentAccountType.java b/src/main/java/com/checkout/instruments/update/AchInstrumentAccountType.java new file mode 100644 index 00000000..d52c76e9 --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/AchInstrumentAccountType.java @@ -0,0 +1,13 @@ +package com.checkout.instruments.update; + +import com.google.gson.annotations.SerializedName; + +public enum AchInstrumentAccountType { + + @SerializedName("savings") + SAVINGS, + + @SerializedName("checking") + CHECKING + +} diff --git a/src/main/java/com/checkout/instruments/update/SepaPaymentType.java b/src/main/java/com/checkout/instruments/update/SepaPaymentType.java new file mode 100644 index 00000000..97b55fd6 --- /dev/null +++ b/src/main/java/com/checkout/instruments/update/SepaPaymentType.java @@ -0,0 +1,13 @@ +package com.checkout.instruments.update; + +import com.google.gson.annotations.SerializedName; + +public enum SepaPaymentType { + + @SerializedName("recurring") + RECURRING, + + @SerializedName("regular") + REGULAR + +} diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java index 528f1d5a..d9f2148b 100644 --- a/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentAchRequest.java @@ -4,7 +4,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.Currency; import com.checkout.common.InstrumentType; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -20,10 +19,8 @@ @ToString(callSuper = true) public final class UpdateInstrumentAchRequest extends UpdateInstrumentRequest { - @SerializedName("instrument_data") private AchInstrumentData instrumentData; - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder @@ -44,13 +41,10 @@ public UpdateInstrumentAchRequest() { @AllArgsConstructor public static final class AchInstrumentData { - @SerializedName("account_type") - private String accountType; + private AchInstrumentAccountType accountType; - @SerializedName("account_number") private String accountNumber; - @SerializedName("bank_code") private String bankCode; private Currency currency; diff --git a/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java index 55f89b2f..a3ac4c47 100644 --- a/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java +++ b/src/main/java/com/checkout/instruments/update/UpdateInstrumentSepaRequest.java @@ -4,8 +4,7 @@ import com.checkout.common.CountryCode; import com.checkout.common.Currency; import com.checkout.common.InstrumentType; -import com.checkout.payments.PaymentType; -import com.google.gson.annotations.SerializedName; +import com.checkout.payments.request.source.apm.MandateType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -27,14 +26,12 @@ public final class UpdateInstrumentSepaRequest extends UpdateInstrumentRequest { * SEPA-specific instrument data to update. * [Optional] */ - @SerializedName("instrument_data") private SepaInstrumentData instrumentData; /** * The account holder details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder @@ -56,16 +53,15 @@ public UpdateInstrumentSepaRequest() { public static final class SepaInstrumentData { /** - * The SEPA instrument type. + * The SEPA mandate type. * [Optional] */ - private String type; + private MandateType type; /** * The IBAN account number. * [Optional] */ - @SerializedName("account_number") private String accountNumber; /** @@ -84,14 +80,12 @@ public static final class SepaInstrumentData { * The SEPA payment type. * [Optional] */ - @SerializedName("payment_type") - private PaymentType paymentType; + private SepaPaymentType paymentType; /** * The SEPA mandate identifier. * [Optional] */ - @SerializedName("mandate_id") private String mandateId; /** @@ -99,7 +93,6 @@ public static final class SepaInstrumentData { * [Optional] * Format: yyyy-MM-dd */ - @SerializedName("date_of_signature") private LocalDate dateOfSignature; } diff --git a/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java b/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java index 3f727378..c7f33af9 100644 --- a/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java +++ b/src/main/java/com/checkout/issuing/cards/requests/create/ShippingInstruction.java @@ -1,7 +1,6 @@ package com.checkout.issuing.cards.requests.create; import com.checkout.common.Address; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.Data; @@ -15,14 +14,12 @@ public final class ShippingInstruction { * @deprecated No longer supported. */ @Deprecated - @SerializedName("shipping_recipient") private String shippingRecipient; /** * The address to ship the physical card to. * [Optional] */ - @SerializedName("shipping_address") private Address shippingAddress; /** @@ -31,6 +28,5 @@ public final class ShippingInstruction { * @deprecated No longer supported. */ @Deprecated - @SerializedName("additional_comment") private String additionalComment; } diff --git a/src/main/java/com/checkout/payments/AccommodationData.java b/src/main/java/com/checkout/payments/AccommodationData.java index def5edf6..d540a746 100644 --- a/src/main/java/com/checkout/payments/AccommodationData.java +++ b/src/main/java/com/checkout/payments/AccommodationData.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.CountryCode; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,7 +27,6 @@ public final class AccommodationData { * The booking reference for this accommodation. * [Optional] */ - @SerializedName("booking_reference") private String bookingReference; /** @@ -36,7 +34,6 @@ public final class AccommodationData { * [Optional] * Format: date (yyyy-MM-dd) */ - @SerializedName("check_in_date") private LocalDate checkInDate; /** @@ -44,7 +41,6 @@ public final class AccommodationData { * [Optional] * Format: date (yyyy-MM-dd) */ - @SerializedName("check_out_date") private LocalDate checkOutDate; /** @@ -54,10 +50,10 @@ public final class AccommodationData { private Address address; /** - * The state or region code where the property is located, as an ISO 3166-1 alpha-2 code. + * The state or region code where the property is located, as an ISO 3166-2 subdivision code. * [Optional] */ - private CountryCode state; + private String state; /** * The country where the property is located, as an ISO 3166-1 alpha-2 code. @@ -75,7 +71,6 @@ public final class AccommodationData { * The number of rooms booked. * [Optional] */ - @SerializedName("number_of_rooms") private Integer numberOfRooms; /** @@ -94,14 +89,12 @@ public final class AccommodationData { * The property's phone numbers. * [Optional] */ - @SerializedName("property_phone") private List propertyPhone; /** * The customer service phone numbers for the property. * [Optional] */ - @SerializedName("customer_service_phone") private List customerServicePhone; } diff --git a/src/main/java/com/checkout/payments/AccommodationGuest.java b/src/main/java/com/checkout/payments/AccommodationGuest.java index 23129b59..3fe37bd1 100644 --- a/src/main/java/com/checkout/payments/AccommodationGuest.java +++ b/src/main/java/com/checkout/payments/AccommodationGuest.java @@ -1,6 +1,5 @@ package com.checkout.payments; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,14 +17,12 @@ public final class AccommodationGuest { * The guest's first name. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The guest's last name. * [Optional] */ - @SerializedName("last_name") private String lastName; /** @@ -33,7 +30,6 @@ public final class AccommodationGuest { * [Optional] * Format: date (yyyy-MM-dd) */ - @SerializedName("date_of_birth") private LocalDate dateOfBirth; } diff --git a/src/main/java/com/checkout/payments/AccommodationRoom.java b/src/main/java/com/checkout/payments/AccommodationRoom.java index 47d93a2e..c1b65a45 100644 --- a/src/main/java/com/checkout/payments/AccommodationRoom.java +++ b/src/main/java/com/checkout/payments/AccommodationRoom.java @@ -1,6 +1,5 @@ package com.checkout.payments; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,7 +21,6 @@ public final class AccommodationRoom { * The number of nights at the specified room rate. * [Optional] */ - @SerializedName("number_of_nights_at_room_rate") private String numberOfNightsAtRoomRate; } diff --git a/src/main/java/com/checkout/payments/Aggregator.java b/src/main/java/com/checkout/payments/Aggregator.java index 4a599248..cc188a3e 100644 --- a/src/main/java/com/checkout/payments/Aggregator.java +++ b/src/main/java/com/checkout/payments/Aggregator.java @@ -1,6 +1,5 @@ package com.checkout.payments; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -18,18 +17,15 @@ public final class Aggregator { /** * The sub-merchant ID. */ - @SerializedName("sub_merchant_id") private String subMerchantId; /** * The Visa identifier for the payment aggregator. */ - @SerializedName("aggregator_id_visa") private String aggregatorIdVisa; /** * The Mastercard identifier for the payment aggregator. */ - @SerializedName("aggregator_id_mc") private String aggregatorIdMc; } diff --git a/src/main/java/com/checkout/payments/PaymentProcessing.java b/src/main/java/com/checkout/payments/PaymentProcessing.java index c01a978a..d1b0760c 100644 --- a/src/main/java/com/checkout/payments/PaymentProcessing.java +++ b/src/main/java/com/checkout/payments/PaymentProcessing.java @@ -1,7 +1,6 @@ package com.checkout.payments; import com.checkout.common.CountryCode; -import com.google.gson.annotations.SerializedName; import lombok.Data; import java.util.List; @@ -13,35 +12,30 @@ public final class PaymentProcessing { * A unique identifier for the authorization submitted to the card scheme during processing. * [Optional] */ - @SerializedName("retrieval_reference_number") private String retrievalReferenceNumber; /** * A unique identifier for the transaction generated by the acquirer. * [Optional] */ - @SerializedName("acquirer_transaction_id") private String acquirerTransactionId; /** * The name of the acquirer that processed the payment. * [Optional] */ - @SerializedName("acquirer_name") private String acquirerName; /** * The two-letter ISO country code of the acquirer country. * [Optional] */ - @SerializedName("acquirer_country_code") private CountryCode acquirerCountryCode; /** * A code representing the recommended follow-up action for the payment, as provided by Checkout.com. * [Optional] */ - @SerializedName("recommendation_code") private String recommendationCode; /** @@ -54,42 +48,36 @@ public final class PaymentProcessing { * The Merchant Advice Code (MAC) provided by Mastercard with additional transaction information. * [Optional] */ - @SerializedName("partner_merchant_advice_code") private String partnerMerchantAdviceCode; /** * The original authorization response code sent by the scheme (raw response code). * [Optional] */ - @SerializedName("partner_response_code") private String partnerResponseCode; /** * Unique order identification of an Afterpay payment. * [Optional] */ - @SerializedName("partner_order_id") private String partnerOrderId; /** * The partner session identifier associated with the payment. * [Optional] */ - @SerializedName("partner_session_id") private String partnerSessionId; /** * The client token returned by the partner for client-side initialization. * [Optional] */ - @SerializedName("partner_client_token") private String partnerClientToken; /** * Unique identification of a payment provided by partner. * [Optional] */ - @SerializedName("partner_payment_id") private String partnerPaymentId; /** @@ -97,14 +85,12 @@ public final class PaymentProcessing { * [Optional] * Enum: "fpan" "dpan" */ - @SerializedName("pan_type_processed") private PanProcessedType panTypeProcessed; /** * A payload used to continue processing for multi-step payment flows. * [Optional] */ - @SerializedName("continuation_payload") private String continuationPayload; /** @@ -117,56 +103,48 @@ public final class PaymentProcessing { * The status of the payment as reported by the partner. * [Optional] */ - @SerializedName("partner_status") private String partnerStatus; /** * Unique transaction identification provided by partner. * [Optional] */ - @SerializedName("partner_transaction_id") private String partnerTransactionId; /** * Error codes provided by the partner for a failed or declined payment. * [Optional] */ - @SerializedName("partner_error_codes") private List partnerErrorCodes; /** * Error description provided by the partner. * [Optional] */ - @SerializedName("partner_error_message") private String partnerErrorMessage; /** * Authorization code provided by the partner. * [Optional] */ - @SerializedName("partner_authorization_code") private String partnerAuthorizationCode; /** * Authorization response code provided by the partner. * [Optional] */ - @SerializedName("partner_authorization_response_code") private String partnerAuthorizationResponseCode; /** * Surcharge amount applied to the transaction in minor currency units. * [Optional] */ - @SerializedName("surcharge_amount") private Long surchargeAmount; /** * Indicates whether a Checkout.com Network Token was available for the payment. * [Optional] */ - @SerializedName("cko_network_token_available") private Boolean ckoNetworkTokenAvailable; /** @@ -174,35 +152,30 @@ public final class PaymentProcessing { * [Optional] * max 2 characters */ - @SerializedName("purchase_country") private CountryCode purchaseCountry; /** * The merchant identifier configured with the scheme and used for the payment. * [Optional] */ - @SerializedName("scheme_merchant_id") private String schemeMerchantId; /** * The foreign retailer amount applied by the merchant, in minor currency units. * [Optional] */ - @SerializedName("foreign_retailer_amount") private Long foreignRetailerAmount; /** * Indicates whether a network token should be provisioned for the payment. * [Optional] */ - @SerializedName("provision_network_token") private Boolean provisionNetworkToken; /** * The merchant category code (MCC) associated with the payment. * [Optional] */ - @SerializedName("merchant_category_code") private String merchantCategoryCode; /** @@ -215,14 +188,12 @@ public final class PaymentProcessing { * The Bizum payment identifier returned when processing a Bizum payment. * [Optional] */ - @SerializedName("bizum_payment_id") private String bizumPaymentId; /** * A reconciliation identifier for the payment. * [Optional] */ - @SerializedName("reconciliation_id") private String reconciliationId; /** diff --git a/src/main/java/com/checkout/payments/PaymentRecipient.java b/src/main/java/com/checkout/payments/PaymentRecipient.java index 6479a6dc..ad28c04a 100644 --- a/src/main/java/com/checkout/payments/PaymentRecipient.java +++ b/src/main/java/com/checkout/payments/PaymentRecipient.java @@ -22,7 +22,6 @@ public final class PaymentRecipient { * an IBAN, an internal account number, or a phone number. * [Optional] */ - @SerializedName("account_number") private String accountNumber; /** @@ -43,13 +42,11 @@ public final class PaymentRecipient { * The recipient's first name. * [Optional] */ - @SerializedName("first_name") private String firstName; /** * The recipient's last name. * [Optional] */ - @SerializedName("last_name") private String lastName; } diff --git a/src/main/java/com/checkout/payments/ProcessingSettings.java b/src/main/java/com/checkout/payments/ProcessingSettings.java index a7e221cd..b3dd84f9 100644 --- a/src/main/java/com/checkout/payments/ProcessingSettings.java +++ b/src/main/java/com/checkout/payments/ProcessingSettings.java @@ -4,7 +4,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.ShippingInfo; import com.checkout.payments.previous.request.SenderInformation; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -24,49 +23,42 @@ public final class ProcessingSettings { * [Optional] * max 15 characters */ - @SerializedName("order_id") private String orderId; /** * The total amount of sales tax on the total purchase amount. * [Optional] */ - @SerializedName("tax_amount") private Long taxAmount; /** * The surcharge amount applied to the transaction in minor currency units by the merchant. * [Optional] */ - @SerializedName("surcharge_amount") private Long surchargeAmount; /** * The discount amount applied to the transaction by the merchant. * [Optional] */ - @SerializedName("discount_amount") private Long discountAmount; /** * The total charges for any import or export duty included in the transaction. * [Optional] */ - @SerializedName("duty_amount") private Long dutyAmount; /** * The total freight or shipping and handling charges for the transaction. * [Optional] */ - @SerializedName("shipping_amount") private Long shippingAmount; /** * The tax amount on the freight or shipping and handling charges for the transaction. * [Optional] */ - @SerializedName("shipping_tax_amount") private Long shippingTaxAmount; /** @@ -80,7 +72,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "mastercard" "visa" "cartes_bancaires" */ - @SerializedName("preferred_scheme") private PreferredSchema preferredScheme; /** @@ -88,35 +79,30 @@ public final class ProcessingSettings { * [Optional] * Enum: "Delayed_charge" "Resubmission" "No_show" "Reauthorization" */ - @SerializedName("merchant_initiated_reason") private MerchantInitiatedReason merchantInitiatedReason; /** * Unique number of the campaign this payment will run in. Required for Afterpay campaign invoices. * [Optional] */ - @SerializedName("campaign_id") private Long campaignId; /** * The product type of the payment. Required for wechatpay and sequra; optional for tamara. * [Optional] */ - @SerializedName("product_type") private ProductType productType; /** * The OpenID obtained from WeChat Web Authorization API. Required for Official Account or Mini Program payments. * [Optional] */ - @SerializedName("open_id") private String openId; /** * The original order amount when a payment is split. Indicates the full order price. * [Optional] */ - @SerializedName("original_order_amount") private Long originalOrderAmount; /** @@ -124,7 +110,6 @@ public final class ProcessingSettings { * [Optional] * max 32 characters */ - @SerializedName("receipt_id") private String receiptId; /** @@ -132,7 +117,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "APP" "WAP" "WEB" */ - @SerializedName("terminal_type") private TerminalType terminalType; /** @@ -140,7 +124,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "ANDROID" "IOS" */ - @SerializedName("os_type") private OsType osType; /** @@ -148,7 +131,6 @@ public final class ProcessingSettings { * [Optional] * max 127 characters */ - @SerializedName("invoice_id") private String invoiceId; /** @@ -156,7 +138,6 @@ public final class ProcessingSettings { * [Optional] * max 127 characters */ - @SerializedName("brand_name") private String brandName; /** @@ -172,7 +153,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "no_shipping" "set_provided_address" "get_from_file" */ - @SerializedName("shipping_preference") private ShippingPreference shippingPreference; /** @@ -180,35 +160,30 @@ public final class ProcessingSettings { * [Optional] * Enum: "pay_now" "continue" */ - @SerializedName("user_action") private UserAction userAction; /** * An array of key-value pairs with merchant-specific transaction context data for PayPal. * [Optional] */ - @SerializedName("set_transaction_context") private List> setTransactionContext; /** * Airline ticket and flight information for the payment. * [Optional] */ - @SerializedName("airline_data") private List airlineData; /** * The accommodation data for hotel or lodging payments. * [Optional] */ - @SerializedName("accommodation_data") private List accommodationData; /** * A one-time password value for OTP-based payment flows. * [Optional] */ - @SerializedName("otp_value") private String otpValue; /** @@ -216,49 +191,42 @@ public final class ProcessingSettings { * [Optional] * max 2 characters */ - @SerializedName("purchase_country") private CountryCode purchaseCountry; /** * Custom payment method IDs (Klarna promo codes) defining which payment options to show. * [Optional] */ - @SerializedName("custom_payment_method_ids") private List customPaymentMethodIds; /** * A URL to notify the customer when the order has been created (used by some APMs). * [Optional] */ - @SerializedName("merchant_callback_url") private String merchantCallbackUrl; /** * The line of business that the payment is associated with. * [Optional] */ - @SerializedName("line_of_business") private String lineOfBusiness; /** * The number of days by which the shipping is delayed. * [Optional] */ - @SerializedName("shipping_delay") private Long shippingDelay; /** * Shipping information for the transaction. * [Optional] */ - @SerializedName("shipping_info") private List shippingInfo; /** * Indicates whether to provision a network token for the payment. * [Optional] */ - @SerializedName("provision_network_token") private Boolean provisionNetworkToken; /** @@ -266,7 +234,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "fpan" "dpan" */ - @SerializedName("pan_preference") private PanProcessedType panPreference; /** @@ -274,21 +241,18 @@ public final class ProcessingSettings { * [Optional] * Enum: "same_day" "standard" */ - @SerializedName("service_type") private AchServiceType serviceType; /** * The foreign retailer amount the merchant applied to the transaction, in minor currency units. * [Optional] */ - @SerializedName("foreign_retailer_amount") private Long foreignRetailerAmount; /** * A reconciliation identifier for the payment. * [Optional] */ - @SerializedName("reconciliation_id") private String reconciliationId; /** @@ -301,7 +265,6 @@ public final class ProcessingSettings { * The origination country for hub model payments. * [Optional] */ - @SerializedName("hub_model_origination_country") private CountryCode hubModelOriginationCountry; /** @@ -314,7 +277,6 @@ public final class ProcessingSettings { * Sender information. Used for Previous API only. * [Optional] */ - @SerializedName("senderInformation") private SenderInformation senderInformation; /** @@ -322,7 +284,6 @@ public final class ProcessingSettings { * [Optional] * Enum: "credit" "debit" */ - @SerializedName("card_type") private CardType cardType; /** @@ -331,14 +292,12 @@ public final class ProcessingSettings { * Pattern: ^[a-zA-Z0-9]{1,15}$ * max 15 characters */ - @SerializedName("affiliate_id") private String affiliateId; /** * The affiliate URL. Required if you are a Visa-registered ramp provider operating with affiliates. * [Optional] */ - @SerializedName("affiliate_url") private String affiliateUrl; } diff --git a/src/main/java/com/checkout/payments/ThreeDSData.java b/src/main/java/com/checkout/payments/ThreeDSData.java index c8365b09..2bb85d94 100644 --- a/src/main/java/com/checkout/payments/ThreeDSData.java +++ b/src/main/java/com/checkout/payments/ThreeDSData.java @@ -2,7 +2,6 @@ import com.checkout.common.Exemption; import com.checkout.common.ThreeDSEnrollmentStatus; -import com.google.gson.annotations.SerializedName; import lombok.Data; @Data @@ -24,21 +23,18 @@ public final class ThreeDSData { * The reason for the 3DS upgrade. * [Optional] */ - @SerializedName("upgrade_reason") private String upgradeReason; /** * Whether the 3DS signature is valid. * [Optional] */ - @SerializedName("signature_valid") private String signatureValid; /** * The 3DS authentication response code. * [Optional] */ - @SerializedName("authentication_response") private String authenticationResponse; /** @@ -69,7 +65,6 @@ public final class ThreeDSData { * The 3DS exemption type that was applied by the issuer. * [Optional] */ - @SerializedName("exemption_applied") private String exemptionApplied; /** @@ -88,14 +83,12 @@ public final class ThreeDSData { * The reason for the authentication status result. * [Optional] */ - @SerializedName("authentication_status_reason") private String authenticationStatusReason; /** * The trusted listing status for the cardholder. * [Optional] */ - @SerializedName("trusted_listing") private TrustedListing trustedListing; } diff --git a/src/main/java/com/checkout/payments/TrustedListing.java b/src/main/java/com/checkout/payments/TrustedListing.java index bd13e3db..605d078a 100644 --- a/src/main/java/com/checkout/payments/TrustedListing.java +++ b/src/main/java/com/checkout/payments/TrustedListing.java @@ -9,7 +9,7 @@ public final class TrustedListing { * The trusted listing status for the cardholder. * [Optional] */ - private String status; + private TrustedListingStatus status; /** * The source of the trusted listing entry. diff --git a/src/main/java/com/checkout/payments/TrustedListingStatus.java b/src/main/java/com/checkout/payments/TrustedListingStatus.java new file mode 100644 index 00000000..466691e3 --- /dev/null +++ b/src/main/java/com/checkout/payments/TrustedListingStatus.java @@ -0,0 +1,31 @@ +package com.checkout.payments; + +import com.google.gson.annotations.SerializedName; + +public enum TrustedListingStatus { + + /** 3DS Requestor is allowlisted by cardholder. */ + @SerializedName("Y") + ALLOWLISTED, + + /** 3DS Requestor is not allowlisted by cardholder. */ + @SerializedName("N") + NOT_ALLOWLISTED, + + /** Not eligible as determined by issuer. */ + @SerializedName("E") + NOT_ELIGIBLE, + + /** Pending confirmation by cardholder. */ + @SerializedName("P") + PENDING, + + /** Cardholder rejected. */ + @SerializedName("R") + REJECTED, + + /** Allowlist status unknown, unavailable, or does not apply. */ + @SerializedName("U") + UNKNOWN + +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContexts.java b/src/main/java/com/checkout/payments/contexts/PaymentContexts.java index 0fcfdf32..57cb2234 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContexts.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContexts.java @@ -3,7 +3,6 @@ import com.checkout.common.Currency; import com.checkout.payments.PaymentType; import com.checkout.payments.ShippingDetails; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -35,14 +34,12 @@ public class PaymentContexts { * [Optional] * Enum: "Regular" "Recurring" */ - @SerializedName("payment_type") private PaymentType paymentType; /** * The authorization type for the payment. * [Optional] */ - @SerializedName("authorization_type") private String authorizationType; /** @@ -74,7 +71,6 @@ public class PaymentContexts { * [Optional] * Pattern: ^(pc)_(\w{26})$ */ - @SerializedName("processing_channel_id") private String processingChannelId; /** @@ -97,7 +93,6 @@ public class PaymentContexts { * Format: uri * max 1024 characters */ - @SerializedName("success_url") private String successUrl; /** @@ -106,7 +101,6 @@ public class PaymentContexts { * Format: uri * max 1024 characters */ - @SerializedName("failure_url") private String failureUrl; /** diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java index e2847c17..298249d9 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.CountryCode; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,7 +27,6 @@ public final class PaymentContextsAccommodationData { * The booking reference. * [Optional] */ - @SerializedName("booking_reference") private String bookingReference; /** @@ -36,7 +34,6 @@ public final class PaymentContextsAccommodationData { * [Optional] * Format: yyyy-MM-dd */ - @SerializedName("check_in_date") private LocalDate checkInDate; /** @@ -44,7 +41,6 @@ public final class PaymentContextsAccommodationData { * [Optional] * Format: yyyy-MM-dd */ - @SerializedName("check_out_date") private LocalDate checkOutDate; /** @@ -75,34 +71,29 @@ public final class PaymentContextsAccommodationData { * The number of rooms booked. * [Optional] */ - @SerializedName("number_of_rooms") private Integer numberOfRooms; /** * Information about the guests staying at the accommodation. * [Optional] */ - @SerializedName("guests") private List guests; /** * Information about the rooms booked by the customer. * [Optional] */ - @SerializedName("room") private List room; /** * The property's phone information. * [Optional] */ - @SerializedName("property_phone") private List propertyPhone; /** * The customer service phone information. * [Optional] */ - @SerializedName("customer_service_phone") private List customerServicePhone; } diff --git a/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java b/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java index 5ca103b3..801428ac 100644 --- a/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java +++ b/src/main/java/com/checkout/payments/hosted/HostedPaymentRequest.java @@ -49,7 +49,6 @@ public final class HostedPaymentRequest { * Format: uri * max 255 characters */ - @SerializedName("success_url") private String successUrl; /** @@ -58,7 +57,6 @@ public final class HostedPaymentRequest { * Format: uri * max 255 characters */ - @SerializedName("cancel_url") private String cancelUrl; /** @@ -67,7 +65,6 @@ public final class HostedPaymentRequest { * Format: uri * max 255 characters */ - @SerializedName("failure_url") private String failureUrl; /** @@ -83,21 +80,18 @@ public final class HostedPaymentRequest { * Enum: "Regular" "Recurring" */ @Builder.Default - @SerializedName("payment_type") private PaymentType paymentType = PaymentType.REGULAR; /** * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. */ @Deprecated - @SerializedName("payment_ip") private String paymentIp; /** * An optional description displayed on the customer's statement identifying a purchase. * [Optional] */ - @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; /** @@ -117,7 +111,6 @@ public final class HostedPaymentRequest { * The merchant name to display to customers on the checkout page. * [Optional] */ - @SerializedName("display_name") private String displayName; /** @@ -125,14 +118,12 @@ public final class HostedPaymentRequest { * [Optional] * Pattern: ^(pc)_(\w{26})$ */ - @SerializedName("processing_channel_id") private String processingChannelId; /** * The amount allocations for marketplace or split payments. * [Optional] */ - @SerializedName("amount_allocations") private List amountAllocations; /** @@ -163,14 +154,12 @@ public final class HostedPaymentRequest { * Specifies which payment method options to present to the customer. * [Optional] */ - @SerializedName("allow_payment_methods") private List allowPaymentMethods; /** * Specifies which payment method options to hide from the customer. * [Optional] */ - @SerializedName("disabled_payment_methods") private List disabledPaymentMethods; /** @@ -189,7 +178,6 @@ public final class HostedPaymentRequest { * The customer retry configuration for failed payments. * [Optional] */ - @SerializedName("customer_retry") private PaymentRetryRequest customerRetry; /** @@ -228,7 +216,6 @@ public final class HostedPaymentRequest { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("capture_on") private Instant captureOn; /** @@ -241,6 +228,5 @@ public final class HostedPaymentRequest { * The payment method configuration for stored card and wallet methods. * [Optional] */ - @SerializedName("payment_method_configuration") private PaymentMethodConfiguration paymentMethodConfiguration; } diff --git a/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java b/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java index 8dd8bde5..b612e4e4 100644 --- a/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java +++ b/src/main/java/com/checkout/payments/links/PaymentLinkRequest.java @@ -55,21 +55,18 @@ public final class PaymentLinkRequest { * [Optional] * Enum: "Regular" "Recurring" "MOTO" "Installment" "Unscheduled" */ - @SerializedName("payment_type") private PaymentType paymentType; /** * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. */ @Deprecated - @SerializedName("payment_ip") private String paymentIp; /** * An optional description displayed on the customer's statement identifying a purchase. * [Optional] */ - @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; /** @@ -89,7 +86,6 @@ public final class PaymentLinkRequest { * The merchant name to display to customers on the checkout page. * [Optional] */ - @SerializedName("display_name") private String displayName; /** @@ -97,21 +93,18 @@ public final class PaymentLinkRequest { * [Optional] * Pattern: ^(pc)_(\w{26})$ */ - @SerializedName("processing_channel_id") private String processingChannelId; /** * The amount allocations for marketplace or split payments. * [Optional] */ - @SerializedName("amount_allocations") private List amountAllocations; /** * The time for which the Payment Link remains valid, in seconds. * [Optional] */ - @SerializedName("expires_in") private Integer expiresIn; /** @@ -142,14 +135,12 @@ public final class PaymentLinkRequest { * Specifies which payment method options to present to the customer. * [Optional] */ - @SerializedName("allow_payment_methods") private List allowPaymentMethods; /** * Specifies which payment method options to hide from the customer. * [Optional] */ - @SerializedName("disabled_payment_methods") private List disabledPaymentMethods; /** @@ -181,7 +172,6 @@ public final class PaymentLinkRequest { * The customer retry configuration for failed payments. * [Optional] */ - @SerializedName("customer_retry") private PaymentRetryRequest customerRetry; /** @@ -194,7 +184,6 @@ public final class PaymentLinkRequest { * If provided, the success page will include a button that redirects the customer to this URL. * [Optional] */ - @SerializedName("return_url") private String returnUrl; /** @@ -214,7 +203,6 @@ public final class PaymentLinkRequest { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("capture_on") private Instant captureOn; /** @@ -227,6 +215,5 @@ public final class PaymentLinkRequest { * The payment method configuration for stored card and wallet methods. * [Optional] */ - @SerializedName("payment_method_configuration") private PaymentMethodConfiguration paymentMethodConfiguration; } diff --git a/src/main/java/com/checkout/payments/request/DunningRetryRequest.java b/src/main/java/com/checkout/payments/request/DunningRetryRequest.java index d11fea1a..ee2d2226 100644 --- a/src/main/java/com/checkout/payments/request/DunningRetryRequest.java +++ b/src/main/java/com/checkout/payments/request/DunningRetryRequest.java @@ -1,6 +1,5 @@ package com.checkout.payments.request; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -22,14 +21,12 @@ public final class DunningRetryRequest { * The maximum number of retry attempts. * [Optional] */ - @SerializedName("max_attempts") private Integer maxAttempts; /** * The number of days after which retries stop. * [Optional] */ - @SerializedName("end_after_days") private Integer endAfterDays; } diff --git a/src/main/java/com/checkout/payments/request/PaymentRequest.java b/src/main/java/com/checkout/payments/request/PaymentRequest.java index f48171e7..7bd5158f 100644 --- a/src/main/java/com/checkout/payments/request/PaymentRequest.java +++ b/src/main/java/com/checkout/payments/request/PaymentRequest.java @@ -35,7 +35,6 @@ public final class PaymentRequest { * The unique identifier of a Payment Context. Used to initiate a payment from a context. * [Optional] */ - @SerializedName("payment_context_id") private String paymentContextId; /** @@ -66,14 +65,12 @@ public final class PaymentRequest { * Enum: "Regular" "Recurring" "MOTO" "Installment" "PayLater" "Unscheduled" */ @Builder.Default - @SerializedName("payment_type") private PaymentType paymentType = PaymentType.REGULAR; /** * The details of a recurring subscription or installment. * [Optional] */ - @SerializedName("payment_plan") private PaymentPlan paymentPlan; /** @@ -81,7 +78,6 @@ public final class PaymentRequest { * Must be set to true for all MITs. If true, payment_type must not be Regular. * [Optional] */ - @SerializedName("merchant_initiated") private Boolean merchantInitiated; /** @@ -109,14 +105,12 @@ public final class PaymentRequest { * [Optional] * Enum: "Final" "Estimated" */ - @SerializedName("authorization_type") private AuthorizationType authorizationType; /** * The partial authorization configuration for the payment. * [Optional] */ - @SerializedName("partial_authorization") private PartialAuthorization partialAuthorization; /** @@ -131,7 +125,6 @@ public final class PaymentRequest { * [Optional] * Format: date-time (RFC 3339) */ - @SerializedName("capture_on") private Instant captureOn; /** @@ -139,7 +132,6 @@ public final class PaymentRequest { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expire_on") private Instant expireOn; /** @@ -152,7 +144,6 @@ public final class PaymentRequest { * An optional description displayed on the customer's statement identifying a purchase. * [Optional] */ - @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; /** @@ -173,7 +164,6 @@ public final class PaymentRequest { * [Optional] * Pattern: ^(pc)_(\w{26})$ */ - @SerializedName("processing_channel_id") private String processingChannelId; /** @@ -182,7 +172,6 @@ public final class PaymentRequest { * [Optional] * max 100 characters */ - @SerializedName("previous_payment_id") private String previousPaymentId; /** @@ -197,7 +186,6 @@ public final class PaymentRequest { * Format: uri * max 1024 characters */ - @SerializedName("success_url") private String successUrl; /** @@ -206,14 +194,12 @@ public final class PaymentRequest { * Format: uri * max 1024 characters */ - @SerializedName("failure_url") private String failureUrl; /** * @deprecated Deprecated in the API on 2025-03-11. Use {@code risk.device.network.ipv4} or {@code risk.device.network.ipv6} instead. */ @Deprecated - @SerializedName("payment_ip") private String paymentIp; /** @@ -238,7 +224,6 @@ public final class PaymentRequest { * The amount allocations for marketplace or split payments. * [Optional] */ - @SerializedName("amount_allocations") private List amountAllocations; /** diff --git a/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java b/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java index d3e40ac1..0603d866 100644 --- a/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java +++ b/src/main/java/com/checkout/payments/request/PaymentRetryRequest.java @@ -1,6 +1,5 @@ package com.checkout.payments.request; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -38,14 +37,12 @@ public final class PaymentRetryRequest { * @deprecated Use {@link DunningRetryRequest#maxAttempts} via {@link #dunning} instead. */ @Deprecated - @SerializedName("max_attempts") private Integer maxAttempts; /** * @deprecated Use {@link DunningRetryRequest#endAfterDays} via {@link #dunning} instead. */ @Deprecated - @SerializedName("end_after_days") private Integer endAfterDays; } diff --git a/src/main/java/com/checkout/payments/request/PayoutRequest.java b/src/main/java/com/checkout/payments/request/PayoutRequest.java index 6296add2..4ebfc314 100644 --- a/src/main/java/com/checkout/payments/request/PayoutRequest.java +++ b/src/main/java/com/checkout/payments/request/PayoutRequest.java @@ -5,7 +5,6 @@ import com.checkout.payments.request.destination.PaymentRequestDestination; import com.checkout.payments.request.source.PayoutRequestSource; import com.checkout.payments.sender.PaymentSender; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.Data; @@ -51,7 +50,6 @@ public final class PayoutRequest { * An optional description displayed on the recipient's statement identifying the payout. * [Optional] */ - @SerializedName("billing_descriptor") private PayoutBillingDescriptor billingDescriptor; /** @@ -72,7 +70,6 @@ public final class PayoutRequest { * Pattern: ^(pc)_(\w{26})$ * max 29 characters */ - @SerializedName("processing_channel_id") private String processingChannelId; /** diff --git a/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java b/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java index 2a704345..d0f6ffa7 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestBankAccountSource.java @@ -4,7 +4,6 @@ import com.checkout.common.AccountType; import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -21,14 +20,12 @@ public final class RequestBankAccountSource extends AbstractRequestSource { * The payment method to use. For example, "ach". * [Optional] */ - @SerializedName("payment_method") private String paymentMethod; /** * The type of account. * [Optional] */ - @SerializedName("account_type") private AccountType accountType; /** @@ -41,21 +38,18 @@ public final class RequestBankAccountSource extends AbstractRequestSource { * The account number. * [Optional] */ - @SerializedName("account_number") private String accountNumber; /** * The bank routing code. * [Optional] */ - @SerializedName("bank_code") private String bankCode; /** * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; public RequestBankAccountSource() { diff --git a/src/main/java/com/checkout/payments/request/source/RequestCardSource.java b/src/main/java/com/checkout/payments/request/source/RequestCardSource.java index 9e2565d5..d3ab9930 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestCardSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestCardSource.java @@ -4,7 +4,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,14 +26,12 @@ public final class RequestCardSource extends AbstractRequestSource { * The expiry month of the card. * [Optional] */ - @SerializedName("expiry_month") private Integer expiryMonth; /** * The expiry year of the card. * [Optional] */ - @SerializedName("expiry_year") private Integer expiryYear; /** @@ -59,14 +56,12 @@ public final class RequestCardSource extends AbstractRequestSource { * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** * The payment source owner's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -79,7 +74,6 @@ public final class RequestCardSource extends AbstractRequestSource { * The card account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java b/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java index b11a2bad..024ad23d 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestCustomerSource.java @@ -4,7 +4,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ public final class RequestCustomerSource extends AbstractRequestSource { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -41,14 +39,12 @@ public final class RequestCustomerSource extends AbstractRequestSource { * The account holder information for the customer. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; /** * Whether to update the stored customer information with the data provided. * [Optional] */ - @SerializedName("allow_update") private Boolean allowUpdate; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/RequestIdSource.java b/src/main/java/com/checkout/payments/request/source/RequestIdSource.java index f0b5e557..aeebbd4b 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestIdSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestIdSource.java @@ -4,7 +4,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -35,7 +34,6 @@ public final class RequestIdSource extends AbstractRequestSource { * The payment method to be used. * [Optional] */ - @SerializedName("payment_method") private String paymentMethod; /** @@ -48,14 +46,12 @@ public final class RequestIdSource extends AbstractRequestSource { * Whether to store the payment instrument for future use. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** * The billing address associated with the payment instrument. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -68,14 +64,12 @@ public final class RequestIdSource extends AbstractRequestSource { * The account holder information for the payment instrument. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; /** * Whether to update the stored instrument information with the data provided. * [Optional] */ - @SerializedName("allow_update") private Boolean allowUpdate; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java index 15901034..e23ff339 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestNetworkTokenSource.java @@ -4,7 +4,6 @@ import com.checkout.common.Address; import com.checkout.common.Phone; import com.checkout.payments.NetworkTokenType; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,21 +28,18 @@ public final class RequestNetworkTokenSource extends AbstractRequestSource { * The expiry month of the token. * [Optional] */ - @SerializedName("expiry_month") private Integer expiryMonth; /** * The expiry year of the token. * [Optional] */ - @SerializedName("expiry_year") private Integer expiryYear; /** * The network token type. * [Optional] */ - @SerializedName("token_type") private NetworkTokenType tokenType; /** @@ -68,7 +64,6 @@ public final class RequestNetworkTokenSource extends AbstractRequestSource { * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** @@ -87,7 +82,6 @@ public final class RequestNetworkTokenSource extends AbstractRequestSource { * The payment source owner's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -100,7 +94,6 @@ public final class RequestNetworkTokenSource extends AbstractRequestSource { * The card account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java index d9a98008..25d8bc73 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestProviderTokenSource.java @@ -2,7 +2,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -19,7 +18,6 @@ public final class RequestProviderTokenSource extends AbstractRequestSource { * The payment method to use. * [Optional] */ - @SerializedName("payment_method") private String paymentMethod; /** @@ -32,7 +30,6 @@ public final class RequestProviderTokenSource extends AbstractRequestSource { * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java b/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java index ea01fe0e..45a2f698 100644 --- a/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java +++ b/src/main/java/com/checkout/payments/request/source/RequestTokenSource.java @@ -4,7 +4,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.common.Phone; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,7 +26,6 @@ public final class RequestTokenSource extends AbstractRequestSource { * The payment source owner's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; /** @@ -46,14 +44,12 @@ public final class RequestTokenSource extends AbstractRequestSource { * Set to true if you intend to reuse the payment credentials in subsequent payments. Write-only. * [Optional] */ - @SerializedName("store_for_future_use") private Boolean storeForFutureUse; /** * The card account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java index 39ec3dde..10a68a15 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAchSource.java @@ -5,7 +5,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -23,7 +22,6 @@ public final class RequestAchSource extends AbstractRequestSource { * [Required] * Enum: "savings" "checking" "cash" */ - @SerializedName("account_type") private AccountType accountType; /** @@ -31,7 +29,6 @@ public final class RequestAchSource extends AbstractRequestSource { * [Required] * min 2 characters, max 2 characters */ - @SerializedName("country") private CountryCode country; /** @@ -39,7 +36,6 @@ public final class RequestAchSource extends AbstractRequestSource { * [Required] * min 4 characters, max 17 characters */ - @SerializedName("account_number") private String accountNumber; /** @@ -47,7 +43,6 @@ public final class RequestAchSource extends AbstractRequestSource { * [Required] * min 8 characters, max 9 characters */ - @SerializedName("bank_code") private String bankCode; /** @@ -55,7 +50,6 @@ public final class RequestAchSource extends AbstractRequestSource { * Supports date_of_birth and identification (SSN) fields. * [Required] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java index b4ae4b68..9edea45c 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAfterPaySource.java @@ -3,7 +3,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestAfterPaySource extends AbstractRequestSource { * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java index 812f62ae..06b6b728 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestAlmaSource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestAlmaSource extends AbstractRequestSource { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java index fd09301e..4e09d30c 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestBancontactSource.java @@ -3,7 +3,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestBancontactSource extends AbstractRequestSource { * The two-letter ISO country code of the payment. * [Optional] */ - @SerializedName("payment_country") private CountryCode paymentCountry; /** @@ -28,14 +26,12 @@ public final class RequestBancontactSource extends AbstractRequestSource { * [Optional] * min 3 max 100 */ - @SerializedName("account_holder_name") private String accountHolderName; /** * A description of the purchase shown on the customer's statement. * [Optional] */ - @SerializedName("billing_descriptor") private String billingDescriptor; /** diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java index dd8b833b..180f0052 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestBizumSource.java @@ -2,7 +2,6 @@ import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -21,7 +20,6 @@ public final class RequestBizumSource extends AbstractRequestSource { * @deprecated Removed from the API on 2025/02/10. Use the customer object instead. */ @Deprecated - @SerializedName("mobile_number") private String mobileNumber; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java index c8b07234..c2481d80 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestCvConnectSource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestCvConnectSource extends AbstractRequestSource { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java index 300f56d6..69fb81c6 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestEpsSource.java @@ -3,7 +3,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ public final class RequestEpsSource extends AbstractRequestSource { * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java index 5d53a09b..5a9e44c1 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestFawrySource.java @@ -31,21 +31,18 @@ public final class RequestFawrySource extends AbstractRequestSource { * The customer's profile ID. * [Optional] */ - @SerializedName("customer_profile_id") private String customerProfileId; /** * The customer's email address. * [Optional] */ - @SerializedName("customer_email") private String customerEmail; /** * The customer's mobile number. * [Optional] */ - @SerializedName("customer_mobile") private String customerMobile; /** @@ -53,7 +50,6 @@ public final class RequestFawrySource extends AbstractRequestSource { * [Optional] * Format: date-time (ISO 8601) */ - @SerializedName("expires_on") private Instant expiresOn; /** diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java index 3829fbb1..aabaeaec 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestGiropaySource.java @@ -3,7 +3,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -35,14 +34,12 @@ public final class RequestGiropaySource extends AbstractRequestSource { * @deprecated GiroPay doesn't support this field anymore, will be removed in the future */ @Deprecated - @SerializedName("info_fields") private List infoFields; /** * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java index ee4d888d..2ffd7f97 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestKlarnaSource.java @@ -3,7 +3,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestKlarnaSource extends AbstractRequestSource { * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java index eeafcc7f..b0e06813 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestKnetSource.java @@ -4,7 +4,6 @@ import com.checkout.payments.PaymentMethodDetails; import com.checkout.payments.request.source.AbstractRequestSource; import com.checkout.tokens.ApplePayTokenData; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,42 +26,36 @@ public final class RequestKnetSource extends AbstractRequestSource { * User-defined field 1. * [Optional] */ - @SerializedName("user_defined_field1") private String userDefinedField1; /** * User-defined field 2. * [Optional] */ - @SerializedName("user_defined_field2") private String userDefinedField2; /** * User-defined field 3. * [Optional] */ - @SerializedName("user_defined_field3") private String userDefinedField3; /** * User-defined field 4. * [Optional] */ - @SerializedName("user_defined_field4") private String userDefinedField4; /** * User-defined field 5. * [Optional] */ - @SerializedName("user_defined_field5") private String userDefinedField5; /** * The card token for the payment. * [Optional] */ - @SerializedName("card_token") private String cardToken; /** @@ -75,21 +68,18 @@ public final class RequestKnetSource extends AbstractRequestSource { * The type of token. * [Optional] */ - @SerializedName("token_type") private String tokenType; /** * The token data for Apple Pay payments. * [Optional] */ - @SerializedName("token_data") private ApplePayTokenData tokenData; /** * Additional payment method details. * [Optional] */ - @SerializedName("payment_method_details") private PaymentMethodDetails paymentMethodDetails; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java index af8ab9aa..498ac7ab 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestMultiBancoSource.java @@ -3,7 +3,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestMultiBancoSource extends AbstractRequestSource { * The two-letter ISO country code of the payment. * [Optional] */ - @SerializedName("payment_country") private CountryCode paymentCountry; /** @@ -28,14 +26,12 @@ public final class RequestMultiBancoSource extends AbstractRequestSource { * [Optional] * min 3 max 100 */ - @SerializedName("account_holder_name") private String accountHolderName; /** * A description of the purchase shown on the customer's statement. * [Optional] */ - @SerializedName("billing_descriptor") private String billingDescriptor; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java b/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java index e6e780b2..1feadf0b 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestP24Source.java @@ -3,7 +3,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestP24Source extends AbstractRequestSource { * The two-letter ISO country code of the payment. * [Optional] */ - @SerializedName("payment_country") private CountryCode paymentCountry; /** @@ -28,21 +26,18 @@ public final class RequestP24Source extends AbstractRequestSource { * [Optional] * min 3 max 100 */ - @SerializedName("account_holder_name") private String accountHolderName; /** * The account holder's email address. * [Optional] */ - @SerializedName("account_holder_email") private String accountHolderEmail; /** * A description of the purchase shown on the customer's statement. * [Optional] */ - @SerializedName("billing_descriptor") private String billingDescriptor; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java index 27a64fa6..4c03c49c 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestPlaidSource.java @@ -3,7 +3,6 @@ import com.checkout.common.AccountHolder; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,14 +19,12 @@ public final class RequestPlaidSource extends AbstractRequestSource { * The Plaid processor token. * [Optional] */ - @SerializedName("token") private String token; /** * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java index 171ed2f8..eb4be737 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestPostFinanceSource.java @@ -3,7 +3,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,21 +19,18 @@ public final class RequestPostFinanceSource extends AbstractRequestSource { * The two-letter ISO country code of the payment. * [Optional] */ - @SerializedName("payment_country") private CountryCode paymentCountry; /** * The account holder's name. * [Optional] */ - @SerializedName("account_holder_name") private String accountHolderName; /** * A description of the purchase shown on the customer's statement. * [Optional] */ - @SerializedName("billing_descriptor") private String billingDescriptor; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java index ef28b1da..78ecf1d0 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestQPaySource.java @@ -2,7 +2,6 @@ import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -38,7 +37,6 @@ public final class RequestQPaySource extends AbstractRequestSource { * The customer's national ID. * [Optional] */ - @SerializedName("national_id") private String nationalId; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java index 6e6bbebe..ec86cf4f 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSepaSource.java @@ -5,7 +5,6 @@ import com.checkout.common.Currency; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,14 +27,12 @@ public final class RequestSepaSource extends AbstractRequestSource { * The account holder's IBAN. * [Required] */ - @SerializedName("account_number") private String accountNumber; /** * The BIC/SWIFT code of the bank. * [Optional] */ - @SerializedName("bank_code") private String bankCode; /** @@ -48,7 +45,6 @@ public final class RequestSepaSource extends AbstractRequestSource { * The ID of the mandate. * [Optional] */ - @SerializedName("mandate_id") private String mandateId; /** @@ -56,21 +52,18 @@ public final class RequestSepaSource extends AbstractRequestSource { * [Optional] * Enum: "Core" "B2B" */ - @SerializedName("mandate_type") private MandateType mandateType; /** * The date the mandate was signed, in the format yyyy-MM-dd. * [Optional] */ - @SerializedName("date_of_signature") private String dateOfSignature; /** * The account holder's personal information. * [Required] */ - @SerializedName("account_holder") private AccountHolder accountHolder; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java index 138c6387..295d0e27 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSequraSource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestSequraSource extends AbstractRequestSource { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java index 3887e172..028b5aa7 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSofortSource.java @@ -3,7 +3,6 @@ import com.checkout.common.CountryCode; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -24,14 +23,12 @@ public final class RequestSofortSource extends AbstractRequestSource { * The ISO 3166-1 alpha-2 country code for the Sofort payment. * [Optional] */ - @SerializedName("countryCode") private CountryCode countryCode; /** * The language code for the Sofort payment. * [Optional] */ - @SerializedName("languageCode") private String languageCode; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java index d2d9b350..46813b62 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestSwishSource.java @@ -4,7 +4,6 @@ import com.checkout.common.PaymentSourceType; import com.checkout.payments.BillingDescriptor; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -21,21 +20,18 @@ public final class RequestSwishSource extends AbstractRequestSource { * The two-letter ISO country code of the payment. * [Optional] */ - @SerializedName("payment_country") private String paymentCountry; /** * The account holder's details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; /** * A description of the purchase shown on the customer's statement. * [Optional] */ - @SerializedName("billing_descriptor") private BillingDescriptor billingDescriptor; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java index 24c493f2..a73029ab 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestTamaraSource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -23,7 +22,6 @@ public RequestTamaraSource() { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; } diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java index fdcde8a0..9cd9350d 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestTrustlySource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -24,7 +23,6 @@ public final class RequestTrustlySource extends AbstractRequestSource { * The billing address for the Trustly payment. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; @Builder diff --git a/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java b/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java index 65a1ccfd..245496be 100644 --- a/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java +++ b/src/main/java/com/checkout/payments/request/source/apm/RequestWeChatPaySource.java @@ -3,7 +3,6 @@ import com.checkout.common.Address; import com.checkout.common.PaymentSourceType; import com.checkout.payments.request.source.AbstractRequestSource; -import com.google.gson.annotations.SerializedName; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,7 +19,6 @@ public final class RequestWeChatPaySource extends AbstractRequestSource { * The customer's billing address. * [Optional] */ - @SerializedName("billing_address") private Address billingAddress; public RequestWeChatPaySource() { diff --git a/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java b/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java index fade970c..cc6a4e13 100644 --- a/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java +++ b/src/main/java/com/checkout/payments/response/source/PayPalResponseSource.java @@ -1,6 +1,5 @@ package com.checkout.payments.response.source; -import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -16,7 +15,6 @@ public final class PayPalResponseSource extends AbstractResponseSource implement * The PayPal account holder details. * [Optional] */ - @SerializedName("account_holder") private AccountHolder accountHolder; public PayPalResponseSource() { @@ -36,7 +34,6 @@ public static final class AccountHolder { * The PayPal account holder's full name. * [Optional] */ - @SerializedName("full_name") private String fullName; } diff --git a/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java b/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java index c380cc1b..37fcc9ca 100644 --- a/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java +++ b/src/main/java/com/checkout/payments/sender/PaymentIndividualSender.java @@ -22,21 +22,18 @@ public final class PaymentIndividualSender extends PaymentSender { * The sender's first name. * [Required] */ - @SerializedName("first_name") private String firstName; /** * The sender's middle name. * [Optional] */ - @SerializedName("middle_name") private String middleName; /** * The sender's last name. * [Required] */ - @SerializedName("last_name") private String lastName; /** @@ -62,14 +59,12 @@ public final class PaymentIndividualSender extends PaymentSender { * The reference type for the sender. * [Optional] */ - @SerializedName("reference_type") private String referenceType; /** * The source of funds for the sender. * [Optional] */ - @SerializedName("source_of_funds") private SourceOfFunds sourceOfFunds; /** @@ -78,14 +73,12 @@ public final class PaymentIndividualSender extends PaymentSender { * Format: yyyy-MM-dd * max 10 characters */ - @SerializedName("date_of_birth") private LocalDate dateOfBirth; /** * The sender's country of birth. * [Optional] */ - @SerializedName("country_of_birth") private CountryCode countryOfBirth; /** From 155a8838c6f4426d52e1597bc5eda6d811e51018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:35:03 +0200 Subject: [PATCH 10/10] fix(tests): replace hardcoded trusted listing status with constant --- .../com/checkout/payments/ThreeDSDataSerializationTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java b/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java index 15c67afc..bff0f7d3 100644 --- a/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java +++ b/src/test/java/com/checkout/payments/ThreeDSDataSerializationTest.java @@ -3,6 +3,7 @@ import com.checkout.GsonSerializer; import com.checkout.common.ThreeDSEnrollmentStatus; import org.junit.jupiter.api.Test; +import static com.checkout.payments.TrustedListingStatus.ALLOWLISTED; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -67,7 +68,7 @@ void shouldDeserializeTrustedListing() { assertNotNull(data); assertNotNull(data.getTrustedListing()); - assertEquals("Y", data.getTrustedListing().getStatus()); + assertEquals(ALLOWLISTED, data.getTrustedListing().getStatus()); assertEquals("01", data.getTrustedListing().getSource()); } @@ -108,7 +109,7 @@ void shouldDeserializeFullResponse() { assertEquals("05", data.getEci()); assertEquals("01", data.getAuthenticationStatusReason()); assertNotNull(data.getTrustedListing()); - assertEquals("Y", data.getTrustedListing().getStatus()); + assertEquals(ALLOWLISTED, data.getTrustedListing().getStatus()); } @Test