class BankIDClient implements BankIDClientInterface

Communicates with real BankID servers over HTTPS.

Properties

protected ClientInterface|null $client

Cached HTTP client instance.

protected BankIDResponseFactoryInterface $responseFactory

The response factory.

Methods

__construct(ClientInterface|BankIDHttpClientFactory $httpClient, LoggerChannelInterface|null $logger = NULL, BankIDResponseFactoryInterface|null $responseFactory = NULL)

Constructs a new BankIDClient object.

start(OrderOperation $operation, BankIDRequestDataInterface $requestData)

Authenticate a user using animated QR code.

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.

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.

ClientInterface|null
getHttpClient()

Gets or initializes the HTTP client.

Details

at line 40
__construct(ClientInterface|BankIDHttpClientFactory $httpClient, LoggerChannelInterface|null $logger = NULL, BankIDResponseFactoryInterface|null $responseFactory = NULL)

Constructs a new BankIDClient object.

Parameters

ClientInterface|BankIDHttpClientFactory $httpClient

The configured HTTP client or client factory.

LoggerChannelInterface|null $logger

The logger channel.

BankIDResponseFactoryInterface|null $responseFactory

The response factory.

at line 54
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 82
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 104
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.

at line 126
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 149
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 175
protected ClientInterface|null getHttpClient()

Gets or initializes the HTTP client.

Return Value

ClientInterface|null

The HTTP client or NULL if initialization failed.