wsilva94/nfse-bh-sdk

贝洛奥里藏特NFSE生成库

1.1.4 2020-04-30 19:04 UTC

This package is auto-updated.

Last update: 2024-09-08 00:01:55 UTC


README

通过贝尔奥里藏特市政府的webservice API发射、查询和取消服务发票

先决条件

您需要什么来安装此软件以及如何安装它

最小 PHP 7.2

安装

使用composer进行下载

composer require wsilva94/nfse-bh-sdk

开始

  • 按照以下步骤正确使用库

1 - 将您的数字证书 .PFX 添加到以下目录

storage/certificates/{{56142462000106}}/certificate.pfx

"56142462000106" 是公司的CNPJ。

2 - 每次需要使用任何实现过的ENDPOINT时,始终传递配置参数。

tests/systemSettings

    use Exception;
    use NFse\Config\Boot;
    use NFse\Helpers\Utils;
    use NFse\Models\Settings;

    try {
        //ambiente
        $settings = new Settings();
        $settings->environment = 'homologacao';

        //Emitente
        $settings->issuer->name = 'LINK SERVICOS DE CERTIFICACAO DIGITAL LTDA';
        $settings->issuer->cnpj = 11508222000136;
        $settings->issuer->imun = 2530360019;
        $settings->issuer->codMun = 3106200;

        //certificado digital
        $settings->certificate->folder = __DIR__ . '/../storage/certificates/' . $settings->issuer->cnpj . '/';
        $settings->certificate->certFile = 'certificate.pfx';
        $settings->certificate->mixedKey = 'mixedKey.pem';
        $settings->certificate->privateKey = 'privateKey.pem';
        $settings->certificate->publicKey = 'publicKey.pem';
        $settings->certificate->password = '215424958751';
        $settings->certificate->noValidate = true;

        //dev
        if ($settings->environment == 'homologacao') {
            Utils::xdebugMode();
        }

        //efetua o boot no lib
        $system = new Boot($settings);
        $system->init();

    } catch (Exception $e) {
        throw $e;
    }

测试执行

按照 "tests" 文件夹内的测试用例进行

作者

贡献者

许可

本项目采用MIT许可证 - 有关详细信息,请参阅[LICENSE.md] (LICENSE.md) 文件

感谢