Coder Social home page Coder Social logo

tin's Introduction

Taxpayer Identification Number (TIN) Validator

Build Status Scrutinizer Code Quality Code Coverage Build Status codecov.io

Latest Stable Version Latest Unstable Version Total Downloads License Monthly Downloads Daily Downloads

Dependency Status Reference Status

You may want to use https://github.com/loophp/tin instead.

A library to validate TIN numbers for individuals. This is based on a java library, this is why the code does not reflect best practices in php.

Supported countries are:

  • Austria (AT)
  • Belgium (BE)
  • Bulgaria (BG)
  • Croatia (HR)
  • Cyprus (CY)
  • Czech Republic (CZ) - no check digit (but possible czechphp/national-identification-number-validator)
  • Denmark (DK)
  • Estonia (EE)
  • Finland (FI)
  • France (FR)
  • Germany (DE)
  • Greece (GR) - only size
  • Hungary (HU)
  • Ireland (IE)
  • Italy (IT)
  • Latvia (LV) - no check digit
  • Lithuania (LT)
  • Luxembourg (LU)
  • Malta (MT) - no check digit
  • Netherlands (NL)
  • Poland (PL)
  • Portugal (PT)
  • Romania (RO) - no check digit
  • Slovakia (SK) - only structure
  • Slovenia (SI)
  • Spain (ES)
  • Sweden (SE)
  • United Kingdom (UK) - only structure

If your country is not there, feel free to open an issue with your country code and a link to the specification. Ideally, if you can provide a PR with the algorithm and the test that would be even better :-)

Installation

Run

$ composer require lekoala/tin

Usage

To simply check the validity of a number

$result = TINValid::checkTIN($countryCode, $number);

If you want to get the reason why a number is invalid, you can use

try {
    TINValid::validateTIN($countryCode, $number);
}
catch(TINValidationException $e) {
    
}

If you want to see if a country is supported or not, you can simply use

$result = TINValid::isCountrySupported('be');

Links

TIN Algorithms - Public - Functional Specification

Taxpayer Identification Number

License

This package is licensed using the MIT License. Please have a look at LICENSE.md.

tin's People

Contributors

lekoala avatar ordago avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.