evertharmeling / vat-client
Client library for the VIES/EU web service.
Installs: 7 625
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ^7.1 || ^8
- guzzlehttp/psr7: ^1.3
- php-http/httplug: ^2.0
Requires (Dev)
- php-http/mock-client: ^1.3.0
- phpunit/phpunit: ^7.5 || ^8.2 || ^9.5
- symfony/var-dumper: ^4.3
Suggests
- php-http/guzzle6-adapter: An HTTPlug adapter for the Guzzle 6 HTTP client
This package is auto-updated.
Last update: 2024-12-17 15:24:24 UTC
README
This libray supports validating a vat number and getting the info about a taxable object. The library uses the http://www.controleerbtwnummer.nl/
API to retrieve the info and validation.
The http://www.controleerbtwnummer.nl/
API relies on the VIES/EU service and thus supports VAT numbers from all EU-countries.
Installation
composer require evertharmeling/vat-client
Usage
It's required to use a PSR-7 supported HTTPClient like guzzle
(^6.0) to inject in the Client
.
$client = new VIESApi\Client\Client(new GuzzleHttp\Client(), VIESApi\Parser\VATParser()); try { $taxableObject = $client->getInfo('<VATNumber>'); var_dump($taxableObject); catch (TaxableObjectNotFoundException $e) { // VAT number not found }
Roadmap
- Formatter, add formatter who according to the regexes defined in the validator, formats the VAT number