1. Go to this page and download the library: Download digitalcz/digisign 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/ */
digitalcz / digisign example snippets
use DigitalCz\DigiSign\Auth\ApiKeyCredentials;
use DigitalCz\DigiSign\DigiSign;
// Via constructor options
$dgs = new DigiSign([
'access_key' => '...',
'secret_key' => '...'
]);
// Or via methods
$dgs = new DigiSign();
$dgs->setCredentials(new ApiKeyCredentials('...', '...'));
use DigitalCz\DigiSign\Auth\Token;
use DigitalCz\DigiSign\Auth\TokenCredentials;
use DigitalCz\DigiSign\DigiSign;
use DigitalCz\DigiSign\DigiSignClient;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;
use Symfony\Component\HttpClient\Psr18Client;
$dgs = new DigiSign();
// To set your own PSR-18 HTTP Client, if not provided Psr18ClientDiscovery is used
$dgs->setClient(new DigiSignClient(new Psr18Client()));
// If you already have the auth-token, i can use TokenCredentials
$dgs->setCredentials(new TokenCredentials(new Token('...', 123)));
// Cache will be used to store auth-token, so it can be reused in later requests
$dgs->setCache(new Psr16Cache(new FilesystemAdapter()));
// Use testing API (https://api.digisign.digital.cz)
$dgs->useTesting(true);
// Overwrite API base
$dgs->setApiBase('https://example.com/api');
// Set maximum age of webhook request to one minute
$dgs->setSignatureTolerance(60);