class BankIDMockClient implements BankIDClientInterface

Provides mock BankID responses for testing and development.

Properties

protected PrivateTempStore $mockStore

Store for storing mock responses.

Methods

__construct(PrivateTempStoreFactory $tempStoreFactory)

Constructor for BankIDMockService.

start(OrderOperation $operation, BankIDRequestDataInterface $requestData)

Authenticate a user using animated QR code.

collect(OrderOperation $operation, string $order_reference)

Collect an ongoing user request.

cancel(OrderOperation $operation, string $order_reference)

Cancel an ongoing order per the users request.

void
setMockCompletionUser(string $personalNumber, string $givenName, string $surname)

Sets the user to be returned when the mock order completes.

array|null
getMockCompletionUser()

Gets the mock completion user from the store.

void
deleteMockCompletionUser()

Deletes the mock completion user from the store.

void
setCollectOutcome(string $outcome)

Sets the outcome for the next collect call.

string
getCollectOutcome()

Gets the outcome for the collect call.

void
deleteCollectOutcome()

Deletes the collect outcome from the store.

phoneAuth(string $call_initiator, BankIDRequestDataInterface $requestData)

Authenticate a user over phone.

phoneSign(string $call_initiator, BankIDRequestDataInterface $requestData)

Request a signing order for a user over the phone.

Details

at line 30
__construct(PrivateTempStoreFactory $tempStoreFactory)

Constructor for BankIDMockService.

Parameters

PrivateTempStoreFactory $tempStoreFactory

at line 39
BankIDResponse start(OrderOperation $operation, BankIDRequestDataInterface $requestData)

Authenticate a user using animated QR code.

Parameters

OrderOperation $operation

The BankID operation.

BankIDRequestDataInterface $requestData

The BankID request data.

Return Value

BankIDResponse

The BankID response.

at line 62
BankIDResponse collect(OrderOperation $operation, string $order_reference)

Collect an ongoing user request.

Parameters

OrderOperation $operation

The BankID operation.

string $order_reference

The order reference.

Return Value

BankIDResponse

The BankID response.

at line 132
BankIDResponse cancel(OrderOperation $operation, string $order_reference)

Cancel an ongoing order per the users request.

Parameters

OrderOperation $operation

The BankID operation.

string $order_reference

The order reference.

Return Value

BankIDResponse

The BankID response.

at line 153
void setMockCompletionUser(string $personalNumber, string $givenName, string $surname)

Sets the user to be returned when the mock order completes.

Parameters

string $personalNumber

The personal number of the mock user.

string $givenName

The given name of the mock user.

string $surname

The surname of the mock user.

Return Value

void

Exceptions

TempStoreException

at line 169
protected array|null getMockCompletionUser()

Gets the mock completion user from the store.

Return Value

array|null

The mock user data or NULL if not set.

at line 178
protected void deleteMockCompletionUser()

Deletes the mock completion user from the store.

Return Value

void

Exceptions

TempStoreException

at line 190
void setCollectOutcome(string $outcome)

Sets the outcome for the next collect call.

Parameters

string $outcome

The outcome (e.g., 'cancel', 'expired', 'certificate_error').

Return Value

void

Exceptions

TempStoreException

at line 200
protected string getCollectOutcome()

Gets the outcome for the collect call.

Return Value

string

The outcome or 'none' if not set.

at line 207
protected void deleteCollectOutcome()

Deletes the collect outcome from the store.

Return Value

void

at line 214
BankIDResponse phoneAuth(string $call_initiator, BankIDRequestDataInterface $requestData)

Authenticate a user over phone.

Parameters

string $call_initiator

The call initiator.

BankIDRequestDataInterface $requestData

The BankID request data.

Return Value

BankIDResponse

The BankID response.

at line 225
BankIDResponse phoneSign(string $call_initiator, BankIDRequestDataInterface $requestData)

Request a signing order for a user over the phone.

Parameters

string $call_initiator

The call initiator.

BankIDRequestDataInterface $requestData

The BankID request data.

Return Value

BankIDResponse

The BankID response.