csoellinger/eu-check-vat-service

Helper to check eu-vat.

1.0.0 2019-12-03 14:57 UTC

This package is auto-updated.

Last update: 2024-10-27 15:19:57 UTC


README

A little PHP helper to check VAT numbers by an european service called VIES (VAT Information Exchange System).

Getting Started

PHP 7 or above and Composer is expected to be installed on our system.

Installing

composer require csoellinger/eu-check-vat-service

Usage

<?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'));

Example

See inside public dir for an example.

Running the Tests

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.

Running the Example

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

Built With

License

This project is licensed under the MIT License - see the LICENCE.md file for details.