final class BankIDOrderManager

Manages BankID orders.

Refactor to be more aligned with SOLID principles, mainly smaller "single" responsibility classes/services, e.g BankIDTempStore, Move Plugin loading to BankIDCasePluginManager, etc. Add interface.

Traits

StringTranslationTrait

Methods

__construct(BankIDClient $bankID, TranslationInterface $stringTranslation, PrivateTempStoreFactory $tempStoreFactory, KeyValueFactoryInterface $keyValueFactory, BankIDCasePluginManager $bankIDCaseManager, RequestStack $requestStack, ConfigFactoryInterface $config_factory)

Constructor for BankIDOrderManager.

string
registerCase(CaseData $case)

Register a case.

BankIDCaseInterface|null
loadPlugin(string|null $configuration_hash)

Load a plugin.

CaseData|null
getCaseData(string|null $configuration_hash)

Get case data.

array
startOrder(string|null $configuration_hash = NULL)

Start a sign order.

array
getOrderStatus(string $order_ref)

Get the status of an order.

array
cancelOrder(string $order_ref)

Cancel an order.

void
deleteKey(string $key)

Delete a key from the private temp store.

string|null
getOrderUserId(string $order_ref)

Get the user id from the order.

array|null
getOrderDoneTempData(string $order_ref)

Get the order done temp data from the order.

string
getMessage(string $short_name)

Get a message by short name.

Details

at line 50
__construct(BankIDClient $bankID, TranslationInterface $stringTranslation, PrivateTempStoreFactory $tempStoreFactory, KeyValueFactoryInterface $keyValueFactory, BankIDCasePluginManager $bankIDCaseManager, RequestStack $requestStack, ConfigFactoryInterface $config_factory)

Constructor for BankIDOrderManager.

Parameters

BankIDClient $bankID
TranslationInterface $stringTranslation
PrivateTempStoreFactory $tempStoreFactory
KeyValueFactoryInterface $keyValueFactory
BankIDCasePluginManager $bankIDCaseManager
RequestStack $requestStack
ConfigFactoryInterface $config_factory

at line 76
string registerCase(CaseData $case)

Register a case.

Parameters

CaseData $case

The case to register.

Return Value

string

The configuration hash of the registered case.

Exceptions

TempStoreException

at line 101
BankIDCaseInterface|null loadPlugin(string|null $configuration_hash)

Load a plugin.

The methods are named self::registerCase() and self::loadPlugin(). They seem to be related, should they be named self::registerCase() and self::loadCase() instead?

Parameters

string|null $configuration_hash

Return Value

BankIDCaseInterface|null

Exceptions

PluginException
BankIDException

at line 133
CaseData|null getCaseData(string|null $configuration_hash)

Get case data.

Parameters

string|null $configuration_hash

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

Return Value

CaseData|null

The case data or NULL.

Exceptions

BankIDException

at line 173
array startOrder(string|null $configuration_hash = NULL)

Start a sign order.

Parameters

string|null $configuration_hash

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

Return Value

array

The result of the sign order start.

Exceptions

PluginException

at line 228
array getOrderStatus(string $order_ref)

Get the status of an order.

Parameters

string $order_ref

The order reference to check the status for.

Return Value

array

An array containing the status.

at line 381
array cancelOrder(string $order_ref)

Cancel an order.

Parameters

string $order_ref

The order reference.

Return Value

array

An array containing the status, order reference, hint code, and message.

Exceptions

PluginException
BankIDException

at line 448
void deleteKey(string $key)

Delete a key from the private temp store.

Parameters

string $key

The key to delete.

Return Value

void

at line 461
string|null getOrderUserId(string $order_ref)

Get the user id from the order.

Parameters

string $order_ref

The order reference.

Return Value

string|null

The user id or NULL if not found.

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

Get the order done temp data from the order.

Parameters

string $order_ref

The order reference.

Return Value

array|null

The order temp data or NULL if not found.

at line 489
string getMessage(string $short_name)

Get a message by short name.

Parameters

string $short_name

The short name of the message.

Return Value

string

The message.