@@ -20,14 +20,15 @@ import Gerencianet from 'gn-api-sdk-typescript';
2020
2121Insira suas credenciais e defina se deseja usar o sandbox ou não.
2222Você também pode usar o arquivo [ examples/config.ts] ( examples/config.ts ) de modelo.
23+
2324``` typescript
2425export = {
25- // PRODUÇÃO = false
26- // HOMOLOGAÇÃO = true
27- sandbox: false ,
28- client_id: ' seuClientId ' ,
29- client_secret: ' seuClientSecret ' ,
30- pix_cert : ' caminhoAteOCertificadoPix' ,
26+ // PRODUÇÃO = false
27+ // HOMOLOGAÇÃO = true
28+ sandbox: false ,
29+ client_id: ' seuclient_id ' ,
30+ client_secret: ' seuclient_secret ' ,
31+ certificate : ' caminhoAteOCertificadoPix' ,
3132};
3233```
3334
@@ -41,22 +42,24 @@ Crie uma cobrança:
4142
4243``` typescript
4344var body = {
44- items: [{
45- name: ' Product A' ,
46- value: 1000 ,
47- amount: 2
48- }]
49- }
45+ items: [
46+ {
47+ name: ' Product A' ,
48+ value: 1000 ,
49+ amount: 2 ,
50+ },
51+ ],
52+ };
5053
5154gerencianet
52- .createCharge ({}, body )
53- .then ((resposta : any ) => {
54- console .log (resposta );
55- })
56- .catch ((error : any ) => {
57- console .log (error );
58- })
59- .done ();
55+ .createCharge ({}, body )
56+ .then ((resposta : any ) => {
57+ console .log (resposta );
58+ })
59+ .catch ((error : Promise < any > ) => {
60+ console .log (error );
61+ })
62+ .done ();
6063```
6164
6265## Exemplos
@@ -73,12 +76,12 @@ Defina suas credenciais em config.ts:
7376
7477``` typescript
7578export = {
76- // PRODUÇÃO = false
77- // HOMOLOGAÇÃO = true
78- sandbox: false ,
79- client_id: ' seuClientId ' ,
80- client_secret: ' seuClientSecret ' ,
81- pix_cert : ' caminhoAteOCertificadoPix' ,
79+ // PRODUÇÃO = false
80+ // HOMOLOGAÇÃO = true
81+ sandbox: false ,
82+ client_id: ' seuclient_id ' ,
83+ client_secret: ' seuclient_secret ' ,
84+ certificate : ' caminhoAteOCertificadoPix' ,
8285};
8386```
8487
@@ -88,7 +91,6 @@ Em seguida, execute o exemplo que você deseja:
8891$ ts-node createCharge.ts
8992```
9093
91-
9294## Documentação
9395
9496A documentação completa com todos os endpoints disponíveis você encontra em: https://dev.gerencianet.com.br/ .
0 commit comments