npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-sicredi

v1.0.4

Published

Uma biblioteca JavaScript para interagir com o WebService EcommResource, para gerenciamento de boletos, do banco Sicredi

Downloads

25

Readme

Node Sicredi

Build Status Coverage Status npm version JavaScript Style Guide

Uma biblioteca em Node.js para interagir com o WebService, EcommResource, do Banco Sicredi, para gerenciamento de boletos. Esta tem como objetivo facilitar a criação, consulta, impressão etc de boletos utilizando Promise.

Instalação

$ npm install node-sicredi --save

Como utilizar

ES6

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

// Utilizando um método
sicredi
  .find({
    dataInicio: '10/10/2018',
    dataFim: '31/12/2018',
    tipoData: 'DATA_EMISSAO',
  })
  .then(data => {
    console.log(data);
  })
  .catch(err => console.log(err));

CommonJS

const Sicredi = require('node-sicredi').default;

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

sicredi
  .find({
    dataInicio: '10/10/2018',
    dataFim: '31/12/2018',
    tipoData: 'DATA_EMISSAO',
  })
  .then(data => {
    console.log(data);
  })
  .catch(err => console.log(err));

Métodos

sicredi.auth('keyMaster')

O método “auth” é responsável por criar uma chave criptografada, denominada chaveTransacao (chamamos de token), baseada na chave master.

Argumento

| Argument | Type | | ----------- | -------- | | keyMaster | string |

Exemplo

import Sicredi from 'node-sicredi';

sicredi = new Sicredi({});
sicredi.auth('keyMaster').then(data => {
  //Chave de transação. Obs: Aqui chamamos de token
});

sicredi.create(body)

O método “create” é responsável pela geração do boleto de Cobrança.

Argumento

| Argument | Type | | -------- | -------- | | body | objeto |

Exemplo

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

const body = {
  nossoNumero: '',
  codigoPagador: '',
  tipoPessoa: '1',
  nome: 'Cliente Teste',
  endereco: 'Rua 1',
  cidade: 'Rio de Janeiro',
  uf: 'RJ',
  cep: '99999999',
  telefone: '9999999999',
  email: '[email protected]',
  especieDocumento: 'B',
  codigoSacadorAvalista: '000',
  seuNumero: '0000000002',
  dataVencimento: '16/05/2019',
  valor: 6,
  tipoDesconto: 'A',
  valorDesconto1: null,
  dataDesconto1: null,
  valorDesconto2: null,
  dataDesconto2: null,
  valorDesconto3: null,
  dataDesconto3: null,
  tipoJuros: 'A',
  juros: null,
  multas: null,
  descontoAntecipado: null,
  informativo: 'teste1',
  mensagem: 'teste',
  codigoMensagem: '',
};

sicredi.create(body).then(data => {
  // Boleto
});

sicredi.find(query)

O método “find” é responsável pela consulta da situação de boletos.

Argumento

| Argument | Type | | -------- | -------- | | query | objeto |

Exemplo

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

const query = {
  nossoNumero: 99999999,
};

sicredi.find(query).then(data => {
  // Array Boleto(s)
});

sicredi.print(query)

O método “print” é responsável pela impressão e reimpressão dos boletos de Cobrança.

Argumento

| Argument | Type | | -------- | -------- | | query | objeto |

Exemplo

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

const query = {
  nossoNumero: 99999999,
};

sicredi.print(query).then(data => {
  // Boleto
});

sicredi.change(body)

O método “change” é responsável por alterar dados dos títulos via serviço.

Arguments

| Argument | Type | | -------- | -------- | | body | objeto |

Exemplo

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({
  token: 'SEU_TOKEN',
  agency: 'AGENCIA',
  assignor: 'CEDENTE',
  station: 'POSTO',
});

const body = {
  agencia: '1234',
  posto: '99',
  cedente: '12345',
  nossoNumero: '999999999',
  seuNumero: '9999999999',
  instrucaoComando: 'ALTERACAO_SEU_NUMERO',
  tipoVencimento: 'VISTA',
};

sicredi.change(body).then(data => {
  //Resposta
});

sicredi.health()

O método “health” é responsável pela verificação da disponibilidade do sistema de Cobrança.

Exemplo

import Sicredi from 'node-sicredi';

const sicredi = new Sicredi({});
sicredi.health().then(data => {
  //Resposta
});

Contribuíndo

Por favor, leia CONTRIBUTING.md para detalhes sobre o processo para enviar pull request.

Autor

| Murilo Sandiego | | :-----------------------------------------------------------------------------: | | Murilo Sandiego |

Olhe também a lista de contribuidores.

License

Este projeto está licencidado sobre a licença MIT - consulte o arquivo LICENSE.md para mais detalhes