From 0adaffd5c0f27b573c991de5003a7ff060e3213e 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, 12 Sep 2024 18:25:06 +0200 Subject: [PATCH] Update endpoint accounts (#418) --- src/CheckoutSdk/Accounts/AccountPhone.cs | 5 ++++- .../Accounts/AdditionalDocument.cs | 7 +++++++ src/CheckoutSdk/Accounts/AdditionalInfo.cs | 11 ++++++++++ .../Accounts/ArticlesOfAssociationType.cs | 13 ++++++++++++ src/CheckoutSdk/Accounts/BankVerification.cs | 9 +++++++++ .../Accounts/BankVerificationType.cs | 9 +++++++++ src/CheckoutSdk/Accounts/Capabilities.cs | 13 ++++++++++-- src/CheckoutSdk/Accounts/Company.cs | 14 ++++++++----- .../Accounts/DateOfIncorporation.cs | 9 +++++++++ .../Accounts/FinancialVerification.cs | 9 +++++++++ .../Accounts/FinancialVerificationType.cs | 10 ++++++++++ .../Accounts/OnboardEntityRequest.cs | 10 +++++++--- .../Accounts/OnboardSubEntityDocuments.cs | 18 +++++++++++++++++ src/CheckoutSdk/Accounts/ProcessingDetails.cs | 20 +++++++++++++++++++ src/CheckoutSdk/Accounts/ProofOfLegality.cs | 9 +++++++++ .../Accounts/ProofOfLegalityType.cs | 10 ++++++++++ .../Accounts/ProofOfPrincipalAddress.cs | 9 +++++++++ .../Accounts/ProofOfPrincipalAddressType.cs | 10 ++++++++++ .../Accounts/Regional/CompanyTypeConverter.cs | 6 ++++++ .../Accounts/ShareholderStructure.cs | 9 +++++++++ .../Accounts/ShareholderStructureType.cs | 10 ++++++++++ .../Accounts/AccountsIntegrationTest.cs | 12 +++++------ .../RequestApmPaymentsIntegrationTest.cs | 2 +- .../RequestApmPaymentsIntegrationTest.cs | 2 +- 24 files changed, 217 insertions(+), 19 deletions(-) create mode 100644 src/CheckoutSdk/Accounts/AdditionalDocument.cs create mode 100644 src/CheckoutSdk/Accounts/AdditionalInfo.cs create mode 100644 src/CheckoutSdk/Accounts/ArticlesOfAssociationType.cs create mode 100644 src/CheckoutSdk/Accounts/BankVerification.cs create mode 100644 src/CheckoutSdk/Accounts/BankVerificationType.cs create mode 100644 src/CheckoutSdk/Accounts/DateOfIncorporation.cs create mode 100644 src/CheckoutSdk/Accounts/FinancialVerification.cs create mode 100644 src/CheckoutSdk/Accounts/FinancialVerificationType.cs create mode 100644 src/CheckoutSdk/Accounts/ProcessingDetails.cs create mode 100644 src/CheckoutSdk/Accounts/ProofOfLegality.cs create mode 100644 src/CheckoutSdk/Accounts/ProofOfLegalityType.cs create mode 100644 src/CheckoutSdk/Accounts/ProofOfPrincipalAddress.cs create mode 100644 src/CheckoutSdk/Accounts/ProofOfPrincipalAddressType.cs create mode 100644 src/CheckoutSdk/Accounts/ShareholderStructure.cs create mode 100644 src/CheckoutSdk/Accounts/ShareholderStructureType.cs diff --git a/src/CheckoutSdk/Accounts/AccountPhone.cs b/src/CheckoutSdk/Accounts/AccountPhone.cs index 16e59ba7..682b10d6 100644 --- a/src/CheckoutSdk/Accounts/AccountPhone.cs +++ b/src/CheckoutSdk/Accounts/AccountPhone.cs @@ -1,7 +1,10 @@ -namespace Checkout.Accounts +using Checkout.Common; + +namespace Checkout.Accounts { public class AccountPhone { + public CountryCode? CountryCode { get; set; } public string Number { get; set; } } } \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/AdditionalDocument.cs b/src/CheckoutSdk/Accounts/AdditionalDocument.cs new file mode 100644 index 00000000..ecb62c0f --- /dev/null +++ b/src/CheckoutSdk/Accounts/AdditionalDocument.cs @@ -0,0 +1,7 @@ +namespace Checkout.Accounts +{ + public class AdditionalDocument + { + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/AdditionalInfo.cs b/src/CheckoutSdk/Accounts/AdditionalInfo.cs new file mode 100644 index 00000000..c7d80a2d --- /dev/null +++ b/src/CheckoutSdk/Accounts/AdditionalInfo.cs @@ -0,0 +1,11 @@ +namespace Checkout.Accounts +{ + public class AdditionalInfo + { + public string Field1 { get; set; } + + public string Field2 { get; set; } + + public string Field3 { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ArticlesOfAssociationType.cs b/src/CheckoutSdk/Accounts/ArticlesOfAssociationType.cs new file mode 100644 index 00000000..6e3109df --- /dev/null +++ b/src/CheckoutSdk/Accounts/ArticlesOfAssociationType.cs @@ -0,0 +1,13 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum ArticlesOfAssociationType + { + [EnumMember(Value = "memorandum_of_association")] + MemorandumOfAssociation, + + [EnumMember(Value = "articles_of_association")] + ArticlesOfAssociation + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/BankVerification.cs b/src/CheckoutSdk/Accounts/BankVerification.cs new file mode 100644 index 00000000..6aaa53d6 --- /dev/null +++ b/src/CheckoutSdk/Accounts/BankVerification.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class BankVerification + { + public BankVerificationType? Type { get; set; } + + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/BankVerificationType.cs b/src/CheckoutSdk/Accounts/BankVerificationType.cs new file mode 100644 index 00000000..3f3cac20 --- /dev/null +++ b/src/CheckoutSdk/Accounts/BankVerificationType.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum BankVerificationType + { + [EnumMember(Value = "bank_statement")] BankStatement + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/Capabilities.cs b/src/CheckoutSdk/Accounts/Capabilities.cs index d734d8a3..f5865825 100644 --- a/src/CheckoutSdk/Accounts/Capabilities.cs +++ b/src/CheckoutSdk/Accounts/Capabilities.cs @@ -6,17 +6,26 @@ public class Capabilities public PayoutsNC Payouts { get; set; } + public IssuingCapabilities Issuing { get; set; } + public class PaymentsNC { public bool? Available { get; set; } - + public bool? Enabled { get; set; } } public class PayoutsNC { public bool? Available { get; set; } - + + public bool? Enabled { get; set; } + } + + public class IssuingCapabilities + { + public bool? Available { get; set; } + public bool? Enabled { get; set; } } } diff --git a/src/CheckoutSdk/Accounts/Company.cs b/src/CheckoutSdk/Accounts/Company.cs index 40078b3d..598e9c68 100644 --- a/src/CheckoutSdk/Accounts/Company.cs +++ b/src/CheckoutSdk/Accounts/Company.cs @@ -7,14 +7,16 @@ namespace Checkout.Accounts { public class Company { - public string BusinessRegistrationNumber { get; set; } - - public BusinessType? BusinessType { get; set; } - public string LegalName { get; set; } public string TradingName { get; set; } + public string BusinessRegistrationNumber { get; set; } + + public DateOfIncorporation DateOfIncorporation { get; set; } + + public string RegulatoryLicenceNumber { get; set; } + public Address PrincipalAddress { get; set; } public Address RegisteredAddress { get; set; } @@ -22,7 +24,9 @@ public class Company public IList Representatives { get; set; } public EntityDocument Document { get; set; } - + public EntityFinancialDetails FinancialDetails { get; set; } + + public BusinessType? BusinessType { get; set; } } } \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/DateOfIncorporation.cs b/src/CheckoutSdk/Accounts/DateOfIncorporation.cs new file mode 100644 index 00000000..7b4f7a64 --- /dev/null +++ b/src/CheckoutSdk/Accounts/DateOfIncorporation.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class DateOfIncorporation + { + public int? Month { get; set; } + + public int? Year { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/FinancialVerification.cs b/src/CheckoutSdk/Accounts/FinancialVerification.cs new file mode 100644 index 00000000..0bdeb544 --- /dev/null +++ b/src/CheckoutSdk/Accounts/FinancialVerification.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class FinancialVerification + { + public FinancialVerificationType? Type { get; set; } + + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/FinancialVerificationType.cs b/src/CheckoutSdk/Accounts/FinancialVerificationType.cs new file mode 100644 index 00000000..b505ca7b --- /dev/null +++ b/src/CheckoutSdk/Accounts/FinancialVerificationType.cs @@ -0,0 +1,10 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum FinancialVerificationType + { + [EnumMember(Value = "financial_statement")] + FinancialStatement + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/OnboardEntityRequest.cs b/src/CheckoutSdk/Accounts/OnboardEntityRequest.cs index eb50c15c..198f5da3 100644 --- a/src/CheckoutSdk/Accounts/OnboardEntityRequest.cs +++ b/src/CheckoutSdk/Accounts/OnboardEntityRequest.cs @@ -5,15 +5,19 @@ public class OnboardEntityRequest public string Reference { get; set; } public bool IsDraft { get; set; } - - public ContactDetails ContactDetails { get; set; } - + public Profile Profile { get; set; } + public ContactDetails ContactDetails { get; set; } + public Company Company { get; set; } + public ProcessingDetails ProcessingDetails { get; set; } + public Individual Individual { get; set; } public OnboardSubEntityDocuments Documents { get; set; } + + public AdditionalInfo AdditionalInfo { get; set; } } } \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/OnboardSubEntityDocuments.cs b/src/CheckoutSdk/Accounts/OnboardSubEntityDocuments.cs index bdf58b9a..bfd75759 100644 --- a/src/CheckoutSdk/Accounts/OnboardSubEntityDocuments.cs +++ b/src/CheckoutSdk/Accounts/OnboardSubEntityDocuments.cs @@ -6,6 +6,24 @@ public class OnboardSubEntityDocuments public CompanyVerification CompanyVerification { get; set; } + public ArticlesOfAssociationType? ArticlesOfAssociation { get; set; } + + public BankVerification BankVerification { get; set; } + + public ShareholderStructure ShareholderStructure { get; set; } + + public ProofOfLegality ProofOfLegality { get; set; } + + public ProofOfPrincipalAddress ProofOfPrincipalAddress { get; set; } + + public AdditionalDocument AdditionalDocument1 { get; set; } + + public AdditionalDocument AdditionalDocument2 { get; set; } + + public AdditionalDocument AdditionalDocument3 { get; set; } + public TaxVerification TaxVerification { get; set; } + + public FinancialVerification FinancialVerification { get; set; } } } \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ProcessingDetails.cs b/src/CheckoutSdk/Accounts/ProcessingDetails.cs new file mode 100644 index 00000000..86fb9858 --- /dev/null +++ b/src/CheckoutSdk/Accounts/ProcessingDetails.cs @@ -0,0 +1,20 @@ +using Checkout.Common; +using System.Collections.Generic; + +namespace Checkout.Accounts +{ + public class ProcessingDetails + { + public string SettlementCountry { get; set; } + + public IList TargetCountries { get; set; } + + public int? AnnualProcessingVolume { get; set; } + + public int? AverageTransactionValue { get; set; } + + public int? HighestTransactionValue { get; set; } + + public Currency? Currency { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ProofOfLegality.cs b/src/CheckoutSdk/Accounts/ProofOfLegality.cs new file mode 100644 index 00000000..20b792ea --- /dev/null +++ b/src/CheckoutSdk/Accounts/ProofOfLegality.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class ProofOfLegality + { + public ProofOfLegalityType? Type { get; set; } + + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ProofOfLegalityType.cs b/src/CheckoutSdk/Accounts/ProofOfLegalityType.cs new file mode 100644 index 00000000..2082f383 --- /dev/null +++ b/src/CheckoutSdk/Accounts/ProofOfLegalityType.cs @@ -0,0 +1,10 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum ProofOfLegalityType + { + [EnumMember(Value = "proof_of_legality")] + ProofOfLegality + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ProofOfPrincipalAddress.cs b/src/CheckoutSdk/Accounts/ProofOfPrincipalAddress.cs new file mode 100644 index 00000000..913f683c --- /dev/null +++ b/src/CheckoutSdk/Accounts/ProofOfPrincipalAddress.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class ProofOfPrincipalAddress + { + public ProofOfPrincipalAddressType? Type { get; set; } + + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ProofOfPrincipalAddressType.cs b/src/CheckoutSdk/Accounts/ProofOfPrincipalAddressType.cs new file mode 100644 index 00000000..078026d3 --- /dev/null +++ b/src/CheckoutSdk/Accounts/ProofOfPrincipalAddressType.cs @@ -0,0 +1,10 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum ProofOfPrincipalAddressType + { + [EnumMember(Value = "proof_of_address")] + ProofOfAddress + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/Regional/CompanyTypeConverter.cs b/src/CheckoutSdk/Accounts/Regional/CompanyTypeConverter.cs index a941f3d1..d3dca35a 100644 --- a/src/CheckoutSdk/Accounts/Regional/CompanyTypeConverter.cs +++ b/src/CheckoutSdk/Accounts/Regional/CompanyTypeConverter.cs @@ -57,6 +57,12 @@ public override object ReadJson( return target; } } + else + { + var target = new OnboardEntityDetailsResponse(); + serializer.Populate(jObject.CreateReader(), target); + return target; + } } throw new JsonSerializationException($"Unexpected token or value when parsing enum. Token: {reader.TokenType}, Value: {jObject}"); diff --git a/src/CheckoutSdk/Accounts/ShareholderStructure.cs b/src/CheckoutSdk/Accounts/ShareholderStructure.cs new file mode 100644 index 00000000..34726e3f --- /dev/null +++ b/src/CheckoutSdk/Accounts/ShareholderStructure.cs @@ -0,0 +1,9 @@ +namespace Checkout.Accounts +{ + public class ShareholderStructure + { + public ShareholderStructureType? Type { get; set; } + + public string Front { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Accounts/ShareholderStructureType.cs b/src/CheckoutSdk/Accounts/ShareholderStructureType.cs new file mode 100644 index 00000000..55743aee --- /dev/null +++ b/src/CheckoutSdk/Accounts/ShareholderStructureType.cs @@ -0,0 +1,10 @@ +using System.Runtime.Serialization; + +namespace Checkout.Accounts +{ + public enum ShareholderStructureType + { + [EnumMember(Value = "certified_shareholder_structure")] + CertifiedShareholderStructure + } +} \ No newline at end of file diff --git a/test/CheckoutSdkTest/Accounts/AccountsIntegrationTest.cs b/test/CheckoutSdkTest/Accounts/AccountsIntegrationTest.cs index cf150350..e2cbf64b 100644 --- a/test/CheckoutSdkTest/Accounts/AccountsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Accounts/AccountsIntegrationTest.cs @@ -20,7 +20,7 @@ public AccountsIntegrationTest() : base(PlatformType.DefaultOAuth) { } - [Fact(Skip = "unavailable")] + [Fact] public async Task ShouldCreateGetAndUpdateOnboardEntity() { string randomReference = RandomString(15); @@ -40,8 +40,8 @@ public async Task ShouldCreateGetAndUpdateOnboardEntity() AddressLine2 = "90 Tottenham Court Road", City = "London", State = "London", - Zip = "WIT 4TJ", - Country = CountryCode.ES + Zip = "W1T 4TJ", + Country = CountryCode.GB }, NationalTaxId = "TAX123456", DateOfBirth = new DateOfBirth { Day = 5, Month = 6, Year = 1996 }, @@ -91,7 +91,7 @@ public async Task ShouldCreateGetAndUpdateOnboardEntity() onboardEntityRequest.Individual.FirstName.ShouldBe(verifyUpdated.Individual.FirstName); } - [Fact(Skip = "unavailable")] + [Fact] public async Task ShouldThrowConflictWhenCreatingExistingEntity() { string randomReference = RandomString(15); @@ -111,8 +111,8 @@ public async Task ShouldThrowConflictWhenCreatingExistingEntity() AddressLine2 = "90 Tottenham Court Road", City = "London", State = "London", - Zip = "WIT 4TJ", - Country = CountryCode.ES + Zip = "W1T 4TJ", + Country = CountryCode.GB }, NationalTaxId = "TAX123456", DateOfBirth = new DateOfBirth { Day = 5, Month = 6, Year = 1996 }, diff --git a/test/CheckoutSdkTest/Payments/Previous/RequestApmPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Previous/RequestApmPaymentsIntegrationTest.cs index ab2c020a..db18a9e4 100644 --- a/test/CheckoutSdkTest/Payments/Previous/RequestApmPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Previous/RequestApmPaymentsIntegrationTest.cs @@ -508,7 +508,7 @@ private async Task ShouldMakeSofortPayment() source.Type().ShouldBe(PaymentSourceType.Sofort); } - [Fact] + [Fact(Skip = "unavaolable")] private async Task ShouldMakeKnetPayment() { var paymentRequest = new PaymentRequest diff --git a/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs index de616d3d..4aa4a7e7 100644 --- a/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs @@ -377,7 +377,7 @@ private async Task ShouldMakeKnetPayment() }; await CheckErrorItem(async () => await DefaultApi.PaymentsClient().RequestPayment(request), - PayeeNotOnboarded); + ApmServiceUnavailable); } [Fact]