Skip to content
Last updated

WHMCS\Billing\VAT\VatNumber

Class

Methods

factoryFromIdentifier

public static function factoryFromIdentifier(string $identifier): self

Parameters

TypeNameDescription
string$identifier

Returns static

factoryFromInput

public static function factoryFromInput(string $input): self

Create new instance, normalizing input prior to instantiation

Parameters

TypeNameDescription
string$input

Returns static

getIdentifier

public function getIdentifier(): string

Full string representation of a VAT number

Returns string

getPrefix

public function getPrefix(): string

(country) prefix related to the VAT number.

WHMCS has a legacy that UK VAT number may or may not have the GB prefix.

Returns string

getNumber

public function getNumber(): string

The number portion of the VAT number (ie, sans any prefix). Note while by convention this is named a number, there may be alpha characters present.

Returns string

isUK

public function isUK(): bool

Should the VAT number be treated as belonging to a UK business entity

Returns bool

isEU

public function isEU(): bool

Should the VAT number be treated as belonging to a country in the EEA

Returns bool

isValid

public function isValid(): bool