class BankIDRequestData implements BankIDRequestDataInterface

Upstream API request value object.

Encapsulates the request payload sent to the BankID API (such as /auth or /sign), including user visible and non-visible data, end-user IP, and requirement parameters.

Traits

BankID request data trait.

Methods

string
encodePayloadData(array $data)

Encode payload data.

array
decodePayloadData(string $str)

Decode payload data.

string
encodePayloadString(string $str, bool $ensure_utf8 = TRUE)

Encode a string for a BankID payload.

string
decodePayloadString(string $str)

Decode a string for a BankID payload.

__construct(string|null $userVisibleData, array|string|null $userNonVisibleData = NULL, bool|null $returnRisk = NULL, string|null $returnUrl = NULL, BankIDRequestRequirements $requirements = new BankIDRequestRequirements(), string $userVisibleDataFormat = BankIDRequestDataInterface::USER_VISIBLE_DATA_FORMAT_PLAINTEXT, string|null $endUserIp = NULL)

Constructs a BankIDRequestData object.

getRequirements()

Get the requirements for the order.

array|null
getFormattedRequirements()

Get formatted requirements for api call.

string|null
getUserVisibleData()

Get the visible data for the order.

string|null
getFormattedUserVisibleData()

Get formatted visible data for api call.

string|null
getUserVisibleDataFormat()

Get the visible data format for the order.

string|null
getUserNonVisibleData()

Get the non-visible data for the order.

bool|null
getReturnRisk()

Get return risk flag.

string|null
getReturnUrl()

Get the return url.

string
getEndUserIp()

Get the end user IP.

array
getAuthenticatePayload()

Get the payload array for an authentication request.

array
getSignPayload()

Get the payload array for a sign request.

array
getPhoneAuthenticationPayload(string $call_initiator)

Get the payload array for a phone authentication request.

array
getPhoneSignPayload(string $call_initiator)

Get the payload array for a phone sign request.

Details

protected string encodePayloadData(array $data)

Encode payload data.

Parameters

array $data

The data to encode.

Return Value

string

The encoded data according to BankID api spec.

protected array decodePayloadData(string $str)

Decode payload data.

Parameters

string $str

The encoded data according to BankID api spec.

Return Value

array

The decoded payload data

protected string encodePayloadString(string $str, bool $ensure_utf8 = TRUE)

Encode a string for a BankID payload.

Parameters

string $str

The string to encode.

bool $ensure_utf8

Ensure the string is UTF-8 encoded.

Return Value

string

The encoded string.

protected string decodePayloadString(string $str)

Decode a string for a BankID payload.

Parameters

string $str

The string to decode.

Return Value

string

The decoded string.

at line 41
__construct(string|null $userVisibleData, array|string|null $userNonVisibleData = NULL, bool|null $returnRisk = NULL, string|null $returnUrl = NULL, BankIDRequestRequirements $requirements = new BankIDRequestRequirements(), string $userVisibleDataFormat = BankIDRequestDataInterface::USER_VISIBLE_DATA_FORMAT_PLAINTEXT, string|null $endUserIp = NULL)

Constructs a BankIDRequestData object.

Parameters

string|null $userVisibleData

The user visible data.

array|string|null $userNonVisibleData

The user non-visible data (i.e. the data to sign).

bool|null $returnRisk

If risk should be return.

string|null $returnUrl

The return url.

BankIDRequestRequirements $requirements

The requirements for the order.

string $userVisibleDataFormat

The visible data format for the order. Will only be applied if the user visible data is not empty.

string|null $endUserIp

The end user IP address or NULL to determine automatically.

at line 57
BankIDRequestRequirements getRequirements()

Get the requirements for the order.

Return Value

BankIDRequestRequirements

The requirements.

at line 67
array|null getFormattedRequirements()

Get formatted requirements for api call.

Return Value

array|null

The requirements payload if applicable.

at line 77
string|null getUserVisibleData()

Get the visible data for the order.

Return Value

string|null

The visible data.

at line 87
string|null getFormattedUserVisibleData()

Get formatted visible data for api call.

Return Value

string|null

The visible data.

at line 101
string|null getUserVisibleDataFormat()

Get the visible data format for the order.

Return Value

string|null

The visible data format.

at line 114
string|null getUserNonVisibleData()

Get the non-visible data for the order.

Return Value

string|null

The non-visible data.

at line 132
bool|null getReturnRisk()

Get return risk flag.

Return Value

bool|null

The return risk flag.

at line 142
string|null getReturnUrl()

Get the return url.

Return Value

string|null

The return url.

at line 152
string getEndUserIp()

Get the end user IP.

Return Value

string

The end user IP.

at line 170
array getAuthenticatePayload()

Get the payload array for an authentication request.

Return Value

array

Payload array to BankID api request.

at line 181
array getSignPayload()

Get the payload array for a sign request.

Return Value

array

Payload array to BankID api request.

at line 208
array getPhoneAuthenticationPayload(string $call_initiator)

Get the payload array for a phone authentication request.

Parameters

string $call_initiator

The call initiator.

Return Value

array

Payload array to BankID api request.

at line 222
array getPhoneSignPayload(string $call_initiator)

Get the payload array for a phone sign request.

Parameters

string $call_initiator

The call initiator.

Return Value

array

Payload array to BankID api request.