-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jvoliveiraGN/main
Release 1.0
- Loading branch information
Showing
79 changed files
with
2,122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:prettier/recommended", | ||
"prettier" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier" | ||
], | ||
"rules": { | ||
|
||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"node": { | ||
"paths": [ | ||
"src", | ||
"examples" | ||
], | ||
"extensions": [ | ||
".js", | ||
".jsx", | ||
".ts", | ||
".tsx" | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
*.p12 | ||
simulaMod.ts | ||
teste.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 100, | ||
"tabWidth": 4, | ||
"singleQuote": true, | ||
"jsxBracketSameLine": true, | ||
"trailingComma": "es5", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export = { | ||
// PRODUÇÃO = false | ||
// HOMOLOGAÇÃO = true | ||
sandbox: false, | ||
|
||
// CREDENCIAIS DE PRODUÇÃO | ||
clientIdProducao: '', | ||
clientSecretProducao: '', | ||
pathCertProducao: '', | ||
|
||
// CREDENCIAIS DE HOMOLOGAÇÃO | ||
clientIdHomologacao: '', | ||
clientSecretHomologacao: '', | ||
pathCertHomologacao: '', | ||
|
||
// VALIDAR MTLS? | ||
validateMtls: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.cancelCarnet(params).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
parcel: 1, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.cancelParcel(params).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const body = { | ||
items: [ | ||
{ | ||
name: 'Carnet Item 1', | ||
value: 1000, | ||
amount: 2, | ||
}, | ||
], | ||
customer: { | ||
name: 'Gorbadoc Oldbuck', | ||
email: '[email protected]', | ||
cpf: '94271564656', | ||
birth: '1977-01-15', | ||
phone_number: '5144916523', | ||
}, | ||
repeats: 12, | ||
split_items: false, | ||
expire_at: '2022-01-05', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.createCarnet({}, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 1001, | ||
}; | ||
|
||
const body = { | ||
description: 'This carnet is about a service', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.createCarnetHistory(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.detailCarnet(params).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 1002, | ||
}; | ||
|
||
const body = { | ||
email: '[email protected]', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.resendCarnet(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 1002, | ||
parcel: 1, | ||
}; | ||
|
||
const body = { | ||
email: '[email protected]', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.resendParcel(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 26812, | ||
parcel: 5, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.settleCarnetParcel(params).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 1004, | ||
}; | ||
|
||
const body = { | ||
notification_url: 'http://yourdomain.com', | ||
custom_id: 'my_new_id', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.updateCarnetMetadata(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 1008, | ||
parcel: 1 | ||
}; | ||
|
||
const body = { | ||
expire_at: '2020-12-12', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.updateParcel(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.cancelCharge(params).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
}; | ||
|
||
const body = { | ||
billet_discount: 0, | ||
card_discount: 0, | ||
message: '', | ||
expire_at: '2021-01-05', | ||
request_delivery_address: false, | ||
payment_method: 'all', | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.chargeLink(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const params = { | ||
id: 0, | ||
}; | ||
|
||
const body = { | ||
payment: { | ||
banking_billet: { | ||
expire_at: '2021-01-05', | ||
customer: { | ||
name: 'Gorbadoc Oldbuck', | ||
email: '[email protected]', | ||
cpf: '94271564656', | ||
birth: '1977-01-15', | ||
phone_number: '5144916523', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.payCharge(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const body = { | ||
payment: { | ||
credit_card: { | ||
installments: 1, | ||
payment_token: '6426f3abd8688639c6772963669bbb8e0eb3c319', | ||
billing_address: { | ||
street: 'Av. JK', | ||
number: 909, | ||
neighborhood: 'Bauxita', | ||
zipcode: '35400000', | ||
city: 'Ouro Preto', | ||
state: 'MG', | ||
}, | ||
customer: { | ||
name: 'Gorbadoc Oldbuck', | ||
email: '[email protected]', | ||
cpf: '94271564656', | ||
birth: '1977-01-15', | ||
phone_number: '5144916523', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const params = { | ||
id: 1000, | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.payCharge(params, body).then(console.log).catch(console.log).done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable import/extensions */ | ||
/* eslint-disable import/no-unresolved */ | ||
import Gerencianet from 'gn-api-sdk-typescript'; | ||
import options from '../../config'; | ||
|
||
const body = { | ||
items: [ | ||
{ | ||
name: 'Product 1', | ||
value: 1000, | ||
amount: 2, | ||
}, | ||
], | ||
shippings: [ | ||
{ | ||
name: 'Default Shipping Cost', | ||
value: 100, | ||
}, | ||
], | ||
}; | ||
|
||
const gerencianet = Gerencianet(options); | ||
|
||
gerencianet.createCharge({}, body).then(console.log).catch(console.log).done(); |
Oops, something went wrong.