diff --git a/Embedly.SDK.Tests/Services/PayoutServiceTests.cs b/Embedly.SDK.Tests/Services/PayoutServiceTests.cs index 03607f2..be8c452 100644 --- a/Embedly.SDK.Tests/Services/PayoutServiceTests.cs +++ b/Embedly.SDK.Tests/Services/PayoutServiceTests.cs @@ -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] @@ -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" + } }; } diff --git a/Embedly.SDK/Models/Responses/Common/ApiResponse.cs b/Embedly.SDK/Models/Responses/Common/ApiResponse.cs index d139997..66fc41a 100644 --- a/Embedly.SDK/Models/Responses/Common/ApiResponse.cs +++ b/Embedly.SDK/Models/Responses/Common/ApiResponse.cs @@ -51,6 +51,24 @@ public sealed class ApiResponse /// [JsonPropertyName("requestId")] public string? RequestId { get; set; } + + /// + /// Gets or sets the HTTP status code associated with the error. + /// + [JsonPropertyName("statusCode")] + public int StatusCode { get; set; } + + /// + /// Gets or sets the specific error code, if provided. + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// Gets or sets a value indicating whether the request succeeded. + /// + [JsonPropertyName("succeeded")] + public bool Succeeded { get; set; } } /// diff --git a/Embedly.SDK/Models/Responses/Payout/NameEnquiryResponse.cs b/Embedly.SDK/Models/Responses/Payout/NameEnquiryResponse.cs index d5eaf71..d42010f 100644 --- a/Embedly.SDK/Models/Responses/Payout/NameEnquiryResponse.cs +++ b/Embedly.SDK/Models/Responses/Payout/NameEnquiryResponse.cs @@ -8,32 +8,50 @@ namespace Embedly.SDK.Models.Responses.Payout; public sealed class NameEnquiryResponse { /// - /// Gets or sets the account number. + /// Gets or sets the overall status of the verification response. /// - [JsonPropertyName("accountNumber")] - public string AccountNumber { get; set; } = string.Empty; + [JsonPropertyName("status")] + public string Status { get; set; } = string.Empty; /// - /// Gets or sets the account name. + /// Gets or sets the detailed bank account verification data. /// - [JsonPropertyName("accountName")] - public string AccountName { get; set; } = string.Empty; + [JsonPropertyName("data")] + public BankAccountVerificationData Data { get; set; } = new(); /// - /// Gets or sets the bank code. + /// Gets or sets the response code returned from the verification service. /// - [JsonPropertyName("bankCode")] - public string BankCode { get; set; } = string.Empty; + [JsonPropertyName("code")] + public string? Code { get; set; } /// - /// Gets or sets the bank name. + /// Gets or sets the message returned from the verification service. /// - [JsonPropertyName("bankName")] - public string BankName { get; set; } = string.Empty; + [JsonPropertyName("message")] + public string? Message { get; set; } +} +/// +/// Represents the detailed data for the bank account verification response. +/// +public class BankAccountVerificationData +{ /// - /// Gets or sets whether the account is valid. + /// Gets or sets the destination bank code associated with the account. /// - [JsonPropertyName("isValid")] - public bool IsValid { get; set; } + [JsonPropertyName("destinationBankCode")] + public string DestinationBankCode { get; set; } = string.Empty; + + /// + /// Gets or sets the verified bank account number. + /// + [JsonPropertyName("accountNumber")] + public string AccountNumber { get; set; } = string.Empty; + + /// + /// Gets or sets the verified name associated with the bank account. + /// + [JsonPropertyName("accountName")] + public string AccountName { get; set; } = string.Empty; } \ No newline at end of file