PHP Класс 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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
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

Описание методов

filterVat() публичный статический Метод

Filters a VAT number and normalizes it to an alfanumeric string
public static filterVat ( string $vatNumber ) : string
$vatNumber string
Результат string

getHeartBeat() публичный Метод

Retrieves the heartbeat class that offers the option to check if the VIES service is up-and-running.
public getHeartBeat ( ) : HeartBeat
Результат HeartBeat

getOptions() публичный Метод

Retrieves the options for the PHP SOAP service
public getOptions ( ) : array
Результат array

getSoapClient() публичный Метод

Retrieves the SOAP client that will be used to communicate with the VIES SOAP service.
public getSoapClient ( ) : SoapClient
Результат SoapClient

getWsdl() публичный Метод

Retrieves the location of the WSDL for the VIES SOAP service
public getWsdl ( ) : string
Результат string

listEuropeanCountries() публичный статический Метод

A list of European Union countries as of January 2015
public static listEuropeanCountries ( ) : array
Результат array

setHeartBeat() публичный Метод

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() публичный Метод

Set options for the native PHP Soap Client
public setOptions ( array $options ) : Vies
$options array
Результат Vies

setSoapClient() публичный Метод

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
Результат Vies

setWsdl() публичный Метод

Sets the location of the WSDL for the VIES SOAP Service
public setWsdl ( string $wsdl ) : Vies
$wsdl string
Результат Vies

validateVat() публичный Метод

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
Результат CheckVatResponse

validateVatSum() публичный Метод

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
Результат boolean

Описание свойств

$heartBeat защищенное свойство

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

$options защищенное свойство

Options for the SOAP client
protected $options

$soapClient защищенное свойство

protected SoapClient $soapClient
Результат SoapClient

$wsdl защищенное свойство

The WSDL for VIES service
protected $wsdl