Skip to content

Commit dff31f0

Browse files
Merge pull request #669 from nofrixion/MOOV-4892-verify-payee-endpoint-for-api-key-cus
Used simpler public models
2 parents c562a88 + fb27333 commit dff31f0

File tree

3 files changed

+84
-5
lines changed

3 files changed

+84
-5
lines changed

src/NoFrixion.MoneyMoov/Mapping/CounterpartyMappers.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// -----------------------------------------------------------------------------
1414

1515
using NoFrixion.MoneyMoov.Models;
16+
using NoFrixion.MoneyMoov.Models.PayeeVerification;
1617

1718
namespace NoFrixion.MoneyMoov;
1819

@@ -45,4 +46,19 @@ public static CounterpartyCreate ToCounterpartyCreate(this Counterparty counterp
4546
Identifier = counterparty.Identifier?.ToAccountIdentifierCreate()
4647
};
4748
}
49+
50+
public static Counterparty ToCounterparty(this VerifyPayeeRequest verifyPayeeRequest)
51+
{
52+
return new Counterparty
53+
{
54+
Name = verifyPayeeRequest.AccountName,
55+
Identifier = new AccountIdentifier()
56+
{
57+
Currency = CurrencyTypeEnum.None,
58+
IBAN = verifyPayeeRequest.IBAN,
59+
SortCode = verifyPayeeRequest.SortCode,
60+
AccountNumber = verifyPayeeRequest.AccountNumber
61+
}
62+
};
63+
}
4864
}

src/NoFrixion.MoneyMoov/Models/PayeeVerification/PayeeVerificationResult.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313
// MIT.
1414
// -----------------------------------------------------------------------------
1515

16+
using Newtonsoft.Json;
1617
using NoFrixion.MoneyMoov.Enums;
1718

1819
namespace NoFrixion.MoneyMoov.Models.PayeeVerification;
1920

2021
public class PayeeVerificationResult
2122
{
22-
/// <summary>
23-
/// An optional reference that was passed in with the verification request
24-
/// </summary>
25-
public string? Reference { get; init; }
26-
2723
/// <summary>
2824
/// The result of the payee verification
2925
/// </summary>
@@ -37,7 +33,11 @@ public class PayeeVerificationResult
3733
/// <summary>
3834
/// The raw response from the supplier (e.g. Technoxander) as a JSON string, if available
3935
/// </summary>
36+
[System.Text.Json.Serialization.JsonIgnore]
37+
[JsonIgnore]
4038
public string? SupplierRawResponse { get; set; }
4139

40+
[System.Text.Json.Serialization.JsonIgnore]
41+
[JsonIgnore]
4242
public string? SupplierStatus { get; set; }
4343
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// -----------------------------------------------------------------------------
2+
// Filename: VerifyPayeeRequest.cs
3+
//
4+
// Description: Request to verify a payee
5+
//
6+
// Author(s):
7+
// Saurav Maiti ([email protected])
8+
//
9+
// History:
10+
// 15 Oct 2025 Saurav Maiti Created, Hamilton gardens, Dublin, Ireland.
11+
//
12+
// License:
13+
// Proprietary NoFrixion.
14+
// -----------------------------------------------------------------------------
15+
16+
using System.ComponentModel.DataAnnotations;
17+
18+
namespace NoFrixion.MoneyMoov.Models.PayeeVerification;
19+
20+
public class VerifyPayeeRequest: IValidatableObject
21+
{
22+
/// <summary>
23+
/// The name of the account to verify
24+
/// </summary>
25+
[Required(ErrorMessage = "Account name is required")]
26+
public string? AccountName { get; set; }
27+
28+
/// <summary>
29+
/// The IBAN of the account to verify (for VoP checks)
30+
/// </summary>
31+
[Required(ErrorMessage = "IBAN is required")]
32+
public string? IBAN { get; set; }
33+
34+
/// <summary>
35+
/// The sort code of the account to verify (for CoP checks)
36+
/// </summary>
37+
public string? SortCode { get; set; }
38+
39+
/// <summary>
40+
/// The account number of the account to verify (for CoP checks)
41+
/// </summary>
42+
public string? AccountNumber { get; set; }
43+
44+
/// <summary>
45+
/// Optional secondary identifier for the account to verify.
46+
/// It is usually the reason why the payment is being made or what invoice or obligation it relates to.
47+
/// Some responders may require this where just the identifier is not sufficient to uniquely identify the account.
48+
/// </summary>
49+
public string? SecondaryIdentification { get; set; }
50+
51+
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
52+
{
53+
if (string.IsNullOrWhiteSpace(AccountName))
54+
{
55+
yield return new ValidationResult("Account name is required", [nameof(AccountName)]);
56+
}
57+
58+
if (string.IsNullOrWhiteSpace(IBAN))
59+
{
60+
yield return new ValidationResult("IBAN is required", [nameof(IBAN)]);
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)