Skip to content

Commit 373acd3

Browse files
committed
Atualização de arquivos de configurações, dependências e versão
1 parent aa0c015 commit 373acd3

File tree

8 files changed

+10153
-42
lines changed

8 files changed

+10153
-42
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"env": {
33
"browser": true,
44
"es2021": true,
5-
"node": true
5+
"node": true,
6+
"jest": true
67
},
78
"extends": [
89
"airbnb-base",

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
node_modules
22
*.p12
33
simulaMod.ts
4-
teste.ts
4+
teste.ts
5+
npm-debug.log
6+
coverage/
7+
.idea/
8+
examples/open-accounts/
9+
examples/pix/split/

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
.prettierrc.json
55
package.json
66
README.md
7-
tsconfig.json
7+
tsconfig.json
8+
jest.config.js

.prettierrc.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"printWidth": 100,
3-
"tabWidth": 4,
42
"singleQuote": true,
5-
"jsxBracketSameLine": true,
6-
"trailingComma": "es5",
7-
"semi": true
3+
"trailingComma": "all",
4+
"semi": true,
5+
"tabWidth": 4,
6+
"useTabs": true,
7+
"printWidth": 300
88
}

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ import Gerencianet from 'gn-api-sdk-typescript';
2020

2121
Insira suas credenciais e defina se deseja usar o sandbox ou não.
2222
Você também pode usar o arquivo [examples/config.ts](examples/config.ts) de modelo.
23+
2324
```typescript
2425
export = {
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
4344
var 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

5154
gerencianet
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
7578
export = {
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

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

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
};

0 commit comments

Comments
 (0)