PHP code example of jansenfelipe / nfe-gratis
1. Go to this page and download the library: Download jansenfelipe/nfe-gratis 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/ */
jansenfelipe / nfe-gratis example snippets
use JansenFelipe\NFeGratis\Clients\CurlHttpClient;
use JansenFelipe\NFeGratis\NFeGratis;
use JansenFelipe\NFeGratis\Providers\FSistProvider;
$nfeGratis = new NFeGratis(new CurlHttpClient(), new FSistProvider());
$params = $nfeGratis->getParams();
$xml = $nfeGratis->getNFe('CHAVE_ACESSO_NFE', [
'captcha' => 'INFORME_AS_LETRAS_DO_CAPTCHA',
'usuarioID' => '<usuarioID>' //Retornado no método getParams()
'server' => '<server>' //Retornado no método getParams()
]);