VatIdCheckStatus
in package
FinalYes
UI state of a VAT id verification answer (`api/system/vat-id-check/verify`) — one mapping for the Front profile and the admin badges / flash messages. Pure: works on the bridge array, no I/O.
States (translation keys vatIdCheck.status.<state> in the caller's domain):
verified/verifiedManual— the stored or fresh check verifies the VAT id,invalid— VIES (or an admin) says the VAT id is not valid,unavailable— VIES did not answer (or the bridge failed) and nothing valid is stored,limitReached— the online quota is exhausted, nothing valid is stored,notVerified— no check yet.
Table of Contents
Constants
- INVALID : string = 'invalid'
- LIMIT_REACHED : string = 'limitReached'
- NOT_VERIFIED : string = 'notVerified'
- UNAVAILABLE : string = 'unavailable'
- VERIFIED : string = 'verified'
- VERIFIED_MANUAL : string = 'verifiedManual'
Methods
- afterSave() : string|null
- Message after a save with an automatic check: null = nothing to say (a domestic / non-EU VAT id is not checked automatically). Anything that is neither verified nor invalid reads as "VIES unavailable, we will try at the order".
- fromVerification() : string
- variant() : string
- Flash / notice variant of a state (`success` only for a verified VAT id).
Constants
INVALID
public
string
INVALID
= 'invalid'
LIMIT_REACHED
public
string
LIMIT_REACHED
= 'limitReached'
NOT_VERIFIED
public
string
NOT_VERIFIED
= 'notVerified'
UNAVAILABLE
public
string
UNAVAILABLE
= 'unavailable'
VERIFIED
public
string
VERIFIED
= 'verified'
VERIFIED_MANUAL
public
string
VERIFIED_MANUAL
= 'verifiedManual'
Methods
afterSave()
Message after a save with an automatic check: null = nothing to say (a domestic / non-EU VAT id is not checked automatically). Anything that is neither verified nor invalid reads as "VIES unavailable, we will try at the order".
public
static afterSave(array<string, mixed> $verification) : string|null
Parameters
- $verification : array<string, mixed>
Return values
string|nullfromVerification()
public
static fromVerification(array<string, mixed> $verification) : string
Parameters
- $verification : array<string, mixed>
-
bridge answer; empty = bridge failure
Return values
stringvariant()
Flash / notice variant of a state (`success` only for a verified VAT id).
public
static variant(string $status) : string
Parameters
- $status : string