CoolCMS API

TaxResolveTrait

VAT engine bridge for Front managers, the top of a four-layer chain (next layer: {@see \App\Core\Traits\Front\Models\Services\TaxResolveTrait}). Front never computes a rate; it asks `api/system/tax/*`.

Request cache per identical request (a payment form asks on every re-render of the total). An empty array = the bridge failed (missing RBAC grant, invalid input) — consumers must treat it as "unknown", never as "no VAT".

Table of Contents

Properties

$taxDisplays  : array<string, array<int, array<string, mixed>>>
$taxResolutions  : array<string, array<string|int, mixed>>

Methods

resolveTax()  : array<string|int, mixed>
resolveTaxDisplay()  : array<int, array<string, mixed>>

Properties

$taxDisplays

private array<string, array<int, array<string, mixed>>> $taxDisplays = []

$taxResolutions

private array<string, array<string|int, mixed>> $taxResolutions = []

Methods

resolveTax()

public resolveTax(array{sellerId?: int|null, paymentRegionId?: int|null, taxDate?: string|null, customer?: array, lines?: list>, ancillary?: array|null, vatIdPolicy?: string} $request) : array<string|int, mixed>
Parameters
$request : array{sellerId?: int|null, paymentRegionId?: int|null, taxDate?: string|null, customer?: array, lines?: list>, ancillary?: array|null, vatIdPolicy?: string}
Return values
array<string|int, mixed> —

resolution (header, lines, flags, errors, ancillary, …), empty on failure

resolveTaxDisplay()

public resolveTaxDisplay(int|null $paymentRegionId, array<int, int> $supplyKindIds[, int|null $sellerId = null ][, string|null $taxDate = null ]) : array<int, array<string, mixed>>
Parameters
$paymentRegionId : int|null
$supplyKindIds : array<int, int>
$sellerId : int|null = null
$taxDate : string|null = null
Return values
array<int, array<string, mixed>> —

{supplyKindId: {code, chargeVat, vatPercents, noteKey, flags}}, empty on failure

On this page

Search results