leandro/nfe

Leandro的PHP NFe库

v1.2.16 2017-04-17 12:44 UTC

README

Build Status StyleCI Latest Stable Version Total Downloads Latest Unstable Version License

操作

  • 授权
  • 取消
  • 更正函
  • 作废
  • 查询

工具

  • NF-e 构建器
  • Danfe
  • Danfe 更正函

兼容的州

  • SC

Composer

 "phpnfe/nfe": "1.2.*"

使用 - 授权

示例

<?php

include 'vendor/autoload.php';

$path = __DIR__ . '/tests/utils/xmlTeste.xml';

$cert = new \PhpNFe\Tools\Certificado\Certificado();
$cert->carregarPfx(__DIR__ . 'seu_certificado.pfx', 'suaSenha');

$xml = file_get_contents($path);

$xml = $cert->assinarXML($xml, 'infNFe');

$nfe = new \PhpNFe\NFe\NFe($cert);

$b = $cert->ehValido();

$v = $nfe->validar($xml, '3.10');

$ret = $nfe->autorizar($xml);

$code = $ret->getCode();
$chave = $ret->getChNFe();
$retXml = $ret->getXML();
$message = $ret->getMessage();

echo 'foi';

示例

许可证

MIT 许可证