leandro / nfe
Leandro的PHP NFe库
v1.2.16
2017-04-17 12:44 UTC
Requires
- dompdf/dompdf: 0.6.*
- illuminate/filesystem: 5.2.*
- illuminate/support: 5.2.*
- nesbot/carbon: 1.*
- phpdocumentor/reflection-docblock: ^3.1
- phpnfe/tools: 1.2.*
- picqer/php-barcode-generator: ^0.2.0
Requires (Dev)
- phpunit/phpunit: 4.8.*
README
操作
- 授权
- 取消
- 更正函
- 作废
- 查询
工具
- 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';