Skip to content

Commit

Permalink
Update endpoint accounts (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored Sep 12, 2024
1 parent fb777d7 commit 0adaffd
Show file tree
Hide file tree
Showing 24 changed files with 217 additions and 19 deletions.
5 changes: 4 additions & 1 deletion src/CheckoutSdk/Accounts/AccountPhone.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
7 changes: 7 additions & 0 deletions src/CheckoutSdk/Accounts/AdditionalDocument.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Checkout.Accounts
{
public class AdditionalDocument
{
public string Front { get; set; }
}
}
11 changes: 11 additions & 0 deletions src/CheckoutSdk/Accounts/AdditionalInfo.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
13 changes: 13 additions & 0 deletions src/CheckoutSdk/Accounts/ArticlesOfAssociationType.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/BankVerification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class BankVerification
{
public BankVerificationType? Type { get; set; }

public string Front { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/BankVerificationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Runtime.Serialization;

namespace Checkout.Accounts
{
public enum BankVerificationType
{
[EnumMember(Value = "bank_statement")] BankStatement
}
}
13 changes: 11 additions & 2 deletions src/CheckoutSdk/Accounts/Capabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/CheckoutSdk/Accounts/Company.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ 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; }

public IList<Representative> Representatives { get; set; }

public EntityDocument Document { get; set; }

public EntityFinancialDetails FinancialDetails { get; set; }

public BusinessType? BusinessType { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/DateOfIncorporation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class DateOfIncorporation
{
public int? Month { get; set; }

public int? Year { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/FinancialVerification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class FinancialVerification
{
public FinancialVerificationType? Type { get; set; }

public string Front { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/CheckoutSdk/Accounts/FinancialVerificationType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Runtime.Serialization;

namespace Checkout.Accounts
{
public enum FinancialVerificationType
{
[EnumMember(Value = "financial_statement")]
FinancialStatement
}
}
10 changes: 7 additions & 3 deletions src/CheckoutSdk/Accounts/OnboardEntityRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
18 changes: 18 additions & 0 deletions src/CheckoutSdk/Accounts/OnboardSubEntityDocuments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
20 changes: 20 additions & 0 deletions src/CheckoutSdk/Accounts/ProcessingDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Checkout.Common;
using System.Collections.Generic;

namespace Checkout.Accounts
{
public class ProcessingDetails
{
public string SettlementCountry { get; set; }

public IList<string> TargetCountries { get; set; }

public int? AnnualProcessingVolume { get; set; }

public int? AverageTransactionValue { get; set; }

public int? HighestTransactionValue { get; set; }

public Currency? Currency { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/ProofOfLegality.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class ProofOfLegality
{
public ProofOfLegalityType? Type { get; set; }

public string Front { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/CheckoutSdk/Accounts/ProofOfLegalityType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Runtime.Serialization;

namespace Checkout.Accounts
{
public enum ProofOfLegalityType
{
[EnumMember(Value = "proof_of_legality")]
ProofOfLegality
}
}
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/ProofOfPrincipalAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class ProofOfPrincipalAddress
{
public ProofOfPrincipalAddressType? Type { get; set; }

public string Front { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/CheckoutSdk/Accounts/ProofOfPrincipalAddressType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Runtime.Serialization;

namespace Checkout.Accounts
{
public enum ProofOfPrincipalAddressType
{
[EnumMember(Value = "proof_of_address")]
ProofOfAddress
}
}
6 changes: 6 additions & 0 deletions src/CheckoutSdk/Accounts/Regional/CompanyTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down
9 changes: 9 additions & 0 deletions src/CheckoutSdk/Accounts/ShareholderStructure.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Checkout.Accounts
{
public class ShareholderStructure
{
public ShareholderStructureType? Type { get; set; }

public string Front { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/CheckoutSdk/Accounts/ShareholderStructureType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Runtime.Serialization;

namespace Checkout.Accounts
{
public enum ShareholderStructureType
{
[EnumMember(Value = "certified_shareholder_structure")]
CertifiedShareholderStructure
}
}
12 changes: 6 additions & 6 deletions test/CheckoutSdkTest/Accounts/AccountsIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public AccountsIntegrationTest() : base(PlatformType.DefaultOAuth)
{
}

[Fact(Skip = "unavailable")]
[Fact]
public async Task ShouldCreateGetAndUpdateOnboardEntity()
{
string randomReference = RandomString(15);
Expand All @@ -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 },
Expand Down Expand Up @@ -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);
Expand All @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private async Task ShouldMakeKnetPayment()
};

await CheckErrorItem(async () => await DefaultApi.PaymentsClient().RequestPayment(request),
PayeeNotOnboarded);
ApmServiceUnavailable);
}

[Fact]
Expand Down

0 comments on commit 0adaffd

Please sign in to comment.