### Install Dependencies and Start Project Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Android/ReactExpo/CEP/README.md Run these commands in your project directory to install necessary npm packages and start the React Native development server. ```powershell npm i npm start ``` -------------------------------- ### Install Dependencies (TypeScript) Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Node.js/CEP/README.md Navigate to the TypeScript directory and install its dependencies using npm. ```bash cd typescript npm install ``` -------------------------------- ### Build and Start TypeScript Project Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Node.js/NFe/README.md Commands to compile TypeScript code to JavaScript and then run the compiled application. Assumes 'build' and 'start' scripts are defined in package.json. ```bash npm run build && npm start ``` -------------------------------- ### Install Dependencies with NPM Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Node.js/MDFe/README.md Installs project dependencies using npm. Ensure Node.js and npm are installed. ```bash npm install ``` -------------------------------- ### Install ACBrLib.ConsultaCNPJMT via .NET CLI Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/C Use the .NET CLI to add the ACBrLib.ConsultaCNPJMT package to your project. ```bash dotnet add package ACBrLib.ConsultaCNPJMT ``` -------------------------------- ### Run the Go Project (Bash) Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Go/NFe/README.md Execute the main Go application file to start the ACBrLib NFe demo. ```bash go run nfe.go ``` -------------------------------- ### Install ACBrLib.ConsultaCNPJMT via Package Reference Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/C Add the ACBrLib.ConsultaCNPJMT package to your project file for .NET integration. ```xml ``` -------------------------------- ### Execute TypeScript Example Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Node.js/CEP/README.md Run the compiled JavaScript file from the TypeScript project. ```bash node . ``` -------------------------------- ### Install ACBrLib.Core via .NET CLI Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/C Use the .NET CLI to add the ACBrLib.Core package to your project. ```bash dotnet add package ACBrLib.Core ``` -------------------------------- ### Get Certificate Issuer Name and Certifying Authority Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrDFe/ACBrDFe-change-log.txt Retrieves the certificate issuer name and the name of the certifying authority. Examples include 'AC VALID' and 'AC Certisign'. ```Pascal CertIssuerName: String -> Retorna Emissor do Certificado CertCertificadora: String -> Retorna o Nome da Certificadora. Exemplos: "AC VALID" e "AC Certisign". ``` -------------------------------- ### Initialize TACBrTEFPGWebAPI with Environment Variables Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrTEFD/ACBr_TEFD-change-log.txt The Initialize method configures environment variables 'PontoDeCaptura' and 'CPFCNPJ' if their corresponding properties 'PontoCaptura' and 'CNPJEstabelecimento' are set. ```Pascal Method "TACBrTEFPGWebAPI.Inicializar" modified to configure the environment variable "PontoDeCaptura", if the property "PontoCaptura" is set the environment variable "CPFCNPJ" if the property "CNPJEstabelecimento" is set. ``` -------------------------------- ### Set Environment Variables and Check Files (Bash) Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Go/NFe/README.md Configure the certificate password and ensure necessary files are present before running the Go application. ```bash # Defina a senha do certificado export PFX_PASS="sua_senha_do_certificado" # Exporte o caminho da biblioteca compartilhada, se necessário export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH # Certifique-se de que os arquivos estejam presentes: ls ./data/Schemas/NFe ls ./data/cert.pfx ``` -------------------------------- ### ACBrLibReinf Initialization and Configuration Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Node.js/Reinf/README.md This snippet shows how to initialize ACBrLibReinf, configure paths, set the environment, and load the certificate. It also demonstrates setting up logging and service configurations. ```javascript const path = require('path'); const ACBrReinf = require('@projetoacbr/acbrlib-reinf-node'); const config = { // Caminho para a biblioteca ACBrLib libPath: path.join(__dirname, 'lib', process.platform === 'win32' ? 'ACBrReinf64.dll' : 'libacbrreinf64.so'), // Caminho para a pasta de configuração configPath: path.join(__dirname, 'data', 'config'), // Caminho para a pasta de schemas schemasPath: path.join(__dirname, 'data', 'Schemas'), // Caminho para a pasta de notas savePath: path.join(__dirname, 'data', 'notas'), // Caminho para a pasta de retorno returnPath: path.join(__dirname, 'data', 'Retorno'), // Caminho para a pasta de logs logPath: path.join(__dirname, 'data', 'log'), // Configurações do ambiente Reinf // Ambiente = 0 (Produção), Ambiente = 1 (Homologação) ambiente: 1, // Versão do DF (Documento Fiscal) versaoDF: '6', // Configurações de log logLevel: 'debug', // Configurações do certificado digital certificado: { // Tipo do certificado: 0=Nenhum, 1=Arquivo, 2=Windows, 3=Azure tipo: 1, // Caminho para o arquivo PFX arquivo: path.join(__dirname, 'data', 'cert', 'cert.pfx'), // Senha do certificado PFX senha: process.env.PFX_PASSWORD } }; const acbrReinf = new ACBrReinf(config); async function inicializar() { try { await acbrReinf.iniciar(); console.log('ACBrLibReinf inicializado com sucesso!'); // Exemplo de configuração de serviços Reinf await acbrReinf.configServicos({ // ... outras configurações de serviços Reinf ... }); // Exemplo de configuração de logs await acbrReinf.configLogs({ // ... outras configurações de logs ... }); // Exemplo de configuração do DFe (certificado) await acbrReinf.configDFe({ // ... outras configurações do DFe ... }); // Exemplo de configuração do Reinf await acbrReinf.configReinf({ // ... outras configurações do Reinf ... }); // Exemplo de configuração do Principal await acbrReinf.configPrincipal({ // ... outras configurações do Principal ... }); console.log('Configurações aplicadas.'); } catch (error) { console.error('Erro ao inicializar ACBrLibReinf:', error); } } inicializar(); ``` -------------------------------- ### Initialize and Configure ACBrLibCep in Android Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Android/CEP/README.md Demonstrates the initialization of ACBrLibCep, setting up a secure directory for configuration files, and applying basic configurations like specifying the CEP web service. Ensure to use getFilesDir() in production for secure storage. ```java import br.com.acbr.lib.cep.ACBrLibCep; import java.io.File; public class MainActivity extends AppCompatActivity { private ACBrLibCep acbrlibcep; private File appDir; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //dica: defina um appDir, como diretório base para arquivos de configuração, certificados, schemas, etc. Ajuste conforme a estrutura do seu app. // em desenvolvimento, appDir pode ser getFilesDir() ou getExternalFilesDir(null). // Em produção, use sempre getFilesDir() para garantir acesso seguro e privado. appDir = getFilesDir(); if (!appDir.exists()) { appDir.mkdirs(); } // Inicialize a biblioteca String eArquivoConfig = appDir.getAbsolutePath() + "/ACBrLib.ini"; String chaveCrypt = ""; acbrlibcep = new ACBrLibCep(eArquivoConfig, chaveCrypt); aplicarConfiguracoes(); // finalizar lib em onDestroy @Override protected void onDestroy() { super.onDestroy(); try { acbrlibcep.finalizar(); } catch (Exception e) { e.printStackTrace(); } } // Método para aplicar as configurações mínimas da ACBrLibCep: private void aplicarConfiguracoes() { try { acbrlibcep.inicializar(); acbrlibcep.configGravarValor( "CEP", "WebService", "3" ); acbrlibcep.configGravar(); }catch (Exception e) { e.printStackTrace(); } } //Exemplo de código para consulta de endereço por CEP utilizando a ACBrLibCEP. private void onClick(View view) { try { String cep = acbrlibcep.buscarPorCep("18270170"); }catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### C6 Bank Digitizable Line Example (Direct Collection) Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrBoleto/Particularidades.html Example of a digitizable line for C6 Bank, indicating direct collection with issuance by the cedent (type 4). ```Text 33690.00031 92390.360113 04300.182048 5 11100000001100   <<< tipo de emissão 4 (cobrança direta com emissão pelo cedente) ``` -------------------------------- ### C6 Bank Digitizable Line Example (Registered Collection) Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrBoleto/Particularidades.html Example of a digitizable line for C6 Bank, indicating registered collection with issuance by the bank (type 3). ```Text 33690.00031 92390.360113 04300.182030 7 11100000001100   <<< tipo de emissão 3 (cobrança registrada com emissão pelo banco) ``` -------------------------------- ### Initialize and Configure ACBrLibConsultaCNPJ in Android Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Android/ConsultaCNPJ/README.md Demonstrates the initialization of ACBrLibConsultaCNPJ, setting up the configuration file path, and applying basic settings like enabling the web service. Ensure to use getFilesDir() in production for secure storage. ```java import br.com.acbr.lib.consultacnpj.ACBrLibConsultaCNPJ; import java.io.File; public class MainActivity extends AppCompatActivity { private ACBrLibConsultaCNPJ acbrlibconsultacnpj; private File appDir; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //dica: defina um appDir, como diretório base para arquivos de configuração, certificados, schemas, etc. Ajuste conforme a estrutura do seu app. // em desenvolvimento, appDir pode ser getFilesDir() ou getExternalFilesDir(null). // Em produção, use sempre getFilesDir() para garantir acesso seguro e privado. appDir = getFilesDir(); if (!appDir.exists()) { appDir.mkdirs(); } // Inicialize a biblioteca String eArquivoConfig = appDir.getAbsolutePath() + "/ACBrLib.ini"; String chaveCrypt = ""; acbrlibconsultacnpj = new ACBrLibConsultaCNPJ(eArquivoConfig, chaveCrypt); aplicarConfiguracoes(); // finalizar lib em onDestroy @Override protected void onDestroy() { super.onDestroy(); try { acbrlibconsultacnpj.finalizar(); } catch (Exception e) { e.printStackTrace(); } } // Método para aplicar as configurações mínimas da ACBrLibConsultaCNPJ: private void aplicarConfiguracoes() { try { acbrlibconsultacnpj.inicializar(); acbrlibconsultacnpj.configGravarValor( "ConsultaCNPJ", "WebService", "1" ); acbrlibconsultacnpj.configGravar(); }catch (Exception e) { e.printStackTrace(); } } //Exemplo de código para consulta de CNPJ utilizando a ACBrLibConsultaCNPJ. private void onClick(View view) { try { String respostaCNPJ = acbrlibconsultacnpj.consultar("12345678000195"); }catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### ECF.TimeOut Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrMonitorPLUS/Lazarus/ACBrMonitor-change-log.txt Gets the current timeout value for ECF operations. ```APIDOC ## ECF.TimeOut ### Description Returns the current timeout value for ECF operations. ### Method ECF.TimeOut : Integer ``` -------------------------------- ### Log PGWebLib Update Status Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrTEFD/ACBr_TEFD-change-log.txt The Initialize method logs the status of the 'PGWebLibAtualiza' environment variable. ```Pascal Method "TACBrTEFPGWebAPI.Inicializar", writes to the Log the state of the environment variable "PGWebLibAtualiza" ``` -------------------------------- ### Get ECF Timeout Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrMonitorPLUS/Lazarus/ACBrMonitor-change-log.txt Retrieves the current timeout value configured for ECF operations. ```Pascal ECF.TimeOut ``` -------------------------------- ### Import Private Key with BEGIN PRIVATE KEY Header Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrOpenSSL/ACBrOpenSSL-change-log.txt Modified to correctly import Private Key files that contain the header '-----BEGIN PRIVATE KEY-----'. ```Pascal [*] Alterao para importar corretamente arquivos de Chave Privada que possuem o cabealho: "----BEGIN PRIVATE KEY-----" ``` -------------------------------- ### Initialize Metro Server Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrLib/Demos/Android/ReactNative/CEP/README.md Start the Metro bundler server, which is required for developing React Native applications. This command should be run in the project's root directory. ```bash npm start ``` -------------------------------- ### LEITURA_X Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Projetos/ACBrMonitorPLUS/Lazarus/Exemplos/Oracle.txt Emits the report of Reading X. This is often required at the beginning of the day or each start of a paper roll. ```APIDOC ## LEITURA_X ### Description Emits the fiscal printer's Reading X report. ### Method ``` FUNCTION LEITURA_X RETURN VARCHAR2 ``` ### Parameters None ### Request Example ``` v_comando := 'Ecf.LeituraX'; v_parametros := ''; RETURN(EXECUTA_CMD(v_comando,v_parametros,v_retorno)); ``` ### Response Returns the status of the operation. ``` -------------------------------- ### Get Signature Element in ACBrDFeUtil Source: https://github.com/mirrorprojetoacbr/acbr/blob/master/Fontes/ACBrDFe/ACBrDFe-change-log.txt Adds a method to retrieve the signature element, useful for DSA operations. ```Pascal "SignatureElement: String" ```