class BankIDMessageResolver implements BankIDMessageResolverInterface

Resolves user-facing messages for BankID responses based on RP Guidelines.

Traits

StringTranslationTrait

Methods

__construct(BankIDRfaResolver $rfaResolver, TranslationInterface $translation)

Constructs a new BankIDMessageResolver.

TranslatableMarkup|null
resolve(BankIDResponse $response)

Resolves a BankID response to a translatable markup object.

TranslatableMarkup
resolveFromErrorCode(string $errorCode)

Resolves a BankID error code to a translatable markup object.

TranslatableMarkup|null
rfaToMarkup(string|null $short_name)

Maps an RFA short code to its translatable markup.

string|null
getMessage(BankIDResponse $response)

Gets the rendered message string for a BankID response.

Details

at line 27
__construct(BankIDRfaResolver $rfaResolver, TranslationInterface $translation)

Constructs a new BankIDMessageResolver.

Parameters

BankIDRfaResolver $rfaResolver

The RFA code resolver.

TranslationInterface $translation

The string translation service.

at line 37
TranslatableMarkup|null resolve(BankIDResponse $response)

Resolves a BankID response to a translatable markup object.

Parameters

BankIDResponse $response

The BankID response.

Return Value

TranslatableMarkup|null

The translatable markup message or NULL if no message applies.

at line 54
TranslatableMarkup resolveFromErrorCode(string $errorCode)

Resolves a BankID error code to a translatable markup object.

Parameters

string $errorCode

The error code.

Return Value

TranslatableMarkup

The translatable markup message.

at line 71
protected TranslatableMarkup|null rfaToMarkup(string|null $short_name)

Maps an RFA short code to its translatable markup.

Parameters

string|null $short_name

The RFA short code.

Return Value

TranslatableMarkup|null

The translatable markup message or NULL.

at line 130
string|null getMessage(BankIDResponse $response)

Gets the rendered message string for a BankID response.

Parameters

BankIDResponse $response

The BankID response.

Return Value

string|null

The rendered message string or NULL.