Skip to content

Commit

Permalink
Add Account Holder to APM payments
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko committed Oct 8, 2024
1 parent 38b3f10 commit 82afcb9
Show file tree
Hide file tree
Showing 17 changed files with 229 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/CheckoutSdk/Common/AccountHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ public class AccountHolder

public AccountHolderIdentification Identification { get; set; }

public bool AccountNameInquiry { get; set; }

}
}
7 changes: 6 additions & 1 deletion src/CheckoutSdk/Common/PaymentSourceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum PaymentSourceType
[EnumMember(Value = "id")] Id,
[EnumMember(Value = "network_token")] NetworkToken,
[EnumMember(Value = "token")] Token,
[EnumMember(Value = "ach")] Ach,
[EnumMember(Value = "customer")] Customer,
[EnumMember(Value = "provider_token")] ProviderToken,
[EnumMember(Value = "dLocal")] DLocal,
Expand All @@ -26,11 +27,14 @@ public enum PaymentSourceType
[EnumMember(Value = "alipay")] Alipay,
[EnumMember(Value = "paypal")] PayPal,
[EnumMember(Value = "multibanco")] Multibanco,
[EnumMember(Value = "octopus")] Octopus,
[EnumMember(Value = "plaid")] Plaid,
[EnumMember(Value = "eps")] EPS,
[EnumMember(Value = "illicado")] Illicado,
[EnumMember(Value = "poli")] Poli,
[EnumMember(Value = "p24")] Przelewy24,
[EnumMember(Value = "benefitpay")] BenefitPay,
[EnumMember(Value = "bizum")] Bizum,
[EnumMember(Value = "bancontact")] Bancontact,
[EnumMember(Value = "tamara")] Tamara,
[EnumMember(Value = "bank_account")] BankAccount,
Expand All @@ -51,6 +55,7 @@ public enum PaymentSourceType
[EnumMember(Value = "alma")] Alma,
[EnumMember(Value = "trustly")] Trustly,
[EnumMember(Value = "cvconnect")] Cvconnect,
[EnumMember(Value = "sepa")] Sepa
[EnumMember(Value = "sepa")] Sepa,
[EnumMember(Value = "sequra")] Sequra
}
}
21 changes: 21 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/Apm/RequestAchSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Checkout.Common;

namespace Checkout.Payments.Request.Source.Apm
{
public class RequestAchSource : AbstractRequestSource
{
public AccountType? AccountType { get; set; }

public CountryCode? Country { get; set; }

public string AccountNumber { get; set; }

public string BankCode { get; set; }

public AccountHolder AccountHolder { get; set; }

public RequestAchSource() : base(PaymentSourceType.Ach)
{
}
}
}
13 changes: 13 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/Apm/RequestBizumSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Checkout.Common;

namespace Checkout.Payments.Request.Source.Apm
{
public class RequestBizumSource : AbstractRequestSource
{
public string MobileNumber { get; set; }

public RequestBizumSource() : base(PaymentSourceType.Bizum)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace Checkout.Payments.Request.Source.Apm
public class RequestEpsSource : AbstractRequestSource
{
public string Purpose { get; set; }

public AccountHolder AccountHolder { get; set; }

public RequestEpsSource() : base(PaymentSourceType.EPS)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Checkout.Common;

namespace Checkout.Payments.Request.Source.Apm
{
public class RequestOctopusSource : AbstractRequestSource
{
public RequestOctopusSource() : base(PaymentSourceType.Octopus)
{
}
}
}
15 changes: 15 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/Apm/RequestPlaidSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Checkout.Common;

namespace Checkout.Payments.Request.Source.Apm
{
public class RequestPlaidSource : AbstractRequestSource
{
public string Token { get; set; }

public AccountHolder AccountHolder { get; set; }

public RequestPlaidSource() : base(PaymentSourceType.Plaid)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ public RequestSepaSource() : base(PaymentSourceType.Sepa)
public string DateOfSignature { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
13 changes: 13 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/Apm/RequestSequraSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Checkout.Common;

namespace Checkout.Payments.Request.Source.Apm
{
public class RequestSequraSource : AbstractRequestSource
{
public RequestSequraSource() : base(PaymentSourceType.Sequra)
{
}

public Address BillingAddress { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/RequestCardSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ public RequestCardSource() : base(PaymentSourceType.Card)
public Address BillingAddress { get; set; }

public Phone Phone { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public RequestCustomerSource() : base(PaymentSourceType.Customer)
}

public string Id { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
3 changes: 3 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/RequestIdSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ public RequestIdSource() : base(PaymentSourceType.Id)
public bool? Stored { get; set; }

public bool? StoreForFutureUse { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ public RequestNetworkTokenSource() : base(PaymentSourceType.NetworkToken)
public Address BillingAddress { get; set; }

public Phone Phone { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ public RequestProviderTokenSource() : base(PaymentSourceType.ProviderToken)
public string Token { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
3 changes: 3 additions & 0 deletions src/CheckoutSdk/Payments/Request/Source/RequestTokenSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ public RequestTokenSource() : base(PaymentSourceType.Token)
public bool? Stored { get; set; }

public bool? StoreForFutureUse { get; set; }

public AccountHolder AccountHolder { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public abstract class AbstractPaymentsIntegrationTest : SandboxTestFixture
protected const string IdempotencyKey = "test.net";
protected const string PayeeNotOnboarded = "payee_not_onboarded";
protected const string ApmServiceUnavailable = "apm_service_unavailable";
protected const string ApmCurrencyNotSupported = "currency_not_supported";

protected AbstractPaymentsIntegrationTest(PlatformType platform = PlatformType.Default) : base(platform)
{
Expand All @@ -37,7 +38,8 @@ protected async Task<PaymentResponse> MakeCardPayment(bool shouldCapture = false
ExpiryMonth = TestCardSource.Visa.ExpiryMonth,
Cvv = TestCardSource.Visa.Cvv,
BillingAddress = GetAddress(),
Phone = GetPhone()
Phone = GetPhone(),
AccountHolder = GetAccountHolder()
};

var customerRequest = new CustomerRequest {Email = GenerateRandomEmail(), Name = "Customer"};
Expand Down
Loading

0 comments on commit 82afcb9

Please sign in to comment.