Socket
Socket
Sign inDemoInstall

gn-api-sdk-node

Package Overview
Dependencies
11
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gn-api-sdk-node

Module for integration with Gerencianet API


Version published
Weekly downloads
1.8K
decreased by-1.15%
Maintainers
5
Install size
2.20 MB
Created
Weekly downloads
 

Readme

Source

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 git@github.com: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

Keywords

FAQs

Last updated on 27 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc