Giter Club home page Giter Club logo

warleymendeslopes / gn-api-sdk-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gerencianet/gn-api-sdk-node

0.0 0.0 0.0 392 KB

SDK em NodeJS integrada a API Gerencianet. Esta SDK está preparada para integração à API Pix e API Boletos da Gerencianet, que lhe permite realizar o gerenciamento de cobranças Pix com QR Code e Pix Copia e Cola, boleto/Bolix, carnê, cartão de crédito e muito mais.

Home Page: https://dev.gerencianet.com.br/docs/instalacao-sdk-nodejs

License: MIT License

JavaScript 100.00%

gn-api-sdk-node's Introduction

gn-api-sdk-node

A nodejs module for integration of your backend with the payment services provided by Gerencianet.

Um módulo nodejs para integrar seu backend com os serviços de pagamento da Gerencianet.

NPM

Instalação

$ npm install gn-api-sdk-node

Uso Básico

Importe o módulo:

const Gerencianet = require('gn-api-sdk-node')

Insira suas credenciais e defina se deseja usar o sandbox ou não. Você também pode usar o arquivo examples/credentials.js de modelo.

module.exports = {
	// PRODUÇÃO = false
	// HOMOLOGAÇÃO = true
	sandbox: false,
	client_id: 'seuClientId',
	client_secret: 'seuClientSecret',
	certificate: 'caminho/Ate/O/Certificado/Pix',
}

Instancie o módulo passando as options:

const gerencianet = new Gerencianet(options)

Crie uma cobrança:

let chargeInput = {
	items: [
		{
			name: 'Product A',
			value: 1000,
			amount: 2,
		},
	],
}

gerencianet
	.createCharge({}, chargeInput)
	.then((resposta) => {
		console.log(resposta)
	})
	.catch((error) => {
		console.log(error)
	})

Exemplos

Para executar os exemplos, clone este repo e instale as dependências:

$ git clone [email protected]:gerencianet/gn-api-sdk-node.git
$ cd gn-api-sdk-node/examples
$ npm install

Defina suas credenciais em credentials.js:

module.exports = {
	// PRODUÇÃO = false
	// HOMOLOGAÇÃO = true
	sandbox: false,
	client_id: 'seuClientId',
	client_secret: 'seuClientSecret',
	certificate: 'caminhoAteOCertificadoPix',
}

Em seguida, execute o exemplo que você deseja:

$ node createCharge.js

Documentação

A documentação completa com todos os endpoints disponíveis você encontra em: https://dev.gerencianet.com.br/.

Changelog

CHANGELOG

License

MIT

gn-api-sdk-node's People

Contributors

franciscotfmc avatar jvoliveiragn avatar ceciliadeveza avatar dannielhugo avatar thomazfeitoza avatar filipemata avatar talitacampos avatar dmalberto avatar hiagodotme avatar whintergoncalves avatar giovani-felipe avatar guilhermecotagn avatar sadycoimbraefi avatar thiagogresende avatar felipdc avatar pallomabritogn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.