VatNumberValidator
in package
implements
VatNumberValidatorInterface
Class VatNumberValidator
This class provides methods for validating VAT numbers
Tags
Interfaces, Classes and Traits
- VatNumberValidatorInterface
- Interface VatNumberValidatorInterface
Table of Contents
- $vatValidation : vat_validation_ORIGIN
- VAT validation.
- __construct() : mixed
- Initialize the VAT number validator.
- getCustomerStatusId() : int
- Returns the customer status ID.
- getErrorStatus() : bool
- Returns the error status
- getVatNumberStatusCodeId() : int
- Returns the VAT number status code ID.
- _putValidationCache() : mixed
- Writes the validation results to cache.
Properties
$vatValidation
VAT validation.
protected
vat_validation_ORIGIN
$vatValidation
Methods
__construct()
Initialize the VAT number validator.
public
__construct([vat_validation_ORIGIN $vatValidation = null ]) : mixed
Parameters
- $vatValidation : vat_validation_ORIGIN = null
-
VAT validation.
Return values
mixed —getCustomerStatusId()
Returns the customer status ID.
public
getCustomerStatusId(string $p_vatNumber, int $p_countryId, bool $p_isGuest) : int
Parameters
- $p_vatNumber : string
-
VAT number.
- $p_countryId : int
-
Country ID.
- $p_isGuest : bool
-
Is customer a guest?
Return values
int —Customer status ID.
getErrorStatus()
Returns the error status
public
getErrorStatus(string $p_vatNumber, int $p_countryId, bool $p_isGuest) : bool
Parameters
- $p_vatNumber : string
-
VAT number.
- $p_countryId : int
-
Country ID.
- $p_isGuest : bool
-
Is customer a guest?
Return values
bool —Error status.
getVatNumberStatusCodeId()
Returns the VAT number status code ID.
public
getVatNumberStatusCodeId(string $p_vatNumber, int $p_countryId, bool $p_isGuest) : int
Parameters
- $p_vatNumber : string
-
VAT number.
- $p_countryId : int
-
Country ID.
- $p_isGuest : bool
-
Is customer a guest?
Return values
int —VAT number status code ID.
_putValidationCache()
Writes the validation results to cache.
protected
_putValidationCache(string $p_vatNumber, int $p_countryId, bool $p_isGuest) : mixed
Parameters
- $p_vatNumber : string
-
VAT number.
- $p_countryId : int
-
Country ID.
- $p_isGuest : bool
-
Is customer a guest?
TODO Write validation results to cache.