final class BankIDOrderStatus implements JsonSerializable, ArrayAccess, Countable

Frontend transport and presentation value object for a BankID order.

Aggregates order polling state for the frontend modal dialog, including animated QR code string, deep link app URL, translated user message, and plugin outcome data.

Methods

__construct(string $status, string|null $orderRef = NULL, string|null $hintCode = NULL, TranslatableMarkup|string|null $message = NULL, string|null $qrData = NULL, string|null $appLink = NULL, array|null $data = NULL, string|null $autoStartToken = NULL, string|null $qrStartToken = NULL, string|null $errorCode = NULL)

Constructs a new BankIDOrderStatus instance.

createStart(string $orderRef, string $qrData, string $appLink, string|null $autoStartToken = NULL, string|null $qrStartToken = NULL, TranslatableMarkup|string|null $message = NULL)

Creates an order start status instance.

createPending(string $orderRef, string|null $hintCode, TranslatableMarkup|string|null $message, string|null $qrData = NULL, string|null $appLink = NULL)

Creates a pending collect status instance.

createComplete(string $orderRef, TranslatableMarkup|string|null $message, array|null $data = NULL)

Creates a completed status instance.

createFailed(TranslatableMarkup|string|null $message, string|null $orderRef = NULL, string|null $hintCode = NULL, string|null $errorCode = NULL, array|null $data = NULL, string|null $qrData = NULL, string|null $appLink = NULL)

Creates a failed status instance.

createCancelled(string|null $orderRef = NULL, array|null $data = NULL)

Creates a cancelled status instance.

createEmpty()

Creates an empty status instance (used when already cancelled).

string
getStatus()

Gets the order status string.

string|null
getOrderRef()

Gets the order reference.

string|null
getHintCode()

Gets the BankID hint code.

string|null
getMessage()

Gets the resolved status or error message string.

TranslatableMarkup|string|null
getMessageMarkup()

Gets the raw message (TranslatableMarkup or string).

string|null
getQrData()

Gets the QR code data string.

string|null
getAppLink()

Gets the auto-start app link URL.

array|null
getData()

Gets the client data array.

string|null
getAutoStartToken()

Gets the auto start token.

string|null
getQrStartToken()

Gets the QR start token.

string|null
getErrorCode()

Gets the BankID error code.

bool
isPending()

Checks if status is pending.

bool
isComplete()

Checks if status is complete.

bool
isFailed()

Checks if status is failed.

bool
isOk()

Checks if status is OK (e.g. cancelled).

bool
isEmpty()

Checks if the status represents an empty response.

array
toArray()

Converts the status object to an associative array.

array
jsonSerialize()

{@inheritdoc}

int
count()

{@inheritdoc}

bool
offsetExists(mixed $offset)

{@inheritdoc}

mixed
offsetGet(mixed $offset)

{@inheritdoc}

void
offsetSet(mixed $offset, mixed $value)

{@inheritdoc}

void
offsetUnset(mixed $offset)

{@inheritdoc}

Details

at line 44
__construct(string $status, string|null $orderRef = NULL, string|null $hintCode = NULL, TranslatableMarkup|string|null $message = NULL, string|null $qrData = NULL, string|null $appLink = NULL, array|null $data = NULL, string|null $autoStartToken = NULL, string|null $qrStartToken = NULL, string|null $errorCode = NULL)

Constructs a new BankIDOrderStatus instance.

Parameters

string $status

The order status (e.g., 'pending', 'complete', 'failed', 'OK').

string|null $orderRef

The order reference.

string|null $hintCode

The BankID hint code.

TranslatableMarkup|string|null $message

The status or error message.

string|null $qrData

The formatted QR code data string.

string|null $appLink

The auto-start app link URL.

array|null $data

Optional client data from plugin completion or failure.

string|null $autoStartToken

The auto start token.

string|null $qrStartToken

The QR start token.

string|null $errorCode

Optional BankID error code if failed.

at line 76
static BankIDOrderStatus createStart(string $orderRef, string $qrData, string $appLink, string|null $autoStartToken = NULL, string|null $qrStartToken = NULL, TranslatableMarkup|string|null $message = NULL)

Creates an order start status instance.

Parameters

string $orderRef

The order reference.

string $qrData

The QR code data.

string $appLink

The app link URL.

string|null $autoStartToken

The auto start token.

string|null $qrStartToken

The QR start token.

TranslatableMarkup|string|null $message

Optional message.

Return Value

BankIDOrderStatus

A new instance.

at line 112
static BankIDOrderStatus createPending(string $orderRef, string|null $hintCode, TranslatableMarkup|string|null $message, string|null $qrData = NULL, string|null $appLink = NULL)

Creates a pending collect status instance.

Parameters

string $orderRef

The order reference.

string|null $hintCode

The hint code.

TranslatableMarkup|string|null $message

The status message.

string|null $qrData

Optional QR code data.

string|null $appLink

Optional app link URL.

Return Value

BankIDOrderStatus

A new instance.

at line 142
static BankIDOrderStatus createComplete(string $orderRef, TranslatableMarkup|string|null $message, array|null $data = NULL)

Creates a completed status instance.

Parameters

string $orderRef

The order reference.

TranslatableMarkup|string|null $message

The status message.

array|null $data

The client data from plugin.

Return Value

BankIDOrderStatus

A new instance.

at line 176
static BankIDOrderStatus createFailed(TranslatableMarkup|string|null $message, string|null $orderRef = NULL, string|null $hintCode = NULL, string|null $errorCode = NULL, array|null $data = NULL, string|null $qrData = NULL, string|null $appLink = NULL)

Creates a failed status instance.

Parameters

TranslatableMarkup|string|null $message

The failure message.

string|null $orderRef

Optional order reference.

string|null $hintCode

Optional hint code.

string|null $errorCode

Optional error code.

array|null $data

Optional client data from plugin.

string|null $qrData

Optional QR data.

string|null $appLink

Optional app link.

Return Value

BankIDOrderStatus

A new instance.

at line 208
static BankIDOrderStatus createCancelled(string|null $orderRef = NULL, array|null $data = NULL)

Creates a cancelled status instance.

Parameters

string|null $orderRef

The order reference.

array|null $data

Optional client data from plugin.

Return Value

BankIDOrderStatus

A new instance.

at line 225
static BankIDOrderStatus createEmpty()

Creates an empty status instance (used when already cancelled).

Return Value

BankIDOrderStatus

A new instance.

at line 232
string getStatus()

Gets the order status string.

Return Value

string

at line 239
string|null getOrderRef()

Gets the order reference.

Return Value

string|null

at line 246
string|null getHintCode()

Gets the BankID hint code.

Return Value

string|null

at line 253
string|null getMessage()

Gets the resolved status or error message string.

Return Value

string|null

at line 260
TranslatableMarkup|string|null getMessageMarkup()

Gets the raw message (TranslatableMarkup or string).

Return Value

TranslatableMarkup|string|null

at line 267
string|null getQrData()

Gets the QR code data string.

Return Value

string|null

Gets the auto-start app link URL.

Return Value

string|null

at line 284
array|null getData()

Gets the client data array.

Return Value

array|null

The client data array or NULL.

at line 291
string|null getAutoStartToken()

Gets the auto start token.

Return Value

string|null

at line 298
string|null getQrStartToken()

Gets the QR start token.

Return Value

string|null

at line 305
string|null getErrorCode()

Gets the BankID error code.

Return Value

string|null

at line 312
bool isPending()

Checks if status is pending.

Return Value

bool

at line 319
bool isComplete()

Checks if status is complete.

Return Value

bool

at line 326
bool isFailed()

Checks if status is failed.

Return Value

bool

at line 333
bool isOk()

Checks if status is OK (e.g. cancelled).

Return Value

bool

at line 340
bool isEmpty()

Checks if the status represents an empty response.

Return Value

bool

at line 350
array toArray()

Converts the status object to an associative array.

Return Value

array

The array representation.

at line 360
array jsonSerialize()

{@inheritdoc}

Return Value

array

The JSON-serializable array representation.

at line 401
int count()

{@inheritdoc}

Return Value

int

at line 408
bool offsetExists(mixed $offset)

{@inheritdoc}

Parameters

mixed $offset

Return Value

bool

at line 415
mixed offsetGet(mixed $offset)

{@inheritdoc}

Parameters

mixed $offset

Return Value

mixed

at line 422
void offsetSet(mixed $offset, mixed $value)

{@inheritdoc}

Parameters

mixed $offset
mixed $value

Return Value

void

at line 429
void offsetUnset(mixed $offset)

{@inheritdoc}

Parameters

mixed $offset

Return Value

void