1. Go to this page and download the library: Download opendesa/e-sign-bsre 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/ */
opendesa / e-sign-bsre example snippets
$esign = new OpenDesa\ESignBsre\ESignBSrE($baseUrl, $username, $password);
$response = $esign->setFile($file, $filename)->sign($nik, $passphrase);
$response->getStatus(); //Get status response (int) - 404, 200 etc
$response->getErrors(); //Get error response
$response->getData(); //Get data as blob pdf
$esign = new OpenDesa\ESignBsre\ESignBSrE($baseUrl, $username, $password);
$response = $esign->setFile($file, $filename)->verification();
$response->getStatus(); //Get status response (int)
$response->getErrors(); //Get error response
$response->getData(); //Get data as array (tergantung dari API BSrE)
// $baseUrl adalah baseUrl dari sistem sign BSrE. Contoh : https://sign.domain.com/
// $username adalah username yang diberikan dari sistem sign BSrE
// $password adalah password yang diberikan dari sistem sign BSrE
// $file adalah content dari file pdf yang akan di sign (Contoh pengambilan file dapat dilihat dibawah)
// $filename adalah nama file pdf yang akan di sign
$esign = new OpenDesa\ESignBsre\ESignBSrE($baseUrl, $username, $password);
$response = $esign->setFile($file, $filename)->verification();