class BankIDManager

Builds UI elements for BankID cases.

Traits

StringTranslationTrait

Methods

__construct(RouteProviderInterface $routeProvider, BankIDOrderManager $orderManager, FormBuilderInterface $formBuilder, BankIDConfigInterface $config, TranslationInterface $translation, KillSwitch|null $killSwitch = NULL)

Constructs a BankIDManager object.

array
buildDialog(string $configuration_hash)

Builds the dialog for BankID authentication.

bool
isMockMode()

Checks if the module is in mock mode.

array
buildDialogLink(BankIDCaseData $case)

Builds a link to open the BankID dialog.

array
buildDialogAjaxButton(BankIDCaseData $case, string|null $parent_submit_id = NULL, string $order_ref_field = 'order_ref')

Builds an ajax button to open the BankID dialog.

array
buildDialogAjaxButtonByConfigHash(string $configuration_hash, string|null $parent_submit_id = NULL, string $order_ref_field = 'order_ref')

Builds an ajax button to open the BankID dialog.

string|null
getOrderUid(string $order_ref)

Get the order uid from the order ref.

array|null
getOrderDoneTempData(string $order_ref)

Get the order done temporary data.

array
buildOrderRefInput(string $configuration_hash, string $order_ref_field = 'order_ref')

Build the order ref input element.

static void
orderRefSubmitValidate(array $element, FormStateInterface $form_state, array $complete_form)

Sanity check that the order ref.

string
getOrderRefInputId(string $configuration_hash)

Get order ref element id from the configuration hash.

ImmutableConfig
getConfig()

Get the BankID settings config.

Details

at line 32
__construct(RouteProviderInterface $routeProvider, BankIDOrderManager $orderManager, FormBuilderInterface $formBuilder, BankIDConfigInterface $config, TranslationInterface $translation, KillSwitch|null $killSwitch = NULL)

Constructs a BankIDManager object.

Parameters

RouteProviderInterface $routeProvider
BankIDOrderManager $orderManager
FormBuilderInterface $formBuilder
BankIDConfigInterface $config
TranslationInterface $translation
KillSwitch|null $killSwitch

at line 53
array buildDialog(string $configuration_hash)

Builds the dialog for BankID authentication.

Parameters

string $configuration_hash

The configuration hash to identify the plugin configuration for this bankid order.

Return Value

array

The renderable array.

at line 101
protected bool isMockMode()

Checks if the module is in mock mode.

Return Value

bool

TRUE if in mock mode, FALSE otherwise.

Builds a link to open the BankID dialog.

Parameters

BankIDCaseData $case

The case data.

Return Value

array

The renderable array.

Exceptions

TempStoreException

at line 157
array buildDialogAjaxButton(BankIDCaseData $case, string|null $parent_submit_id = NULL, string $order_ref_field = 'order_ref')

Builds an ajax button to open the BankID dialog.

NOTE: this also adds an order_ref hidden field that is populated by the client script.

Parameters

BankIDCaseData $case

The case data.

string|null $parent_submit_id

The id of the consumer form original submit button. If autosubmit should be done.

string $order_ref_field

The field name where the order reference should be set on order approved.

Return Value

array

The renderable array.

Exceptions

TempStoreException

at line 181
array buildDialogAjaxButtonByConfigHash(string $configuration_hash, string|null $parent_submit_id = NULL, string $order_ref_field = 'order_ref')

Builds an ajax button to open the BankID dialog.

NOTE: this also adds an order_ref hidden field that is populated by the client script.

Parameters

string $configuration_hash

The configuration hash of the registered case. MUST BE UNIQUE.

string|null $parent_submit_id

The id of the consumer form original submit button. If autosubmit should be done.

string $order_ref_field

The field name where the order reference should be set on order approved.

Return Value

array

The renderable array.

Exceptions

BankIDException

at line 240
string|null getOrderUid(string $order_ref)

Get the order uid from the order ref.

Parameters

string $order_ref

The order reference.

Return Value

string|null

The order uid or NULL.

at line 253
array|null getOrderDoneTempData(string $order_ref)

Get the order done temporary data.

Parameters

string $order_ref

The order reference.

Return Value

array|null

The temporary order data or NULL.

at line 271
array buildOrderRefInput(string $configuration_hash, string $order_ref_field = 'order_ref')

Build the order ref input element.

It's a hidden element that gets populated by dialog after auth/sign is complete.

Parameters

string $configuration_hash

The configuration hash of the registered case. MUST BE UNIQUE.

string $order_ref_field

The field name where the order reference should be set on order approved.

Return Value

array

The renderable array with order ref input.

at line 306
static void orderRefSubmitValidate(array $element, FormStateInterface $form_state, array $complete_form)

Sanity check that the order ref.

Check that the sent-in order ref is actually for this very configuration hash.

Parameters

array $element

The sanity check element.

FormStateInterface $form_state

The current state of the form.

array $complete_form

The complete form structure.

Return Value

void

at line 330
protected string getOrderRefInputId(string $configuration_hash)

Get order ref element id from the configuration hash.

Parameters

string $configuration_hash

The configuration hash of the registered case. MUST BE UNIQUE.

Return Value

string

The order ref id.

at line 340
protected ImmutableConfig getConfig()

Get the BankID settings config.

Return Value

ImmutableConfig

The BankID Settings config.