kryptonpay/nfse-bh-sdk

贝洛奥里藏特市NFSE生成库

0.2 2023-05-08 15:56 UTC

This package is not auto-updated.

Last update: 2024-09-23 22:32:59 UTC


README

通过贝洛奥里藏特市(MG)市政府的webservice进行服务发票(NF)的发行、查询和取消的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) 文件以获取详细信息

感谢