Download the PHP package dannyvankooten/vat.php without Composer
On this page you can find all versions of the php package dannyvankooten/vat.php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dannyvankooten/vat.php
More information about dannyvankooten/vat.php
Files in dannyvankooten/vat.php
Package vat.php
Short Description PHP library for dealing with VAT in Europe
License
Informations about the package vat.php
ibericode/vat
This is a simple PHP library to help you deal with Europe's VAT rules.
- Fetch VAT rates for any EU member state using ibericode/vat-rates.
- Validate VAT numbers (by format and/or existence)
- Validate ISO-3316 alpha-2 country codes
- Determine whether a country is part of the EU
- Geo-locate IP addresses
Installation
PHP version 8.2 or higher with the CURL and JSON extension is required.
For VAT number existence checking, the PHP SOAP extension is required as well.
To get the latest stable version, install the package using Composer:
Usage
This library exposes 4 main classes to interact with: Rates
, Countries
, Validator
and Geolocator
.
Retrieving VAT rates.
This package relies on a community maintained repository of vat rates. We invite you to toggle notifications for that repository and contribute changes to VAT rates in your country once they are announced.
This fetches rate from ibericode/vat-rates and stores a local copy that is periodically refreshed (once every 12 hours by default).
Validation
Validating a VAT number:
Validating an IP address:
Validating an ISO-3166-1-alpha2 country code:
Dealing with ISO-3166-1-alpha2 country codes
Geo-location
This library includes a simple geo-location service using ip2c.org or ip2country.info (deprecated as of Dec 2022).
To use ip2c.org explicitly.
Symfony support
If you need to use this package in a Symfony environment, check out ibericode/vat-bundle.
License
ibericode/vat is licensed under the MIT License.