Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
gn-api-sdk-typescript
Advanced tools
A Typescript module for integration of your backend with the payment services provided by Gerencianet.
Um módulo Typescript para integrar seu backend com os serviços de pagamento da Gerencianet.
$ npm install gn-api-sdk-typescript
Importe o módulo:
import Gerencianet from 'gn-api-sdk-typescript';
Insira suas credenciais e defina se deseja usar o sandbox ou não. Você também pode usar o arquivo examples/config.ts de modelo.
export = {
// PRODUÇÃO = false
// HOMOLOGAÇÃO = true
sandbox: false,
client_id: 'seuclient_id',
client_secret: 'seuclient_secret',
certificate: 'caminhoAteOCertificadoPix',
};
Instancie o módulo passando as options:
const gerencianet = Gerencianet(options);
Crie uma cobrança:
var body = {
items: [
{
name: 'Product A',
value: 1000,
amount: 2,
},
],
};
gerencianet
.createCharge({}, body)
.then((resposta: any) => {
console.log(resposta);
})
.catch((error: Promise<any>) => {
console.log(error);
})
.done();
Para executar os exemplos, clone este repo e instale as dependências:
$ git clone git@github.com:gerencianet/gn-api-sdk-typescript.git
$ cd gn-api-sdk-typescript/examples
$ npm install
Defina suas credenciais em config.ts:
export = {
// PRODUÇÃO = false
// HOMOLOGAÇÃO = true
sandbox: false,
client_id: 'seuclient_id',
client_secret: 'seuclient_secret',
certificate: 'caminhoAteOCertificadoPix',
};
Em seguida, execute o exemplo que você deseja:
$ ts-node createCharge.ts
A documentação completa com todos os endpoints disponíveis você encontra em: https://dev.gerencianet.com.br/.
FAQs
Module for integration with Gerencianet API"
The npm package gn-api-sdk-typescript receives a total of 1,691 weekly downloads. As such, gn-api-sdk-typescript popularity was classified as popular.
We found that gn-api-sdk-typescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.