firmaprofesional / tin-validator-bridge
European TIN validator service bridge
Installs: 16 190
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: >=5.5.9
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ~4.6
This package is auto-updated.
Last update: 2025-03-01 00:18:13 UTC
README
This library provides an static bridge to European TIN check WSDL
If you have questions or problems with installation or usage create an Issue.
Installation
In order to install this library via composer run the following command in the console:
composer require firmaprofesional/tin-validator-bridge
or add the package manually to your composer.json file in the require section:
"firmaprofesional/tin-validator-bridge": ">0.1"
Usage examples
Simple checkTin will return an array
$result = EuropeanTinValidatorService::checkTin('99999999R', 'ES'); var_dump($result);
Will return
array(5) { 'countryCode' => string(2) "ES" 'tinNumber' => string(9) "99999999R" 'requestDate' => string(16) "2018-05-24+02:00" 'validStructure' => bool(true) 'validSyntax' => bool(true) }
Check isValidTin will return a bool
$result = EuropeanTinValidatorService::isValidTin('99999999R', 'ES'); var_dump($result);
Will return
true
Testing
In order to test the library:
- Create a fork
- Clone the fork to your machine
- Install the depencies
composer install
- Run the unit tests
./vendor/phpunit/bin/phpunit -c phpunit.xml --testsuite general