Download the PHP package wdo/vatidverify without Composer

On this page you can find all versions of the php package wdo/vatidverify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vatidverify

VatIdVerify

Component using the European Commission (EC) VAT Information Exchange System (VIES) and XML RPC API (EVatR) provided by German Federal Central Tax Office (GFCTO) to verify and validate VAT registration numbers in the EU, using PHP.

More information on EVatR API at the GFCTO website (german version) and on VIES APIs at the EC website.

Requirements

Installation

The library can be installed with Composer by adding it as a dependency to your composer.json file.

Via the command line run: composer require wdo/vatidverify

Here is a minimal example of a composer.json file after installation:

Usage

To use the vat validation create the VatValidate instance with appropriate provider, default is at the VIES SOAP provider. Call the constants from VatValidate to use any other provider like in the example:

Following methods are provided for the instance:

Providers

VIES SOAP and VIES REST

VIES SOAP and VIES REST are very similar in regard of the required values and request behaviour. Both of them do not require requester vat id to validate.

The two VIES providers may also not be available in some countries on certain times of day. For example, among them is germany not available around 11 pm till 1:30 am daily. More details for it here. It is also possible that qualified validation may not be available for some countries. Germany is among those countries. Some countries require company type for the qualified validation. You can look what can be added here: https://ec.europa.eu/taxation_customs/vies/#/faq#Q25.

For testing purposes you can use test service with predetermined vat ids and address (details on the VIES website). For that you need to deactivate the pre-check of the vat id. Example:

VIES SOAP is a default provider that is build on top of DragonBe VIES library (see dependencies) and has its own pre-check of vat id per country. That means skipping the pre-check is not possible for this provider.

By default, VIES REST uses a pre-check of the vat id from CountryCheck helper class.

Unlike SOAP provider, this one can also get the availability of the service and the countries. Over the main class VatValidate you can do that with getViesCountryAvailability() or call directly the function:

EVatR

EVatR has no testing service and must always use real data. Normally the service is always available for both simple and qualified validation. Though there might be maintenance between 11 pm and 5 am. According to GFCTO some requests might take between seconds and minutes, depending on the country request is sent to.

For both validations requester vat id is a mandatory field to be set. For qualified validation postal code and street are optional field values.

Response

The common response object for all providers is a response type of qualified validation and optionally can be a response type of simple validation. Raw response can be retrieved from this. Unfortunately for VIES SOAP it would NOT be raw data but only return JSON string from a modified array.

Dependencies

VIES SOAP and partially REST request are using vies library by DragonBe. For VIES REST request guzzle is needed. For using EVatR part of this library phpxmlrpc is required.


All versions of vatidverify with dependencies

PHP Build Version
Package Version
Requires php Version 8.*
dragonbe/vies Version ^2
ext-soap Version *
phpxmlrpc/phpxmlrpc Version ^4.10
ext-simplexml Version *
guzzlehttp/guzzle Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wdo/vatidverify contains the following files

Loading the files please wait ....