PHP code example of bigbank / digidoc
1. Go to this page and download the library: Download bigbank/digidoc library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bigbank / digidoc example snippets
php
// Instantiate the main class
$digiDoc = new DigiDoc(DigiDoc::URL_TEST);
// Ask for a service (see: Services)
/** @var AuthenticatorInterface $authenticator */
$authenticator = $digiDoc->getService(AuthenticatorInterface::class);
// Start mobile ID authentication
$userDetails = $authenticator->authenticate('14212128025', '+37200007', 'Testimine', 'My Test App', false);
// Wait for the user to complete the process
$authenticator->waitForAuthentication(function ($authResult) {
return $authResult === 'USER_AUTHENTICATED' ? 'welcome!' : 'not authenticated';
});