A little PHP helper to check VAT numbers by an european service called VIES (VAT Information Exchange System).
PHP 7 or above and Composer is expected to be installed on our system.
composer require csoellinger/eu-check-vat-service
<?php
use EuCheckVatService\CheckVat;
// Full check (Return name and address if registered)
print_r((new CheckVat())->exec('AT', 'U65923833', true));
// Simple Check (Return only true or false)
var_dump((new CheckVat())->exec('AT', 'U65923833'));
See inside public dir for an example.
All tests can be run by executing
vendor/bin/phpunit
phpunit
will automatically find all tests inside the tests
directory and run them based on the configuration in the phpunit.xml
file.
PHP has an in-built server for local development. To run this change into the directory public
and run
php -S localhost:8000
Then open your browser at http://localhost:8000/example.php
This project is licensed under the MIT License - see the LICENCE.md file for details.