NFe para PHP por NetForce


Keywords
php, nfe, netforce
License
MIT

Documentation

NFe para PHP

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

Operações

  • Autorização
  • Cancelamento
  • Carta Correção
  • Inutilização
  • Consulta

Ferramentas

  • Builder para NF-e
  • Danfe
  • Danfe Carta Correção

Estados homologados:

  • SC

Composer

 "phpnfe/nfe": "1.2.*"

Uso - Autorização

Exemplo:

<?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';

Exemplos

License

The MIT License