PHP Class DragonBe\Vies\Vies

This class provides a soap client for usage of the VIES web service provided by the European Commission to validate VAT numbers of companies registered within the European Union
Afficher le fichier Open project: dragonbe/vies Class Usage Examples

Protected Properties

Свойство Type Description
$heartBeat A heartbeat checker to verify if the VIES service is available
$options Options for the SOAP client
$soapClient SoapClient
$wsdl The WSDL for VIES service

Méthodes publiques

Méthode Description
filterVat ( string $vatNumber ) : string Filters a VAT number and normalizes it to an alfanumeric string
getHeartBeat ( ) : HeartBeat Retrieves the heartbeat class that offers the option to check if the VIES service is up-and-running.
getOptions ( ) : array Retrieves the options for the PHP SOAP service
getSoapClient ( ) : SoapClient Retrieves the SOAP client that will be used to communicate with the VIES SOAP service.
getWsdl ( ) : string Retrieves the location of the WSDL for the VIES SOAP service
listEuropeanCountries ( ) : array A list of European Union countries as of January 2015
setHeartBeat ( HeartBeat $heartBeat ) Sets the heartbeat functionality to verify if the VIES service is alive or not, especially since this service tends to have a bad reputation of its availability.
setOptions ( array $options ) : Vies Set options for the native PHP Soap Client
setSoapClient ( SoapClient $soapClient ) : Vies Sets the PHP SOAP Client and allows you to override the use of the native PHP SoapClient for testing purposes or for better integration in your own application.
setWsdl ( string $wsdl ) : Vies Sets the location of the WSDL for the VIES SOAP Service
validateVat ( string $countryCode, string $vatNumber, string $requesterCountryCode = null, string $requesterVatNumber = null ) : CheckVatResponse Validates a given country code and VAT number and returns a \DragonBe\Vies\CheckVatResponse object
validateVatSum ( string $countryCode, string $vatNumber ) : boolean Validate a VAT number control sum

Method Details

filterVat() public static méthode

Filters a VAT number and normalizes it to an alfanumeric string
public static filterVat ( string $vatNumber ) : string
$vatNumber string
Résultat string

getHeartBeat() public méthode

Retrieves the heartbeat class that offers the option to check if the VIES service is up-and-running.
public getHeartBeat ( ) : HeartBeat
Résultat HeartBeat

getOptions() public méthode

Retrieves the options for the PHP SOAP service
public getOptions ( ) : array
Résultat array

getSoapClient() public méthode

Retrieves the SOAP client that will be used to communicate with the VIES SOAP service.
public getSoapClient ( ) : SoapClient
Résultat SoapClient

getWsdl() public méthode

Retrieves the location of the WSDL for the VIES SOAP service
public getWsdl ( ) : string
Résultat string

listEuropeanCountries() public static méthode

A list of European Union countries as of January 2015
public static listEuropeanCountries ( ) : array
Résultat array

setHeartBeat() public méthode

Sets the heartbeat functionality to verify if the VIES service is alive or not, especially since this service tends to have a bad reputation of its availability.
public setHeartBeat ( HeartBeat $heartBeat )
$heartBeat HeartBeat

setOptions() public méthode

Set options for the native PHP Soap Client
public setOptions ( array $options ) : Vies
$options array
Résultat Vies

setSoapClient() public méthode

Sets the PHP SOAP Client and allows you to override the use of the native PHP SoapClient for testing purposes or for better integration in your own application.
public setSoapClient ( SoapClient $soapClient ) : Vies
$soapClient SoapClient
Résultat Vies

setWsdl() public méthode

Sets the location of the WSDL for the VIES SOAP Service
public setWsdl ( string $wsdl ) : Vies
$wsdl string
Résultat Vies

validateVat() public méthode

Validates a given country code and VAT number and returns a \DragonBe\Vies\CheckVatResponse object
public validateVat ( string $countryCode, string $vatNumber, string $requesterCountryCode = null, string $requesterVatNumber = null ) : CheckVatResponse
$countryCode string The two-character country code of a European member country
$vatNumber string The VAT number (without the country identification) of a registered company
$requesterCountryCode string The two-character country code of a European member country
$requesterVatNumber string The VAT number (without the country identification) of a registered company
Résultat CheckVatResponse

validateVatSum() public méthode

Validate a VAT number control sum
public validateVatSum ( string $countryCode, string $vatNumber ) : boolean
$countryCode string The two-character country code of a European member country
$vatNumber string The VAT number (without the country identification) of a registered company
Résultat boolean

Property Details

$heartBeat protected_oe property

A heartbeat checker to verify if the VIES service is available
protected $heartBeat

$options protected_oe property

Options for the SOAP client
protected $options

$soapClient protected_oe property

protected SoapClient $soapClient
Résultat SoapClient

$wsdl protected_oe property

The WSDL for VIES service
protected $wsdl