PHP code example of dbseller / assinador-sdk-php

1. Go to this page and download the library: Download dbseller/assinador-sdk-php 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/ */

    

dbseller / assinador-sdk-php example snippets


'providers' => [
     \Dbseller\AssinadorSdkPhp\DBSellerSignerServiceProvider::class
]


public function assinar(\Dbseller\AssinadorSdkPhp\DBSellerSigner $DBSellerSigner)
{
       
      /**
      *Bloco para gerar o certificado na api de certificado
      **/
        $fileName = $DBSellerSigner->certificate()
            ->setCpfCnpj("000.000.000-00")
            ->setName("NOME DO CIDADÃO")
            ->generate();

       /**
      *Bloco para baixar o certificado na api de certificado e armazenar no local desejado na maquina
      **/
        $path_file = storage_path("app/certificates");
        $pfxFile = $DBSellerSigner->certificate()->downloadPFX($fileName, $path_file);

       /**
       *Bloco para assinadr o cdocumento
      **/
         $fileSigner = $DBSellerSigner->signer()
                    ->setCpfCnpj("000.000.000-00")
                    ->setFilePath("diretorio do arquivo a ser assinado")
                    ->setFilePathPFX($pfxFile)
                    ->signer();

}
terminal
  composer 
terminal
php artisan vendor:publish --tag="dbseller-signer-config"