Get BankIdKey From AuthToken
This is the example for getBankIdKeyFromAuthToken. The documentation for can be found here
{
"credentials": {
"id": "12345",
"hash": "57d2dfa80914e9668d91862836e893249fba62bfaa4ca603c84ffdc903a0e66c8b1aa44060fd586a47b98b1877a071e00fb817d872508c5b5a2ac8e5bbad50fa",
"version": "2.5.0",
"client": "Pluginname:Qvickly:1.0",
"language": "sv",
"time": 1714944786.554058
},
"data": {
"hash": "123456abc123456abc123456abc12345",
"token": "23456"
},
"function": "getBankIdKeyFromAuthToken"
}
<?php
declare(strict_types=1);
require __DIR__ . '/../../../vendor/autoload.php';
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__ . '/../../..');
$dotenv->load();
use Qvickly\Api\Payment\PaymentAPI;
use Qvickly\Api\Payment\RequestDataObjects\Data;
$paymentAPI = new PaymentAPI($_ENV['EID'], $_ENV['SECRET']);
$data = new Data(
[
"token" => $_ENV['AUTH_TOKEN'],
"hash" => $_ENV['INVOICEHASH']
]
);
$bankidKey = $paymentAPI->getBankIdKeyFromAuthToken($data);
print_r($bankidKey);
Full example can be found here
This code requires our composer package qvickly/api
composer require qvickly/api
Response from server
{
"credentials": {
"hash": "20510ee95dcae3d7b5241c1e53cb95b479aa05f07e02d24e18c47aa347201042d70c6f773eaae09661553d99dc52eac26c43830a4b6ff54f038c0971002a13bf",
"logid": 1234567
},
"data": {
"bankidKey": "abcdefghijklmnopqrstuvxyz1234567890"
}
}
Last modified: 13 September 2024