Download the PHP package rocketfellows/vies-vat-validation-php-sdk-interface without Composer

On this page you can find all versions of the php package rocketfellows/vies-vat-validation-php-sdk-interface. 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 vies-vat-validation-php-sdk-interface

VIES VAT number validation php sdk interface

PHPStan Badge

The package provides VIES VAT number validation php sdk interface.

PHP sdk interface for VIES service for checking the validity of the VAT number. Services that implement this interface are must be designed to send a request and process a response from the VAT validation service, depending on the API (REST/SOAP etc.).

Implementations of this interface are provided in the rocketfellows repositories (either already or in the future).

For more information about VIES VAT number validation services see https://ec.europa.eu/taxation_customs/vies/#/technical-information.

Installation.

Interface description.

Interface contract.


Interface exceptions.


InvalidInputServiceException - exception for api error code INVALID_INPUT.
Description: the provided CountryCode is invalid or the VAT number is empty.

ServiceUnavailableException - exception for api error code SERVICE_UNAVAILABLE.
Description: an error was encountered either at the network level or the Web application level, try again later.

MSUnavailableServiceException - exception for api error code MS_UNAVAILABLE.
Description: the application at the Member State is not replying or not available. Please refer to the Technical Information page to check the status of the requested Member State, try again later.

TimeoutServiceException - exception for api error code TIMEOUT.
Description: the application did not receive a reply within the allocated time period, try again later.

InvalidRequesterInfoServiceException - exception for api error code INVALID_REQUESTER_INFO.

VatBlockedServiceException - exception for api error code VAT_BLOCKED.

IPBlockedServiceException - exception for api error code IP_BLOCKED.

GlobalMaxConcurrentReqServiceException - exception for api error code GLOBAL_MAX_CONCURRENT_REQ.
Description: your Request for VAT validation has not been processed; the maximum number of concurrent requests has been reached. Please re-submit your request later or contact [email protected] for further information": Your request cannot be processed due to high traffic on the web application. Please try again later.

GlobalMaxConcurrentReqTimeServiceException - exception for api error code GLOBAL_MAX_CONCURRENT_REQ_TIME.

MSMaxConcurrentReqServiceException - exception for api error code MS_MAX_CONCURRENT_REQ.
Description: your Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached. Please re-submit your request later or contact [email protected] for further information": Your request cannot be processed due to high traffic towards the Member State you are trying to reach. Please try again later.

MSMaxConcurrentReqTimeServiceException - exception for api error code MS_MAX_CONCURRENT_REQ_TIME.

UnknownServiceErrorException - exception thrown if it was not possible to understand what error code service returned.

ServiceRequestException - exception thrown if it was not possible to send a request to service (other errors).

CountryCodeAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult country code attribute not found.

RequestDateAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult request date attribute not found.

ValidationFlagAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult validation flag attribute not found.

VatNumberAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult vat number attribute not found.

VatOwnerAddressAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult vat owner address attribute not found.

VatOwnerNameAttributeNotFoundException - exception thrown if while creating instance of VatNumberValidationResult vat owner name attribute not found.

Input arguments and return value.


VatNumber type description (validated VAT):

VatNumberValidationResult type description (validation result):

Interface implementations.

Implementations of this interface are provided in the rocketfellows repositories (either already or in the future).

So far, VIES provides two services for validating the VAT number:

Vat number validation result factory.

rocketfellows\ViesVatValidationInterface\VatNumberValidationResultFactory - a factory designed to create an instance of rocketfellows\ViesVatValidationInterface\VatNumberValidationResult from given raw data with required attributes existence check.

Factory functions:

Functions throw next exceptions:

Usage examples.

Creating VatNumberValidationResult from stdClass object raw data, where attribute names in raw data in camel case:

Creating VatNumberValidationResult from stdClass object raw data, where attribute names in raw data in snake case:

Creating VatNumberValidationResult from array raw data, where attribute names in raw data in camel case:

Creating VatNumberValidationResult from array raw data, where attribute names in raw data in snake case:

Fault code exception factory.

rocketfellows\ViesVatValidationInterface\FaultCodeExceptionFactory - a factory designed to create exceptions based on an error code that the VAT number validation service can return. Error code detection is case insensitive.

Input arguments:

Creating exceptions, based on error code mapping:

InvalidInputServiceException - exception for api error code INVALID_INPUT.
Description: the provided CountryCode is invalid or the VAT number is empty.

ServiceUnavailableException - exception for api error code SERVICE_UNAVAILABLE.
Description: an error was encountered either at the network level or the Web application level, try again later.

MSUnavailableServiceException - exception for api error code MS_UNAVAILABLE.
Description: the application at the Member State is not replying or not available. Please refer to the Technical Information page to check the status of the requested Member State, try again later.

TimeoutServiceException - exception for api error code TIMEOUT.
Description: the application did not receive a reply within the allocated time period, try again later.

InvalidRequesterInfoServiceException - exception for api error code INVALID_REQUESTER_INFO.

VatBlockedServiceException - exception for api error code VAT_BLOCKED.

IPBlockedServiceException - exception for api error code IP_BLOCKED.

GlobalMaxConcurrentReqServiceException - exception for api error code GLOBAL_MAX_CONCURRENT_REQ.
Description: your Request for VAT validation has not been processed; the maximum number of concurrent requests has been reached. Please re-submit your request later or contact [email protected] for further information": Your request cannot be processed due to high traffic on the web application. Please try again later.

GlobalMaxConcurrentReqTimeServiceException - exception for api error code GLOBAL_MAX_CONCURRENT_REQ_TIME.

MSMaxConcurrentReqServiceException - exception for api error code MS_MAX_CONCURRENT_REQ.
Description: your Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached. Please re-submit your request later or contact [email protected] for further information": Your request cannot be processed due to high traffic towards the Member State you are trying to reach. Please try again later.

MSMaxConcurrentReqTimeServiceException - exception for api error code MS_MAX_CONCURRENT_REQ_TIME.

UnknownServiceErrorException - exception thrown if it was not possible to understand what error code service returned.

Usage examples

Error code in upper case:

Error code in lower upper case:

Contributing.

Welcome to pull requests. If there is a major changes, first please open an issue for discussion.

Please make sure to update tests as appropriate.


All versions of vies-vat-validation-php-sdk-interface with dependencies

PHP Build Version
Package Version
Requires php 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 rocketfellows/vies-vat-validation-php-sdk-interface contains the following files

Loading the files please wait ....