anghelvalentin / countryvalidator Goto Github PK
View Code? Open in Web Editor NEWC# Validations for Social Security Numbers, VAT Codes and tax identification numbers
Home Page: https://randommer.io/SocialNumber/VatValidator
C# Validations for Social Security Numbers, VAT Codes and tax identification numbers
Home Page: https://randommer.io/SocialNumber/VatValidator
Hi,
I wonder if "National Identification Number Name" for Norway is implemented?
There is code for it in the repository?
The first companies in Belgium have a company number / VAT Number that starts with BE1xxxxxxxxx instead of just with a BE0xxxxxxxxx.
Could you modify this so that these are validated correctly ?
Much appreciated !!
Official Belgium website mentioning this : https://economie.fgov.be/en/news/enterprise-numbers-starting-1
Is this still actively maintained or should it be considered archived?
Hi,
For several cases, SSN number in Belgium failed to validate correctly. Indeed, in BelgiumValidation class, line 50 :
bool isValid = ModFunction(nrToCheck).ToString() == checkDigit;
At that time, if checkDigit has a number below 10, it fails. It seems that int type doesn't keep the 0 in the beginning of a number.
For exemple :
checkDigit returns '09' and ModFunction returns '9'.
You can try with this SSN : 96091736909
Thanks for your time !
Hi,
I am not really sure about this, but aparrently the Netherlands has changed the format of their VAT numbers. The number NL000099998B57 (example taken from this webpage of the Dutch goverment) does not validate.
It does not allow me to validate the Swiss tva, the error is:
"input string was not in a correct format".
My code:
When I enter the same data in the demo validator it works, where can I check the format of the string I have to pass to the "CountryValidator" method?
https://randommer.io/SocialNumber/VatValidator
Doc format:
CHE-xxx.xxx.xxx TVA
There are new separator characters being introduced in addition to -
, +
and A
.
More information and test data available here: https://dvv.fi/en/reform-of-personal-identity-code
I'm interested in contributing VAT validation code of China. Is this project still in maintainence?
HI.
Israel ID allows digits only, but your logic considers the following value "AA1404105" as valid.
I suggest adding
public override ValidationResult ValidateIndividualTaxCode(string ssn)
{
ssn = ssn.RemoveSpecialCharacthers();
if (ssn?.Length != 9)
{
return ValidationResult.Invalid("Invalid length. The code must have 9 digits");
}
**if (!ssn.All(char.IsDigit))
{
return ValidationResult.Invalid("Only digits are allowed");
}**
foreach (var supportedCountry in CountryValidation.CountryValidator.SupportedCountries)
{
var countryEnum = Enum.Parse<CountryValidation.Country>(supportedCountry);
var result = validator.ValidateVAT("K7399859412", countryEnum);
if (result.IsValid)
{
return true;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.