Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.6 KB

README.md

File metadata and controls

66 lines (47 loc) · 1.6 KB

BankID

Packagist.org

https://packagist.org/packages/hajarrashidi/bankid

composer require hajarrashidi/bankid

Description:

PHP Composer package for BankID, supports v6.0 with QR and App link support.

  • BankID v6.0 production
  • BankID v6.0 development

Requirements:

  • /auth
  • /collect
  • /cancel
  • /sign
  • /phone/auth
  • /phone/sign

Helper methods:

  • QR-code generator
  • App-link generator

Code example:

<?php
// If you don't have Composer autoload
require_once __DIR__ . '/vendor/autoload.php';

use BankID\v_6_0\Bankid_6_0_dev;

$bankid = new Bankid_6_0_dev([
    'verify' => false,
    'headers' => [
        'Content-Type' => 'application/json',
    ],
    'cert' => __DIR__ . '/bankid_test_cert.pem'
]);

$response = $bankid->auth([ 'endUserIp' => "127.0.0.1" ]);
//$response = $bankid->sign([ 'endUserIp' => "127.0.0.1", 'userVisibleData' => base64_encode("hello") ]);
//$response = $bankid->phoneSign([ 'personalNumber' => "111122334444", "userVisibleData" => base64_encode("hello"), "callInitiator" => "user"]);
//$response = $bankid->phoneAuth([ 'personalNumber' => "111122334444", "callInitiator" => "user"]);

var_dump($response);

financial support:

Github Sponsor

Patreon