CoolCMS API

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

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|null

fromVerification()

public static fromVerification(array<string, mixed> $verification) : string
Parameters
$verification : array<string, mixed>

bridge answer; empty = bridge failure

Return values
string

variant()

Flash / notice variant of a state (`success` only for a verified VAT id).

public static variant(string $status) : string
Parameters
$status : string
Return values
string
On this page

Search results