Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Embedly.SDK.Tests/Services/PayoutServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public async Task NameEnquiryAsync_WithValidRequest_ReturnsAccountName()
result.Should().NotBeNull();
result.Success.Should().BeTrue();
result.Data.Should().NotBeNull();
result.Data!.AccountName.Should().NotBeNullOrEmpty();
result.Data!.Data.AccountName.Should().NotBeNullOrEmpty();
}

[Test]
Expand Down Expand Up @@ -404,10 +404,13 @@ private NameEnquiryResponse CreateTestNameEnquiryResponse()
{
return new NameEnquiryResponse
{
AccountName = "John Doe",
AccountNumber = "1234567890",
BankCode = "011",
BankName = "First Bank of Nigeria"
Status = "success",
Data = new BankAccountVerificationData
{
DestinationBankCode = "000010",
AccountNumber = "1111111111",
AccountName = "CHECKING ACCOUNT"
}
};
}

Expand Down
18 changes: 18 additions & 0 deletions Embedly.SDK/Models/Responses/Common/ApiResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ public sealed class ApiResponse<T>
/// </summary>
[JsonPropertyName("requestId")]
public string? RequestId { get; set; }

/// <summary>
/// Gets or sets the HTTP status code associated with the error.
/// </summary>
[JsonPropertyName("statusCode")]
public int StatusCode { get; set; }

/// <summary>
/// Gets or sets the specific error code, if provided.
/// </summary>
[JsonPropertyName("code")]
public string? Code { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the request succeeded.
/// </summary>
[JsonPropertyName("succeeded")]
public bool Succeeded { get; set; }
}

/// <summary>
Expand Down
48 changes: 33 additions & 15 deletions Embedly.SDK/Models/Responses/Payout/NameEnquiryResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,50 @@ namespace Embedly.SDK.Models.Responses.Payout;
public sealed class NameEnquiryResponse
{
/// <summary>
/// Gets or sets the account number.
/// Gets or sets the overall status of the verification response.
/// </summary>
[JsonPropertyName("accountNumber")]
public string AccountNumber { get; set; } = string.Empty;
[JsonPropertyName("status")]
public string Status { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the account name.
/// Gets or sets the detailed bank account verification data.
/// </summary>
[JsonPropertyName("accountName")]
public string AccountName { get; set; } = string.Empty;
[JsonPropertyName("data")]
public BankAccountVerificationData Data { get; set; } = new();

/// <summary>
/// Gets or sets the bank code.
/// Gets or sets the response code returned from the verification service.
/// </summary>
[JsonPropertyName("bankCode")]
public string BankCode { get; set; } = string.Empty;
[JsonPropertyName("code")]
public string? Code { get; set; }

/// <summary>
/// Gets or sets the bank name.
/// Gets or sets the message returned from the verification service.
/// </summary>
[JsonPropertyName("bankName")]
public string BankName { get; set; } = string.Empty;
[JsonPropertyName("message")]
public string? Message { get; set; }
}

/// <summary>
/// Represents the detailed data for the bank account verification response.
/// </summary>
public class BankAccountVerificationData
{
/// <summary>
/// Gets or sets whether the account is valid.
/// Gets or sets the destination bank code associated with the account.
/// </summary>
[JsonPropertyName("isValid")]
public bool IsValid { get; set; }
[JsonPropertyName("destinationBankCode")]
public string DestinationBankCode { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the verified bank account number.
/// </summary>
[JsonPropertyName("accountNumber")]
public string AccountNumber { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the verified name associated with the bank account.
/// </summary>
[JsonPropertyName("accountName")]
public string AccountName { get; set; } = string.Empty;
}
Loading