th3mouk / vatlayer
PHP wrapper of vatlayer.com
Installs: 1 402
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
- ext-json: *
- fig/http-message-util: ^1.1
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0
- webmozart/assert: ^1.9.1
Requires (Dev)
- ergebnis/composer-normalize: ^2.11
- nyholm/psr7: ^1.3
- pepakriz/phpstan-exception-rules: ^0.11.2
- pestphp/pest: ^v0.3.16
- php-http/mock-client: ^1.0
- phpstan/extension-installer: ^1.1.0
- phpstan/phpstan: ^0.12.64
- phpstan/phpstan-webmozart-assert: ^0.12.8
- phpunit/phpunit: ^9.5.0
- symplify/phpstan-rules: ^8.3.48
- vimeo/psalm: ^4.3.1
- youdot/coding-standard: ^3.1
README
This PHP library is a wrapper of vatlayer.com respecting PSR18/PSR17/PSR7.
Installation
composer require th3mouk/vatlayer
Usage
use Th3Mouk\VatLayer\Psr18Wrapper; // Client respecting PSR18 // @see https://packagist.org/providers/psr/http-client-implementation $http_client = WhateverYouWant(); // Request factory respecting PSR17 // @see https://packagist.org/providers/psr/http-factory-implementation $request_factory = WhateverYouWantToo(); // Or automatically take an http client with // composer require php-http/discovery $http_client = Psr18ClientDiscovery::find(); $request_factory = Psr17FactoryDiscovery::findRequestFactory(); $wrapper = new Psr18Wrapper('access_key', $http_client, $request_factory); $response = $wrapper->validate('vat_number');
Endpoints coverage
- VAT Number Validation
- Get VAT Rates via Country Code
- Get VAT Rates via IP Address
- Get VAT Rates via Client IP
- Retrieve all EU VAT Rates
- VAT Compliant Price Calculation