class BankIDSession

Service to manage BankID session data.

Properties

protected PrivateTempStore $privateTempStore

The private temporary store.

protected KeyValueStoreExpirableInterface $keyValueStore

The key value store.

Methods

__construct(PrivateTempStoreFactory $tempStoreFactory, KeyValueExpirableFactoryInterface $keyValueFactory, BankIDCasePluginManager $bankIDCaseManager)

Constructs a new BankIDSession object.

string
registerCase(BankIDCaseData $case)

Register a case.

getCaseData(string|null $configuration_hash)

Get case data.

loadCasePlugin(string|null $configuration_hash)

Load a case plugin.

void
setData(string $key, string $type, mixed $data)

Save data to the private temp store.

mixed
getData(string $key, string $type)

Retrieve data from the private temp store.

bool
isPersistedType(string $type)

Check if a type is "persisted" type.

void
deleteKey(string $key)

Delete a key from the private temp store.

Details

at line 41
__construct(PrivateTempStoreFactory $tempStoreFactory, KeyValueExpirableFactoryInterface $keyValueFactory, BankIDCasePluginManager $bankIDCaseManager)

Constructs a new BankIDSession object.

Parameters

PrivateTempStoreFactory $tempStoreFactory

The private temp store factory.

KeyValueExpirableFactoryInterface $keyValueFactory

The key value factory.

BankIDCasePluginManager $bankIDCaseManager

The BankID case plugin manager.

at line 61
string registerCase(BankIDCaseData $case)

Register a case.

Parameters

BankIDCaseData $case

The case to register.

Return Value

string

The configuration hash of the registered case.

Exceptions

TempStoreException

at line 87
BankIDCaseData|null getCaseData(string|null $configuration_hash)

Get case data.

Parameters

string|null $configuration_hash

The configuration hash.

Return Value

BankIDCaseData|null

The case data or NULL.

Exceptions

BankIDException

at line 131
BankIDCaseInterface|null loadCasePlugin(string|null $configuration_hash)

Load a case plugin.

Parameters

string|null $configuration_hash

The configuration hash.

Return Value

BankIDCaseInterface|null

The case plugin or NULL.

Exceptions

PluginException
BankIDException

at line 161
void setData(string $key, string $type, mixed $data)

Save data to the private temp store.

Parameters

string $key

The key to save the data (e.g., orderRef).

string $type

The type of data being saved.

mixed $data

The data to save.

Return Value

void

Exceptions

TempStoreException

at line 185
mixed getData(string $key, string $type)

Retrieve data from the private temp store.

Parameters

string $key

The key to retrieve the data (e.g., orderRef).

string $type

The type of data to retrieve.

Return Value

mixed

The data associated with the key and type, or NULL if not found.

at line 208
protected bool isPersistedType(string $type)

Check if a type is "persisted" type.

NOTE: "Persisted" data will be kept until temp store clear itself.

Parameters

string $type

The type of data to check.

Return Value

bool

TRUE if the type is "persisted", FALSE otherwise.

at line 227
void deleteKey(string $key)

Delete a key from the private temp store.

NOTE: "Persisted" data will be kept until temp store clear itself.

Parameters

string $key

The key to delete.

Return Value

void

Exceptions

TempStoreException