viniciusmuniz/nfse-bh-sdk

贝洛奥里藏特市NFS-E生成库

1.1.4 2020-04-30 19:04 UTC

This package is auto-updated.

Last update: 2024-09-04 05:24:48 UTC


README

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

先决条件

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

最低 PHP 7.2

安装

使用composer下载

composer require yaguin/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)以获取详细信息

感谢

  • Krypton Tech 为我提供时间和资源来实施此库提供了支持。