From e111be32544d62ffae73b73a56849f3b7c2169ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:27:39 +0100 Subject: [PATCH] Payment contexts and accounts updates (#449) * Update payment contexts * Update endpoint accounts --- .../com/checkout/accounts/AccountPhone.java | 5 ++ .../checkout/accounts/AdditionalDocument.java | 16 +++++++ .../com/checkout/accounts/AdditionalInfo.java | 20 ++++++++ .../accounts/ArticlesOfAssociationType.java | 13 +++++ .../checkout/accounts/BankVerification.java | 18 +++++++ .../accounts/BankVerificationType.java | 10 ++++ .../com/checkout/accounts/Capabilities.java | 19 ++++++-- .../java/com/checkout/accounts/Company.java | 26 ++++++---- .../accounts/DateOfIncorporation.java | 18 +++++++ .../accounts/FinancialVerification.java | 18 +++++++ .../accounts/FinancialVerificationType.java | 10 ++++ .../accounts/OnboardEntityRequest.java | 13 ++++- .../accounts/OnboardSubEntityDocuments.java | 34 +++++++++++++- .../checkout/accounts/ProcessingDetails.java | 35 ++++++++++++++ .../checkout/accounts/ProofOfLegality.java | 18 +++++++ .../accounts/ProofOfLegalityType.java | 10 ++++ .../accounts/ProofOfPrincipalAddress.java | 18 +++++++ .../accounts/ProofOfPrincipalAddressType.java | 10 ++++ .../accounts/ShareholderStructure.java | 18 +++++++ .../accounts/ShareholderStructureType.java | 10 ++++ .../PaymentContextsAccommodationData.java | 47 +++++++++++++++++++ .../PaymentContextsAccommodationRoom.java | 19 ++++++++ .../contexts/PaymentContextsGuests.java | 25 ++++++++++ .../contexts/PaymentContextsItems.java | 2 +- .../contexts/PaymentContextsItemsType.java | 12 +++++ .../contexts/PaymentContextsProcessing.java | 9 ++++ .../payments/RequestApmPaymentsIT.java | 18 ------- .../payments/RequestPaymentsTestIT.java | 2 - .../contexts/PaymentContextsTestIT.java | 7 ++- .../previous/RequestApmPaymentsIT.java | 1 - 30 files changed, 443 insertions(+), 38 deletions(-) create mode 100644 src/main/java/com/checkout/accounts/AdditionalDocument.java create mode 100644 src/main/java/com/checkout/accounts/AdditionalInfo.java create mode 100644 src/main/java/com/checkout/accounts/ArticlesOfAssociationType.java create mode 100644 src/main/java/com/checkout/accounts/BankVerification.java create mode 100644 src/main/java/com/checkout/accounts/BankVerificationType.java create mode 100644 src/main/java/com/checkout/accounts/DateOfIncorporation.java create mode 100644 src/main/java/com/checkout/accounts/FinancialVerification.java create mode 100644 src/main/java/com/checkout/accounts/FinancialVerificationType.java create mode 100644 src/main/java/com/checkout/accounts/ProcessingDetails.java create mode 100644 src/main/java/com/checkout/accounts/ProofOfLegality.java create mode 100644 src/main/java/com/checkout/accounts/ProofOfLegalityType.java create mode 100644 src/main/java/com/checkout/accounts/ProofOfPrincipalAddress.java create mode 100644 src/main/java/com/checkout/accounts/ProofOfPrincipalAddressType.java create mode 100644 src/main/java/com/checkout/accounts/ShareholderStructure.java create mode 100644 src/main/java/com/checkout/accounts/ShareholderStructureType.java create mode 100644 src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java create mode 100644 src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationRoom.java create mode 100644 src/main/java/com/checkout/payments/contexts/PaymentContextsGuests.java create mode 100644 src/main/java/com/checkout/payments/contexts/PaymentContextsItemsType.java diff --git a/src/main/java/com/checkout/accounts/AccountPhone.java b/src/main/java/com/checkout/accounts/AccountPhone.java index f2aa6f2d..2c47ff3a 100644 --- a/src/main/java/com/checkout/accounts/AccountPhone.java +++ b/src/main/java/com/checkout/accounts/AccountPhone.java @@ -1,5 +1,7 @@ package com.checkout.accounts; +import com.checkout.common.CountryCode; +import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -11,6 +13,9 @@ @AllArgsConstructor public final class AccountPhone { + @SerializedName("country_code") + private CountryCode countryCode; + private String number; } diff --git a/src/main/java/com/checkout/accounts/AdditionalDocument.java b/src/main/java/com/checkout/accounts/AdditionalDocument.java new file mode 100644 index 00000000..ead77536 --- /dev/null +++ b/src/main/java/com/checkout/accounts/AdditionalDocument.java @@ -0,0 +1,16 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AdditionalDocument { + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/AdditionalInfo.java b/src/main/java/com/checkout/accounts/AdditionalInfo.java new file mode 100644 index 00000000..5414b772 --- /dev/null +++ b/src/main/java/com/checkout/accounts/AdditionalInfo.java @@ -0,0 +1,20 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class AdditionalInfo { + + private String field1; + + private String field2; + + private String field3; + +} diff --git a/src/main/java/com/checkout/accounts/ArticlesOfAssociationType.java b/src/main/java/com/checkout/accounts/ArticlesOfAssociationType.java new file mode 100644 index 00000000..4ed853fa --- /dev/null +++ b/src/main/java/com/checkout/accounts/ArticlesOfAssociationType.java @@ -0,0 +1,13 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum ArticlesOfAssociationType { + + @SerializedName("memorandum_of_association") + MEMORANDUM_OF_ASSOCIATION, + + @SerializedName("articles_of_association") + ARTICLES_OF_ASSOCIATION + +} diff --git a/src/main/java/com/checkout/accounts/BankVerification.java b/src/main/java/com/checkout/accounts/BankVerification.java new file mode 100644 index 00000000..0e01c9f7 --- /dev/null +++ b/src/main/java/com/checkout/accounts/BankVerification.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class BankVerification { + + private BankVerificationType type; + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/BankVerificationType.java b/src/main/java/com/checkout/accounts/BankVerificationType.java new file mode 100644 index 00000000..2ab7293b --- /dev/null +++ b/src/main/java/com/checkout/accounts/BankVerificationType.java @@ -0,0 +1,10 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum BankVerificationType { + + @SerializedName("bank_statement") + BANK_STATEMENT + +} diff --git a/src/main/java/com/checkout/accounts/Capabilities.java b/src/main/java/com/checkout/accounts/Capabilities.java index 6acf8e43..6cd1038d 100644 --- a/src/main/java/com/checkout/accounts/Capabilities.java +++ b/src/main/java/com/checkout/accounts/Capabilities.java @@ -11,21 +11,32 @@ public final class Capabilities { private Payouts payouts; + private IssuingCapabilities issuing; + @Data public static class Payments { - private boolean available; + private Boolean available; - private boolean enabled; + private Boolean enabled; } @Data public static class Payouts { - private boolean available; + private Boolean available; + + private Boolean enabled; + + } + + @Data + public static class IssuingCapabilities { + + private Boolean available; - private boolean enabled; + private Boolean enabled; } diff --git a/src/main/java/com/checkout/accounts/Company.java b/src/main/java/com/checkout/accounts/Company.java index 974aab54..60148d86 100644 --- a/src/main/java/com/checkout/accounts/Company.java +++ b/src/main/java/com/checkout/accounts/Company.java @@ -2,38 +2,48 @@ import com.checkout.common.Address; import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import java.util.List; @Data @Builder +@NoArgsConstructor +@AllArgsConstructor public final class Company { - @SerializedName("business_registration_number") - private String businessRegistrationNumber; - - @SerializedName("business_type") - private BusinessType businessType; - @SerializedName("legal_name") private String legalName; @SerializedName("trading_name") private String tradingName; + @SerializedName("business_registration_number") + private String businessRegistrationNumber; + + @SerializedName("date_of_incorporation") + private DateOfIncorporation dateOfIncorporation; + + @SerializedName("regulatory_licence_number") + private String regulatoryLicenceNumber; + @SerializedName("principal_address") private Address principalAddress; @SerializedName("registered_address") private Address registeredAddress; - private EntityDocument document; - private List representatives; + private EntityDocument document; + @SerializedName("financial_details") private EntityFinancialDetails financialDetails; + @SerializedName("business_type") + private BusinessType businessType; + } diff --git a/src/main/java/com/checkout/accounts/DateOfIncorporation.java b/src/main/java/com/checkout/accounts/DateOfIncorporation.java new file mode 100644 index 00000000..10b31253 --- /dev/null +++ b/src/main/java/com/checkout/accounts/DateOfIncorporation.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class DateOfIncorporation { + + private Integer month; + + private Integer year; + +} diff --git a/src/main/java/com/checkout/accounts/FinancialVerification.java b/src/main/java/com/checkout/accounts/FinancialVerification.java new file mode 100644 index 00000000..f7abbf14 --- /dev/null +++ b/src/main/java/com/checkout/accounts/FinancialVerification.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class FinancialVerification { + + private FinancialVerificationType type; + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/FinancialVerificationType.java b/src/main/java/com/checkout/accounts/FinancialVerificationType.java new file mode 100644 index 00000000..d1b14f21 --- /dev/null +++ b/src/main/java/com/checkout/accounts/FinancialVerificationType.java @@ -0,0 +1,10 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum FinancialVerificationType { + + @SerializedName("financial_statement") + FINANCIAL_STATEMENT + +} diff --git a/src/main/java/com/checkout/accounts/OnboardEntityRequest.java b/src/main/java/com/checkout/accounts/OnboardEntityRequest.java index f2cfbfab..458d0b57 100644 --- a/src/main/java/com/checkout/accounts/OnboardEntityRequest.java +++ b/src/main/java/com/checkout/accounts/OnboardEntityRequest.java @@ -1,11 +1,15 @@ package com.checkout.accounts; 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 OnboardEntityRequest { private String reference; @@ -13,15 +17,20 @@ public final class OnboardEntityRequest { @SerializedName("is_draft") private boolean isDraft; + private Profile profile; + @SerializedName("contact_details") private ContactDetails contactDetails; - private Profile profile; - private Company company; + private ProcessingDetails processingDetails; + private Individual individual; private OnboardSubEntityDocuments documents; + @SerializedName("additional_info") + private AdditionalInfo additionalInfo; + } diff --git a/src/main/java/com/checkout/accounts/OnboardSubEntityDocuments.java b/src/main/java/com/checkout/accounts/OnboardSubEntityDocuments.java index 58a90fba..53d3e04a 100644 --- a/src/main/java/com/checkout/accounts/OnboardSubEntityDocuments.java +++ b/src/main/java/com/checkout/accounts/OnboardSubEntityDocuments.java @@ -1,5 +1,6 @@ package com.checkout.accounts; +import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,11 +10,42 @@ @Builder @NoArgsConstructor @AllArgsConstructor -public class OnboardSubEntityDocuments { +public final class OnboardSubEntityDocuments { + @SerializedName("identity_verification") private Document identityVerification; + @SerializedName("company_verification") private CompanyVerification companyVerification; + @SerializedName("articles_of_association") + private ArticlesOfAssociationType articlesOfAssociation; + + @SerializedName("bank_verification") + private BankVerification bankVerification; + + @SerializedName("shareholder_structure") + private ShareholderStructure shareholderStructure; + + @SerializedName("proof_of_legality") + private ProofOfLegality proofOfLegality; + + @SerializedName("proof_of_principal_address") + private ProofOfPrincipalAddress proofOfPrincipalAddress; + + @SerializedName("additional_document_1") + private AdditionalDocument additionalDocument1; + + @SerializedName("additional_document_2") + private AdditionalDocument additionalDocument2; + + @SerializedName("additional_document_3") + private AdditionalDocument additionalDocument3; + + @SerializedName("tax_verification") private TaxVerification taxVerification; + + @SerializedName("financial_verification") + private FinancialVerification financialVerification; + } diff --git a/src/main/java/com/checkout/accounts/ProcessingDetails.java b/src/main/java/com/checkout/accounts/ProcessingDetails.java new file mode 100644 index 00000000..61529c97 --- /dev/null +++ b/src/main/java/com/checkout/accounts/ProcessingDetails.java @@ -0,0 +1,35 @@ +package com.checkout.accounts; + +import com.checkout.common.Currency; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ProcessingDetails { + + @SerializedName("settlement_country") + private String settlementCountry; + + @SerializedName("target_countries") + private List targetCountries; + + @SerializedName("annual_processing_volume") + private Integer annualProcessingVolume; + + @SerializedName("average_transaction_value") + private Integer averageTransactionValue; + + @SerializedName("highest_transaction_value") + private Integer highestTransactionValue; + + private Currency currency; + +} diff --git a/src/main/java/com/checkout/accounts/ProofOfLegality.java b/src/main/java/com/checkout/accounts/ProofOfLegality.java new file mode 100644 index 00000000..35263323 --- /dev/null +++ b/src/main/java/com/checkout/accounts/ProofOfLegality.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ProofOfLegality { + + private ProofOfLegalityType type; + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/ProofOfLegalityType.java b/src/main/java/com/checkout/accounts/ProofOfLegalityType.java new file mode 100644 index 00000000..a1130bb3 --- /dev/null +++ b/src/main/java/com/checkout/accounts/ProofOfLegalityType.java @@ -0,0 +1,10 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum ProofOfLegalityType { + + @SerializedName("proof_of_legality") + PROOF_OF_LEGALITY + +} \ No newline at end of file diff --git a/src/main/java/com/checkout/accounts/ProofOfPrincipalAddress.java b/src/main/java/com/checkout/accounts/ProofOfPrincipalAddress.java new file mode 100644 index 00000000..b7488f84 --- /dev/null +++ b/src/main/java/com/checkout/accounts/ProofOfPrincipalAddress.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ProofOfPrincipalAddress { + + private ProofOfPrincipalAddressType type; + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/ProofOfPrincipalAddressType.java b/src/main/java/com/checkout/accounts/ProofOfPrincipalAddressType.java new file mode 100644 index 00000000..e04df292 --- /dev/null +++ b/src/main/java/com/checkout/accounts/ProofOfPrincipalAddressType.java @@ -0,0 +1,10 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum ProofOfPrincipalAddressType { + + @SerializedName("proof_of_address") + PROOF_OF_ADDRESS + +} \ No newline at end of file diff --git a/src/main/java/com/checkout/accounts/ShareholderStructure.java b/src/main/java/com/checkout/accounts/ShareholderStructure.java new file mode 100644 index 00000000..9d9de8ab --- /dev/null +++ b/src/main/java/com/checkout/accounts/ShareholderStructure.java @@ -0,0 +1,18 @@ +package com.checkout.accounts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class ShareholderStructure { + + private ShareholderStructureType type; + + private String front; + +} diff --git a/src/main/java/com/checkout/accounts/ShareholderStructureType.java b/src/main/java/com/checkout/accounts/ShareholderStructureType.java new file mode 100644 index 00000000..c7a3ce7b --- /dev/null +++ b/src/main/java/com/checkout/accounts/ShareholderStructureType.java @@ -0,0 +1,10 @@ +package com.checkout.accounts; + +import com.google.gson.annotations.SerializedName; + +public enum ShareholderStructureType { + + @SerializedName("certified_shareholder_structure") + CERTIFIED_SHAREHOLDER_STRUCTURE + +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java new file mode 100644 index 00000000..0c48f5c9 --- /dev/null +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationData.java @@ -0,0 +1,47 @@ +package com.checkout.payments.contexts; + +import com.checkout.common.Address; +import com.checkout.common.CountryCode; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.Instant; +import java.util.List; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class PaymentContextsAccommodationData { + + private String name; + + @SerializedName("booking_reference") + private String bookingReference; + + @SerializedName("check_in_date") + private Instant checkInDate; + + @SerializedName("check_out_date") + private Instant checkOutDate; + + private Address address; + + private CountryCode state; + + private CountryCode country; + + private String city; + + @SerializedName("number_of_rooms") + private Integer numberOfRooms; + + @SerializedName("guests") + private List guests; + + @SerializedName("room") + private List room; +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationRoom.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationRoom.java new file mode 100644 index 00000000..7c684e6b --- /dev/null +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsAccommodationRoom.java @@ -0,0 +1,19 @@ +package com.checkout.payments.contexts; + +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 PaymentContextsAccommodationRoom { + + private String rate; + + @SerializedName("number_of_nights_at_room_rate") + private Integer numberOfNightsAtRoomRate; +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsGuests.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsGuests.java new file mode 100644 index 00000000..2f5abc2e --- /dev/null +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsGuests.java @@ -0,0 +1,25 @@ +package com.checkout.payments.contexts; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.Instant; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public final class PaymentContextsGuests { + + @SerializedName("first_name") + private String firstName; + + @SerializedName("last_name") + private String lastName; + + @SerializedName("date_of_birth") + private Instant dateOfBirth; +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsItems.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsItems.java index c09ae3c5..a8f6b2a8 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContextsItems.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsItems.java @@ -12,7 +12,7 @@ @AllArgsConstructor public final class PaymentContextsItems { - private String type; + private PaymentContextsItemsType type; private String name; diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsItemsType.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsItemsType.java new file mode 100644 index 00000000..623a5209 --- /dev/null +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsItemsType.java @@ -0,0 +1,12 @@ +package com.checkout.payments.contexts; + +import com.google.gson.annotations.SerializedName; + +public enum PaymentContextsItemsType { + + @SerializedName("physical") + PHYSICAL, + + @SerializedName("digital") + DIGITAL, +} diff --git a/src/main/java/com/checkout/payments/contexts/PaymentContextsProcessing.java b/src/main/java/com/checkout/payments/contexts/PaymentContextsProcessing.java index 20945436..f6eba1f2 100644 --- a/src/main/java/com/checkout/payments/contexts/PaymentContextsProcessing.java +++ b/src/main/java/com/checkout/payments/contexts/PaymentContextsProcessing.java @@ -25,6 +25,9 @@ public final class PaymentContextsProcessing { @SerializedName("shipping_amount") private Integer shippingAmount; + @SerializedName("tax_amount") + private Integer taxAmount; + @SerializedName("invoice_id") private String invoiceId; @@ -42,7 +45,13 @@ public final class PaymentContextsProcessing { @SerializedName("partner_customer_risk_data") private PaymentContextsPartnerCustomerRiskData partnerCustomerRiskData; + @SerializedName("custom_payment_method_ids") + private List customPaymentMethodIds; + @SerializedName("airline_data") private List airlineData; + @SerializedName("accommodation_data") + private List accommodationData; + } diff --git a/src/test/java/com/checkout/payments/RequestApmPaymentsIT.java b/src/test/java/com/checkout/payments/RequestApmPaymentsIT.java index 92d41979..84a94e75 100644 --- a/src/test/java/com/checkout/payments/RequestApmPaymentsIT.java +++ b/src/test/java/com/checkout/payments/RequestApmPaymentsIT.java @@ -26,7 +26,6 @@ import com.checkout.payments.request.source.apm.RequestGiropaySource; import com.checkout.payments.request.source.apm.RequestIdealSource; import com.checkout.payments.request.source.apm.RequestIllicadoSource; -import com.checkout.payments.request.source.apm.RequestKlarnaSource; import com.checkout.payments.request.source.apm.RequestKnetSource; import com.checkout.payments.request.source.apm.RequestMbwaySource; import com.checkout.payments.request.source.apm.RequestMultiBancoSource; @@ -478,23 +477,6 @@ void shouldMakeAlmaPayment() { checkErrorItem(() -> paymentsClient.requestPayment(paymentRequest), PAYEE_NOT_ONBOARDED); } - @Test - @Disabled("not available") - void shouldMakeKlarnaPayment() { - final PaymentRequest paymentRequest = PaymentRequest.builder() - .source(RequestKlarnaSource.builder() - .accountHolder(TestHelper.getAccountHolder()) - .build()) - .currency(Currency.EUR) - .amount(10L) - .capture(true) - .successUrl("https://testing.checkout.com/sucess") - .failureUrl("https://testing.checkout.com/failure") - .build(); - - checkErrorItem(() -> paymentsClient.requestPayment(paymentRequest), APM_SERVICE_UNAVAILABLE); - } - @Test void shouldMakeFawryPayment() { final PaymentRequest paymentRequest = PaymentRequest.builder() diff --git a/src/test/java/com/checkout/payments/RequestPaymentsTestIT.java b/src/test/java/com/checkout/payments/RequestPaymentsTestIT.java index 862662ce..ddda58db 100644 --- a/src/test/java/com/checkout/payments/RequestPaymentsTestIT.java +++ b/src/test/java/com/checkout/payments/RequestPaymentsTestIT.java @@ -1,7 +1,6 @@ package com.checkout.payments; import com.checkout.CardSourceHelper; -import com.checkout.CheckoutArgumentException; import com.checkout.common.AccountHolderIdentification; import com.checkout.common.AccountHolderIdentificationType; import com.checkout.common.Address; @@ -29,7 +28,6 @@ import java.time.Instant; import java.util.Collections; -import java.util.Date; import java.util.UUID; import static com.checkout.CardSourceHelper.getCorporateSender; diff --git a/src/test/java/com/checkout/payments/contexts/PaymentContextsTestIT.java b/src/test/java/com/checkout/payments/contexts/PaymentContextsTestIT.java index 6a5a2fe2..b6bd7559 100644 --- a/src/test/java/com/checkout/payments/contexts/PaymentContextsTestIT.java +++ b/src/test/java/com/checkout/payments/contexts/PaymentContextsTestIT.java @@ -34,7 +34,12 @@ void shouldMakeAPaymentContextKlarnaRequest() { final PaymentContextsRequest request = TestHelper.createPaymentContextsKlarnaRequest(); - checkErrorItem(() -> checkoutApi.paymentContextsClient().requestPaymentContexts(request), "apm_service_unavailable"); + final PaymentContextsRequestResponse response = blocking(() -> checkoutApi.paymentContextsClient().requestPaymentContexts(request)); + + assertNotNull(response); + assertNotNull(response.getId()); + assertNotNull(response.getPartnerMetadata().getSessionId()); + assertNotNull(response.getPartnerMetadata().getClientToken()); } @Test diff --git a/src/test/java/com/checkout/payments/previous/RequestApmPaymentsIT.java b/src/test/java/com/checkout/payments/previous/RequestApmPaymentsIT.java index 908ee945..c5541e06 100644 --- a/src/test/java/com/checkout/payments/previous/RequestApmPaymentsIT.java +++ b/src/test/java/com/checkout/payments/previous/RequestApmPaymentsIT.java @@ -279,7 +279,6 @@ void shouldMakeSofortPayment() { assertEquals(PaymentSourceType.SOFORT, paymentDetails.getSource().getType()); } - //@Disabled("not available") @Test void shouldMakeKnetPayment() { final PaymentRequest paymentRequest = PaymentRequest.builder()