jansenfelipe/nfe-gratis

使用此包,您可以免费在税务网站直接查询NFe。

1.0.2 2018-10-04 20:14 UTC

This package is auto-updated.

Last update: 2024-08-29 05:06:11 UTC


README

使用此包,您可以免费在巴西联邦税务网站进行NFe查询。

注意:此包没有captcha阅读器,但会捕获captcha供用户输入

变更日志

  • 1.0.2 - 修复标题 + 服务器参数
  • 1.0.1 - 添加标题 + 修复服务器
  • 1.0.0 - 创建库 + 提供商 FSist

如何使用

添加库

$ composer require jansenfelipe/nfe-gratis

将composer的autoload.php添加到您的PHP文件中。

require_once 'vendor/autoload.php';  

首先调用getParams()方法以返回发送到getNFe()方法所需的数据

use JansenFelipe\NFeGratis\Clients\CurlHttpClient;
use JansenFelipe\NFeGratis\NFeGratis;
use JansenFelipe\NFeGratis\Providers\FSistProvider;

$nfeGratis = new NFeGratis(new CurlHttpClient(), new FSistProvider());

$params = $nfeGratis->getParams();

现在只需调用getNFe()方法,传入NFe的访问密钥和参数

$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()
]);

喜欢吗?了解以下内容

许可证

MIT许可证 (MIT)