Finova.Extensions.FluentValidation 1.4.0-alpha.1

This is a prerelease version of Finova.Extensions.FluentValidation.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Finova.Extensions.FluentValidation --version 1.4.0-alpha.1
                    
NuGet\Install-Package Finova.Extensions.FluentValidation -Version 1.4.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Finova.Extensions.FluentValidation" Version="1.4.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Finova.Extensions.FluentValidation" Version="1.4.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="Finova.Extensions.FluentValidation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Finova.Extensions.FluentValidation --version 1.4.0-alpha.1
                    
#r "nuget: Finova.Extensions.FluentValidation, 1.4.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Finova.Extensions.FluentValidation@1.4.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Finova.Extensions.FluentValidation&version=1.4.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Finova.Extensions.FluentValidation&version=1.4.0-alpha.1&prerelease
                    
Install as a Cake Tool

Finova

<div align="center">

**The Offline Financial Validation Toolkit for .NET### ๐Ÿ†” National Identity (New in v1.4.0)

  • Full European Coverage: Validates National ID / Citizen ID numbers for all 51 European countries and territories.
    • Western Europe: Belgium (NN), France (NIR), Germany (Steuer-ID), Netherlands (BSN), UK (NINO), etc.
    • Northern Europe: Sweden (Personnummer), Norway (Fรธdselsnummer), Denmark (CPR), Finland (HETU), Iceland (Kennitala).
    • Southern Europe: Italy (Codice Fiscale), Spain (DNI/NIE), Portugal (NIF), Greece (AMKA), Turkey (TC Kimlik).
    • Eastern Europe: Poland (PESEL), Romania (CNP), Ukraine (RNTRC), Bulgaria (EGN), etc.
    • Microstates: Andorra, Liechtenstein, Monaco, San Marino, Vatican.

๐ŸŒ **Global Expansion (New in v1.4.0)*AN ยท Payment References ยท Cards ยท VAT ยท Business Numbers

NuGet Version NuGet Downloads Build Status License: MIT

100% Offline | Zero Dependencies | Lightning Fast

Visit the Official Website

</div>


๐ŸŒŸ About Finova

Finova is a comprehensive offline financial validation library for .NET. It allows you to validate financial data (IBANs, Credit Cards, VAT numbers, Payment References) using official checksum algorithms (Luhn, Mod97, ISO 7064) and regex patterns directly on your server.

๐Ÿ‘‰ Visit the Official Website for full documentation and feature details.

โšก Offline Validation Only

Important: Finova performs 100% offline validation. It does NOT contact external services, APIs, or banking networks.

What Finova Does (Offline):

  • โœ… Validates IBAN format and checksum (ISO 7064 Mod 97)
  • โœ… Validates Payment Cards (Luhn Algorithm + Brand Detection)
  • โœ… Generates and validates payment references (OGM/VCS, ISO 11649)
  • โœ… Validates KBO/BCE and VAT numbers (Syntax + Checksum)
  • โœ… Validates BIC/SWIFT Structure (ISO 9362)

What Finova Does NOT Do:

  • โŒ Does NOT verify if an account/IBAN actually exists at the bank
  • โŒ Does NOT perform real-time VIES VAT lookups
  • โŒ Does NOT contact external APIs
  • โŒ Does NOT require an internet connection

๐Ÿš€ Features

๐Ÿ’ณ Banking & Cards

Fast, offline regex and checksum validation for European and International formats.

  • IBAN Validation:
    • Parsing & Validation: Extracts country code, check digits, bank code, branch code, and account number.
    • Country Specific Rules: Supports specific validation rules for 51 European countries and territories (Belgium, France, Germany, Italy, Spain, UK, Netherlands, etc.).
    • Generic Validation: Supports parsing and validating checksums for all ISO-compliant countries.
  • BBAN Validation (New in v1.4.0):
    • Dedicated Validators: Specific validators for 51 European countries (e.g., BelgiumBbanValidator, FranceBbanValidator).
    • Zero Allocation: High-performance static methods (Validate(string)) for critical paths.
    • Unified Interface: IBbanValidator for dependency injection scenarios.
  • Payment Cards:
    • Luhn Algorithm: Mod 10 validation for PAN numbers.
    • Brand Detection: Identifies Visa, Mastercard, Amex, Discover, JCB, Maestro, RuPay, Mir, Verve, Troy.
    • Secure CVV Check: Format-only validation (Safe for PCI-DSS).
  • BIC/SWIFT: Structural validation (ISO 9362) & Cross-check with IBAN country code.
  • Bank Routing Numbers: Validates legacy bank codes for major European countries:
    • Germany: Bankleitzahl (BLZ)
    • United Kingdom: Sort Code
    • France: Code Banque
    • Italy: ABI Code
    • Spain: Cรณdigo de Entidad

๐Ÿงพ Payment References

  • ISO 11649 (RF): Generates and validates international RF creditor references.
  • Local Formats:
    • Belgium: OGM/VCS (+++XXX/XXXX/XXXXX+++)
    • Finland: Viitenumero
    • Norway: KID
    • Sweden: OCR
    • Switzerland: QR Reference
    • Slovenia: SI12
    • Denmark: FIK / GIK
    • Italy: CBILL / PagoPA
    • Portugal: Multibanco

๐Ÿข Business Numbers

  • Tax IDs: Validates business registration numbers for 51 European countries (e.g., Belgian KBO, French SIREN, Italian P.IVA, etc.).
  • VAT Numbers: Validates formatting and check digits for European countries (EU + UK, Norway, Switzerland, etc.).

๏ฟฝ National Identity (New in v1.6.0)

  • Full European Coverage: Validates National ID / Citizen ID numbers for all 51 European countries and territories.
    • Western Europe: Belgium (NN), France (NIR), Germany (Steuer-ID), Netherlands (BSN), UK (NINO), etc.
    • Northern Europe: Sweden (Personnummer), Norway (Fรธdselsnummer), Denmark (CPR), Finland (HETU), Iceland (Kennitala).
    • Southern Europe: Italy (Codice Fiscale), Spain (DNI/NIE), Portugal (NIF), Greece (AMKA), Turkey (TC Kimlik).
    • Eastern Europe: Poland (PESEL), Romania (CNP), Ukraine (RNTRC), Bulgaria (EGN), etc.
    • Microstates: Andorra, Liechtenstein, Monaco, San Marino, Vatican.

๏ฟฝ๐ŸŒ Global Expansion (New in v1.4.0)

Finova now supports major economies across North America, South America, Asia, and Oceania.

Region Country Validators
North America ๐Ÿ‡บ๐Ÿ‡ธ USA Routing Number, EIN
๐Ÿ‡จ๐Ÿ‡ฆ Canada SIN, Business Number (BN), Routing Number
South America ๐Ÿ‡ง๐Ÿ‡ท Brazil CPF, CNPJ, Routing Number
๐Ÿ‡ฒ๐Ÿ‡ฝ Mexico CURP, RFC
Asia ๐Ÿ‡จ๐Ÿ‡ณ China RIC, USCC, CNAPS
๐Ÿ‡ฏ๐Ÿ‡ต Japan My Number, Corporate Number, Bank Account
๐Ÿ‡ฎ๐Ÿ‡ณ India Aadhaar, PAN, IFSC
๐Ÿ‡ธ๐Ÿ‡ฌ Singapore NRIC, UEN, Bank Account
Oceania ๐Ÿ‡ฆ๐Ÿ‡บ Australia TFN, ABN, BSB

New in v1.4.0: Full Parsing support (extracting metadata) is now available for:

  • Routing Numbers: USA (ABA), Canada (CC), Australia (BSB), India (IFSC), China (CNAPS), Brazil (COMPE).
  • Bank Accounts: Japan, Singapore.

<details> <summary><strong>View Full List of Supported Countries (51)</strong></summary>

Country Code IBAN VAT Tax ID Payment Ref
Albania AL โœ… โœ… โœ… -
Andorra AD โœ… โœ… โœ… -
Austria AT โœ… โœ… โœ… -
Azerbaijan AZ โœ… โœ… โœ… -
Belarus BY โœ… โœ… โœ… -
Belgium BE โœ… โœ… โœ… โœ…
Bosnia & Herzegovina BA โœ… โœ… โœ… -
Bulgaria BG โœ… โœ… โœ… -
Croatia HR โœ… โœ… โœ… -
Cyprus CY โœ… โœ… โœ… -
Czech Republic CZ โœ… โœ… โœ… -
Denmark DK โœ… โœ… โœ… โœ…
Estonia EE โœ… โœ… โœ… -
Faroe Islands FO โœ… โœ… โœ… -
Finland FI โœ… โœ… โœ… โœ…
France FR โœ… โœ… โœ… -
Georgia GE โœ… โœ… โœ… -
Germany DE โœ… โœ… โœ… -
Gibraltar GI โœ… โœ… โœ… -
Greece GR โœ… โœ… โœ… -
Greenland GL โœ… - โœ… -
Hungary HU โœ… โœ… โœ… -
Iceland IS โœ… โœ… โœ… -
Ireland IE โœ… โœ… โœ… -
Italy IT โœ… โœ… โœ… โœ…
Kosovo XK โœ… - โœ… -
Latvia LV โœ… โœ… โœ… -
Liechtenstein LI โœ… โœ… โœ… -
Lithuania LT โœ… โœ… โœ… -
Luxembourg LU โœ… โœ… โœ… -
Malta MT โœ… โœ… โœ… -
Moldova MD โœ… โœ… โœ… -
Monaco MC โœ… โœ… โœ… -
Montenegro ME โœ… โœ… โœ… -
Netherlands NL โœ… โœ… โœ… -
North Macedonia MK โœ… โœ… โœ… -
Norway NO โœ… โœ… โœ… โœ…
Poland PL โœ… โœ… โœ… -
Portugal PT โœ… โœ… โœ… โœ…
Romania RO โœ… โœ… โœ… -
San Marino SM โœ… โœ… โœ… -
Serbia RS โœ… โœ… โœ… -
Slovakia SK โœ… โœ… โœ… -
Slovenia SI โœ… โœ… โœ… โœ…
Spain ES โœ… โœ… โœ… -
Sweden SE โœ… โœ… โœ… โœ…
Switzerland CH โœ… โœ… โœ… โœ…
Turkey TR โœ… โœ… โœ… -
Ukraine UA โœ… โœ… โœ… -
United Kingdom GB โœ… โœ… โœ… -
Vatican City VA โœ… โœ… โœ… -

</details>

๐Ÿ”— FluentValidation Integration

  • Extensions: MustBeValidIban, MustBeValidBic, MustBeValidVat, MustBeValidPaymentReference, etc.
  • Seamless: Integrates directly into your existing AbstractValidator classes.

๏ฟฝ Dependency Injection & Global Services

Finova provides global composite services that automatically delegate validation to the correct country-specific logic.

// 1. Register Finova
services.AddFinova();

// 2. Inject Services
public class MyService(ITaxIdService taxIdService, IBankAccountService bankAccountService)
{
    public void Validate()
    {
        // Validates US EIN
        var result1 = taxIdService.Validate("US", "12-3456789");

        // Validates Singapore Bank Account
        var result2 = bankAccountService.Validate("SG", "1234567890");
    }
}

๏ฟฝ๐Ÿ“ฆ Installation

Install via the NuGet Package Manager:

dotnet add package Finova

Or via the Package Manager Console:

Install-Package Finova

๐Ÿ“– Quick Start

1. Validate an IBAN

using Finova.Services;

// Validates format, checksum, and country-specific rules
// (Does NOT check if account exists)
bool isValid = EuropeIbanValidator.ValidateIban("BE68539007547034").IsValid;

if (isValid)
{
    Console.WriteLine("IBAN structure is valid");
}

2. Validate a Payment Card

using Finova.Core.PaymentCard;

// Validates checksum (Luhn) and detects brand
var result = PaymentCardValidator.Validate("4532123456789012");

if (result.IsValid)
{
    Console.WriteLine($"Valid {result.Brand} Card"); // Output: Valid Visa Card
}

3. Generate a Payment Reference

using Finova.Generators;
using Finova.Core.PaymentReference;

var generator = new PaymentReferenceGenerator();

// Generate Belgian OGM (+++000/0012/34569+++)
string ogm = generator.Generate("123456", PaymentReferenceFormat.LocalBelgian);

// Generate ISO RF (RF89INVOICE2024)
string isoRef = generator.Generate("INVOICE2024", PaymentReferenceFormat.IsoRf);

4. Global Bank Validation (New in v1.4.0)

using Finova.Services;

// Validate US Routing Number (ABA)
var usResult = GlobalBankValidator.ValidateRoutingNumber("US", "121000248");
if (usResult.IsValid) Console.WriteLine("Valid US Routing Number");

// Validate Singapore Bank Account
var sgResult = GlobalBankValidator.ValidateBankAccount("SG", "1234567890");
if (sgResult.IsValid) Console.WriteLine("Valid Singapore Account");

5. FluentValidation Integration

using FluentValidation;
using Finova.Extensions.FluentValidation;

public class CustomerValidator : AbstractValidator<Customer>
{
    public CustomerValidator()
    {
        RuleFor(x => x.Iban).MustBeValidIban();
        RuleFor(x => x.VatNumber).MustBeValidVat();
        RuleFor(x => x.Bic).MustBeValidBic();

        // New in v1.4.0: Global Bank Validation
        RuleFor(x => x.RoutingNumber).MustBeValidBankRoutingNumber(x => x.CountryCode);
        RuleFor(x => x.AccountNumber).MustBeValidBankAccountNumber(x => x.CountryCode);
    }
}

Register Finova in your Program.cs:

using Finova.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Registers all validators (IBAN, VAT, TaxID, PaymentReference, etc.)
builder.Services.AddFinova();

var app = builder.Build();

Inject and use the validators in your services:

using Finova.Core.Vat;
using Finova.Services;

public class BusinessService
{
    private readonly IVatValidator _vatValidator;
    private readonly ITaxIdService _taxIdService;

    public BusinessService(IVatValidator vatValidator, ITaxIdService taxIdService)
    {
        _vatValidator = vatValidator;
        _taxIdService = taxIdService;
    }

    public void RegisterCompany(string countryCode, string vatNumber, string taxId)
    {
        // Validates VAT format and checksum for any EU country
        if (!_vatValidator.Validate(vatNumber).IsValid)
        {
            throw new Exception("Invalid VAT Number");
        }

        // Validates Tax ID (e.g., SIRET, KBO, EIN)
        if (!_taxIdService.Validate(countryCode, taxId).IsValid)
        {
            throw new Exception("Invalid Tax ID");
        }
    }
}
Option B: Static Usage (Simple)

You can also use the static helpers directly without DI:

using Finova.Services;

// 1. Validate VAT Number (Auto-detects country)
bool isVatValid = EuropeVatValidator.ValidateVat("FR12345678901").IsValid;

// 2. Validate Tax ID (Requires Country Code)
bool isTaxIdValid = GlobalIdentityValidator.ValidateTaxId("BE", "0123456789").IsValid;

5. Tax ID Validator Usage

Finova provides a unified validator for Global Tax IDs (including European Enterprise Numbers), supporting 51+ countries.

using Finova.Services;

// 1. Validate Tax ID
// Validates based on the country code provided (e.g., "DE", "FR", "US")
var result = GlobalIdentityValidator.ValidateTaxId("GB", "12345678");
if (result.IsValid)
{
    Console.WriteLine("Valid UK Tax ID");
}

// 2. Validate Non-European Tax IDs
// Supports global formats like US EIN, Brazil CNPJ, etc.
var usResult = GlobalIdentityValidator.ValidateTaxId("US", "12-3456789");

6. Advanced Usage (Custom Validators)

For advanced scenarios where you need to implement custom validation logic or use specific algorithms directly, you can use the ChecksumHelper class.

Note: This is intended for developers building custom extensions. For standard use cases, prefer the high-level validators.

using Finova.Core.Common;

// 1. Validate using Luhn Algorithm (Mod 10)
bool isLuhnValid = ChecksumHelper.ValidateLuhn("79927398713");

// 2. Validate using ISO 7064 Mod 97-10 (IBANs)
bool isMod97Valid = ChecksumHelper.ValidateModulo97("1234567890123456789012345678901");

// 3. Calculate Weighted Modulo 11
int[] weights = { 2, 3, 4, 5, 6, 7 };
int remainder = ChecksumHelper.CalculateWeightedModulo11("123456", weights);

๐Ÿ—บ๏ธ Roadmap

Finova is strictly offline. Future updates focus on schema compliance, developer experience, and mathematical validation.

Upcoming Releases

v1.4.0 - Global Expansion ๐ŸŒŽ
  • North America: Support for USA (Routing Numbers, EIN) and Canada (Business Numbers).
  • Asia: Support for major Asian economies (Japan, Singapore, etc.).
  • South America: Support for Brazil (CNPJ/CPF) and others.
  • Oceania: Support for Australia (TFN, ABN, BSB).
  • National IDs: Added support for UK (NINO), Sweden, Norway, Finland, Denmark.
  • Architecture: Introduction of Finova.Countries.NorthAmerica, Finova.Countries.Asia, etc.
  • Dependency Injection: Enhanced auto-registration via Assembly Scanning.
v1.5.0 - EPC QR Code Support ๐Ÿ“ฑ
  • EPC QR String Generation: Generate the raw payload string for European Payments Council (EPC) QR codes.
  • Zero-Dependency: Focus on string generation to maintain the "no external dependencies" rule (no image libraries required in core).

โœ… v1.0.0 โ€” Foundation (Released)

  • Belgian payment references (OGM/VCS)
  • ISO 11649 international references
  • Comprehensive testing and CI/CD

โœ… v1.1.0 โ€” Core Expansion (Released)

  • IBAN Expansion: Italy (IT) & Spain (ES) specific rules
  • BIC/SWIFT: Structural format validation (ISO 9362)
  • Payment Cards: Luhn Algorithm & Brand Detection (Visa/MC/Amex)
  • Reference Validator: RF Creditor Reference (ISO 11649)

โœ… v1.2.0 โ€” European Unification (Released)

  • Finova.Europe: Unified wrapper package for all SEPA countries
  • Smart Routing: Auto-detect country rules via EuropeValidator
  • Extensions: FluentValidation integration package (Finova.Extensions.FluentValidation)

โœ… v1.3.0 โ€” Corporate Identity (Released)

  • VAT Numbers: EU VAT checksums (VIES offline syntax)
  • Tax IDs: French SIRET/SIREN, Belgian KBO/BCE

๐Ÿ”ฎ v1.4.0 โ€” National Identifiers (Planned)

  • National IDs: Netherlands KVK, Spain NIF/CIF
  • Modern Payment Strings: EPC QR Code payload builder, Swiss QR parsing
  • USA: ABA routing number checksums
  • Canada: Transit number validation
  • Australia: BSB number validation

๐Ÿ”ฎ v1.5.0 โ€” Global Routing (Future)

  • EPC QR String Generation: Generate the raw payload string for European Payments Council (EPC) QR codes.
  • Zero-Dependency: Focus on string generation to maintain the "no external dependencies" rule (no image libraries required in core).

๐Ÿ”ญ Horizon (Undetermined)

  • AI-assisted anomaly detection

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

๐Ÿ“„ License

This project is licensed under the MIT License.


Made with โค๏ธ for the .NET Community

GitHub โ€ข Issues

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.18 92 2/10/2026
1.4.17 90 2/9/2026
1.4.16 92 2/9/2026
1.4.15 95 2/8/2026
1.4.14 95 2/8/2026
1.4.13 101 2/7/2026
1.4.12 101 2/7/2026
1.4.11 108 1/22/2026
1.4.10 95 1/22/2026
1.4.9 95 1/22/2026
1.4.8 96 1/15/2026
1.4.7 99 1/15/2026
1.4.6 100 1/12/2026
1.4.5 97 1/11/2026
1.4.4 100 1/8/2026
1.4.3 104 1/8/2026
1.4.2 103 1/6/2026
1.4.1 99 1/3/2026
1.4.0 102 1/2/2026
1.4.0-alpha.1 229 12/18/2025
Loading failed