class BankIDOrderManager

Manages BankID orders.

Traits

StringTranslationTrait

Methods

__construct(BankIDClientInterface $bankID, BankIDSession $bankIDSession, RequestStack $requestStack, TimeInterface $time, TranslationInterface $translation, BankIDMessageResolverInterface $messageResolver)

Constructor for BankIDOrderManager.

string
registerOrderCaseData(BankIDCaseData $case)

Register a potential new bankid case.

getOrderCaseData(string $configuration_hash)

Get registered order case data by configuration hash.

startOrder(string|null $configuration_hash = NULL)

Start a sign order.

processOrderStart(BankIDResponse $result, string $configuration_hash, OrderOperation $operation)

Process the start of an order.

getOrderStatus(string $order_ref)

Get the status of an order.

string
buildQRData(string $order_ref, int $time)

Build the QR code data for the JS client.

string
buildAppLink(string $order_ref)

Build the app link for the JS client.

fetchCollect(string $order_ref)

Fetch and parse collect data from BankID.

array|null
persistOrderDoneData(string $order_ref, BankIDOrderDoneData|null $order_done_data)

Persists completion data in session and returns client data.

cancelOrder(string $order_ref)

Cancel an order.

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|null
getOrderConfigurationHash(string $order_ref)

Get configuration hash for an order.

string|null
getMessage(BankIDResponse $response)

Get a message from bankid response.

Details

at line 28
__construct(BankIDClientInterface $bankID, BankIDSession $bankIDSession, RequestStack $requestStack, TimeInterface $time, TranslationInterface $translation, BankIDMessageResolverInterface $messageResolver)

Constructor for BankIDOrderManager.

Parameters

BankIDClientInterface $bankID
BankIDSession $bankIDSession
RequestStack $requestStack
TimeInterface $time
TranslationInterface $translation
BankIDMessageResolverInterface $messageResolver

at line 54
string registerOrderCaseData(BankIDCaseData $case)

Register a potential new bankid case.

If the configuration hash returned from this method is provided when calling startOrder(), an order will be started with the provided case data.

Parameters

BankIDCaseData $case

The case to register.

Return Value

string

The configuration hash of the registered case.

Exceptions

TempStoreException

at line 69
BankIDCaseData|null getOrderCaseData(string $configuration_hash)

Get registered order case data by configuration hash.

Parameters

string $configuration_hash

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

Return Value

BankIDCaseData|null

The case. NULL if it does not exists.

Exceptions

BankIDException

at line 87
BankIDOrderStatus 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

BankIDOrderStatus

The result of the sign order start.

Exceptions

PluginException
TempStoreException
BankIDException

at line 125
protected BankIDOrderStatus processOrderStart(BankIDResponse $result, string $configuration_hash, OrderOperation $operation)

Process the start of an order.

Parameters

BankIDResponse $result

The BankID response object containing the order start data.

string $configuration_hash

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

OrderOperation $operation

The order operation.

Return Value

BankIDOrderStatus

The order start status.

Exceptions

TempStoreException

at line 161
BankIDOrderStatus getOrderStatus(string $order_ref)

Get the status of an order.

Parameters

string $order_ref

The order reference to check the status for.

Return Value

BankIDOrderStatus

The order status.

Exceptions

PluginException
TempStoreException
BankIDException

at line 208
protected string buildQRData(string $order_ref, int $time)

Build the QR code data for the JS client.

Parameters

string $order_ref

The order reference to build the QR code data for.

int $time

The current time in seconds since the start of the order.

Return Value

string

The formatted QR code data string.

Build the app link for the JS client.

Parameters

string $order_ref

The order reference to build app link for.

Return Value

string

The app link.

at line 246
protected BankIDOrderStatus fetchCollect(string $order_ref)

Fetch and parse collect data from BankID.

Parameters

string $order_ref

The order reference.

Return Value

BankIDOrderStatus

The collect order status.

Exceptions

PluginException
TempStoreException
BankIDException

at line 324
protected array|null persistOrderDoneData(string $order_ref, BankIDOrderDoneData|null $order_done_data)

Persists completion data in session and returns client data.

Parameters

string $order_ref

The order reference.

BankIDOrderDoneData|null $order_done_data

The order done data from plugin.

Return Value

array|null

The client data for JS, or NULL if none.

at line 356
BankIDOrderStatus cancelOrder(string $order_ref)

Cancel an order.

Parameters

string $order_ref

The order reference.

Return Value

BankIDOrderStatus

The cancel order status.

Exceptions

PluginException
TempStoreException
BankIDException

at line 388
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 402
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 416
string|null getOrderConfigurationHash(string $order_ref)

Get configuration hash for an order.

Parameters

string $order_ref

The order reference.

Return Value

string|null

The configuration hash or NULL if not found.

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

Get a message from bankid response.

Parameters

BankIDResponse $response

The BankID response.

Return Value

string|null

The message.