diff --git a/examples/charges/billet/cancelBillet.ts b/examples/charges/billet/cancelBillet.ts new file mode 100644 index 0000000..f552b2d --- /dev/null +++ b/examples/charges/billet/cancelBillet.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/no-unresolved */ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/createBilletHistory.ts b/examples/charges/billet/createBilletHistory.ts new file mode 100644 index 0000000..1f2d57d --- /dev/null +++ b/examples/charges/billet/createBilletHistory.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1001, +}; + +const body = { + description: 'This charge was not fully paid', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createChargeHistory(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/createCharge.ts b/examples/charges/billet/createCharge.ts new file mode 100644 index 0000000..7882929 --- /dev/null +++ b/examples/charges/billet/createCharge.ts @@ -0,0 +1,30 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + items: [ + { + name: 'Product 1', + value: 1000, + amount: 2, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createCharge({}, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/createOneStepBillet.ts b/examples/charges/billet/createOneStepBillet.ts new file mode 100755 index 0000000..161fb3d --- /dev/null +++ b/examples/charges/billet/createOneStepBillet.ts @@ -0,0 +1,43 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + payment: { + banking_billet: { + expire_at: '2024-09-20', + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, + + items: [ + { + name: 'Product 1', + value: 500, + amount: 1, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createOneStepCharge([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/defineBalanceSheetBillet.ts b/examples/charges/billet/defineBalanceSheetBillet.ts new file mode 100755 index 0000000..ef8ecf3 --- /dev/null +++ b/examples/charges/billet/defineBalanceSheetBillet.ts @@ -0,0 +1,83 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + title: 'Balancete Demonstrativo', + body: [ + { + header: 'Demonstrativo de Consumo', + tables: [ + { + rows: [ + [ + { + align: 'left', + color: '#000000', + style: 'bold', + text: 'Exemplo de despesa', + colspan: 2, + }, + { + align: 'left', + color: '#000000', + style: 'bold', + text: 'Total lançado', + colspan: 2, + }, + ], + [ + { + align: 'left', + color: '#000000', + style: 'normal', + text: 'Instalação', + colspan: 2, + }, + { + align: 'left', + color: '#000000', + style: 'normal', + text: 'R$ 100,00', + colspan: 2, + }, + ], + ], + }, + ], + }, + { + header: 'Balancete Geral', + tables: [ + { + rows: [ + [ + { + align: 'left', + color: '#000000', + style: 'normal', + text: 'Confira na documentação da Gerencianet todas as configurações possíveis de um boleto balancete.', + colspan: 4, + }, + ], + ], + }, + ], + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .defineBalanceSheetBillet(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/defineBilletPayMethod.ts b/examples/charges/billet/defineBilletPayMethod.ts new file mode 100644 index 0000000..68eb17d --- /dev/null +++ b/examples/charges/billet/defineBilletPayMethod.ts @@ -0,0 +1,33 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + payment: { + banking_billet: { + expire_at: '2023-12-01', + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .definePayMethod(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/detailBillet.ts b/examples/charges/billet/detailBillet.ts new file mode 100644 index 0000000..184ed6f --- /dev/null +++ b/examples/charges/billet/detailBillet.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/sendBilletEmail.ts b/examples/charges/billet/sendBilletEmail.ts new file mode 100644 index 0000000..bb2d961 --- /dev/null +++ b/examples/charges/billet/sendBilletEmail.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1000, +}; + +const body = { + email: 'oldbuck@gerencianet.com.br', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .sendBilletEmail(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/settleBillet.ts b/examples/charges/billet/settleBillet.ts new file mode 100644 index 0000000..6ea59d0 --- /dev/null +++ b/examples/charges/billet/settleBillet.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 553834, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .settleCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/updateBillet.ts b/examples/charges/billet/updateBillet.ts new file mode 100644 index 0000000..e1fd9e6 --- /dev/null +++ b/examples/charges/billet/updateBillet.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1008, +}; + +const body = { + expire_at: '2024-12-12', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateBillet(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/billet/updateBilletMetadata.ts b/examples/charges/billet/updateBilletMetadata.ts new file mode 100644 index 0000000..34e30b2 --- /dev/null +++ b/examples/charges/billet/updateBilletMetadata.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1008, +}; + +const body = { + notification_url: 'http://yourdomain.com', + custom_id: 'my_new_id', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateChargeMetadata(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/cancelCard.ts b/examples/charges/card/cancelCard.ts new file mode 100644 index 0000000..4959d58 --- /dev/null +++ b/examples/charges/card/cancelCard.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/createCardHistory.ts b/examples/charges/card/createCardHistory.ts new file mode 100644 index 0000000..1f2d57d --- /dev/null +++ b/examples/charges/card/createCardHistory.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1001, +}; + +const body = { + description: 'This charge was not fully paid', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createChargeHistory(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/createCharge.ts b/examples/charges/card/createCharge.ts new file mode 100644 index 0000000..7882929 --- /dev/null +++ b/examples/charges/card/createCharge.ts @@ -0,0 +1,30 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + items: [ + { + name: 'Product 1', + value: 1000, + amount: 2, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createCharge({}, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/createOneStepCard.ts b/examples/charges/card/createOneStepCard.ts new file mode 100755 index 0000000..2b94192 --- /dev/null +++ b/examples/charges/card/createOneStepCard.ts @@ -0,0 +1,52 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + payment: { + credit_card: { + installments: 1, + payment_token: '83d52dbd590d9ebc991938c711ddd31f65df89a5', + billing_address: { + street: 'Street 3', + number: 10, + neighborhood: 'Bauxita', + zipcode: '35400000', + city: 'Ouro Preto', + state: 'MG', + }, + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, + + items: [ + { + name: 'Product 1', + value: 1000, + amount: 2, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createOneStepCharge([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/defineCardPayMethod.ts b/examples/charges/card/defineCardPayMethod.ts new file mode 100644 index 0000000..a428a1c --- /dev/null +++ b/examples/charges/card/defineCardPayMethod.ts @@ -0,0 +1,42 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +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: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const params = { + id: 1000, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .definePayMethod(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/detailCard.ts b/examples/charges/card/detailCard.ts new file mode 100644 index 0000000..184ed6f --- /dev/null +++ b/examples/charges/card/detailCard.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/getInstallments.ts b/examples/charges/card/getInstallments.ts new file mode 100644 index 0000000..4d073c8 --- /dev/null +++ b/examples/charges/card/getInstallments.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + brand: 'visa', + total: 5000, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .getInstallments(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/card/updateCardMetadata.ts b/examples/charges/card/updateCardMetadata.ts new file mode 100644 index 0000000..34e30b2 --- /dev/null +++ b/examples/charges/card/updateCardMetadata.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1008, +}; + +const body = { + notification_url: 'http://yourdomain.com', + custom_id: 'my_new_id', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateChargeMetadata(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/cancelCarnet.ts b/examples/charges/carnet/cancelCarnet.ts new file mode 100644 index 0000000..ed53301 --- /dev/null +++ b/examples/charges/carnet/cancelCarnet.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelCarnet(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/cancelCarnetParcel.ts b/examples/charges/carnet/cancelCarnetParcel.ts new file mode 100644 index 0000000..77f9de4 --- /dev/null +++ b/examples/charges/carnet/cancelCarnetParcel.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, + parcel: 1, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelCarnetParcel(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/createCarnet.ts b/examples/charges/carnet/createCarnet.ts new file mode 100644 index 0000000..60d82ad --- /dev/null +++ b/examples/charges/carnet/createCarnet.ts @@ -0,0 +1,34 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + items: [ + { + name: 'Carnet Item 1', + value: 1000, + amount: 2, + }, + ], + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + repeats: 12, + split_items: false, + expire_at: '2023-01-01', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createCarnet({}, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/createCarnetHistory.ts b/examples/charges/carnet/createCarnetHistory.ts new file mode 100644 index 0000000..e78d960 --- /dev/null +++ b/examples/charges/carnet/createCarnetHistory.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1001, +}; + +const body = { + description: 'This carnet is about a service', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createCarnetHistory(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/detailCarnet.ts b/examples/charges/carnet/detailCarnet.ts new file mode 100644 index 0000000..4184a3f --- /dev/null +++ b/examples/charges/carnet/detailCarnet.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailCarnet(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/sendCarnetEmail.ts b/examples/charges/carnet/sendCarnetEmail.ts new file mode 100644 index 0000000..a9b18ec --- /dev/null +++ b/examples/charges/carnet/sendCarnetEmail.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1002, +}; + +const body = { + email: 'oldbuck@gerencianet.com.br', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .sendCarnetEmail(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/sendCarnetParcelEmail.ts b/examples/charges/carnet/sendCarnetParcelEmail.ts new file mode 100644 index 0000000..3a8e247 --- /dev/null +++ b/examples/charges/carnet/sendCarnetParcelEmail.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1002, + parcel: 1, +}; + +const body = { + email: 'oldbuck@gerencianet.com.br', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .resendParcel(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/settleCarnet.ts b/examples/charges/carnet/settleCarnet.ts new file mode 100644 index 0000000..bd195cb --- /dev/null +++ b/examples/charges/carnet/settleCarnet.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 26812, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .settleCarnet(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/settleCarnetParcel.ts b/examples/charges/carnet/settleCarnetParcel.ts new file mode 100644 index 0000000..3f5e2b5 --- /dev/null +++ b/examples/charges/carnet/settleCarnetParcel.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 26812, + parcel: 5, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .settleCarnetParcel(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/updateCarnetMetadata.ts b/examples/charges/carnet/updateCarnetMetadata.ts new file mode 100644 index 0000000..df93bec --- /dev/null +++ b/examples/charges/carnet/updateCarnetMetadata.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1004, +}; + +const body = { + notification_url: 'http://yourdomain.com', + custom_id: 'my_new_id', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateCarnetMetadata(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/carnet/updateCarnetParcel.ts b/examples/charges/carnet/updateCarnetParcel.ts new file mode 100644 index 0000000..2b28858 --- /dev/null +++ b/examples/charges/carnet/updateCarnetParcel.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 25093006, + parcel: 1, +}; + +const body = { + expire_at: '2023-12-12', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateCarnetParcel(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/marketplace/createOneStepBilletMarketplace.ts b/examples/charges/marketplace/createOneStepBilletMarketplace.ts new file mode 100755 index 0000000..4f4a831 --- /dev/null +++ b/examples/charges/marketplace/createOneStepBilletMarketplace.ts @@ -0,0 +1,58 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + payment: { + banking_billet: { + expire_at: '2024-09-20', + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, + + items: [ + { + name: 'Product 1', + value: 500, + amount: 1, + marketplace: { + // Defina 1, para a tarifa ser descontada apenas da conta que emitiu a cobrança + // Defina 2 para a tarifa ser descontada proporcionalmente ao percentual definido para cada conta que receberá o repasse + mode: 2, + repasses: [ + { + payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', + percentage: 2500, + }, + { + payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', + percentage: 1500, + }, + ], + }, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createOneStepCharge([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/marketplace/createOneStepCardMarketplace.ts b/examples/charges/marketplace/createOneStepCardMarketplace.ts new file mode 100755 index 0000000..795d977 --- /dev/null +++ b/examples/charges/marketplace/createOneStepCardMarketplace.ts @@ -0,0 +1,67 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + payment: { + credit_card: { + installments: 1, + payment_token: 'InsiraAquiUmPayeementeCode', + billing_address: { + street: 'Street 3', + number: 10, + neighborhood: 'Bauxita', + zipcode: '35400000', + city: 'Ouro Preto', + state: 'MG', + }, + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, + + items: [ + { + name: 'Product 1', + value: 500, + amount: 1, + marketplace: { + // Defina 1, para a tarifa ser descontada apenas da conta que emitiu a cobrança + // Defina 2 para a tarifa ser descontada proporcionalmente ao percentual definido para cada conta que receberá o repasse + mode: 2, + repasses: [ + { + payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', + percentage: 2500, + }, + { + payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', + percentage: 1500, + }, + ], + }, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createOneStepCharge([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/notification/getNotification.ts b/examples/charges/notification/getNotification.ts new file mode 100644 index 0000000..cb99cb2 --- /dev/null +++ b/examples/charges/notification/getNotification.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + token: '252948279264ee47e117cb099ef81', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .getNotification(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/cancelLink.ts b/examples/charges/payment-link/cancelLink.ts new file mode 100644 index 0000000..4959d58 --- /dev/null +++ b/examples/charges/payment-link/cancelLink.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/createCharge.ts b/examples/charges/payment-link/createCharge.ts new file mode 100644 index 0000000..7882929 --- /dev/null +++ b/examples/charges/payment-link/createCharge.ts @@ -0,0 +1,30 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + items: [ + { + name: 'Product 1', + value: 1000, + amount: 2, + }, + ], + shippings: [ + { + name: 'Default Shipping Cost', + value: 100, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createCharge({}, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/createChargeLinkHistory.ts b/examples/charges/payment-link/createChargeLinkHistory.ts new file mode 100644 index 0000000..1f2d57d --- /dev/null +++ b/examples/charges/payment-link/createChargeLinkHistory.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1001, +}; + +const body = { + description: 'This charge was not fully paid', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createChargeHistory(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/createOneStepLink.ts b/examples/charges/payment-link/createOneStepLink.ts new file mode 100755 index 0000000..9bff49a --- /dev/null +++ b/examples/charges/payment-link/createOneStepLink.ts @@ -0,0 +1,35 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + settings: { + billet_discount: 1, + message: '', + expire_at: '2023-12-01', + request_delivery_address: false, + payment_method: 'all', + }, + items: [ + { + name: 'Product 1', + value: 500, + amount: 1, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createOneStepLink(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/defineLinkPayMethod.ts b/examples/charges/payment-link/defineLinkPayMethod.ts new file mode 100755 index 0000000..05c7d1d --- /dev/null +++ b/examples/charges/payment-link/defineLinkPayMethod.ts @@ -0,0 +1,27 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + billet_discount: 0, + card_discount: 0, + message: '', + expire_at: '2022-12-01', + request_delivery_address: false, + payment_method: 'all', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .defineLinkPayMethod(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/detailLink.ts b/examples/charges/payment-link/detailLink.ts new file mode 100644 index 0000000..184ed6f --- /dev/null +++ b/examples/charges/payment-link/detailLink.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/sendLinkEmail.ts b/examples/charges/payment-link/sendLinkEmail.ts new file mode 100644 index 0000000..eca6628 --- /dev/null +++ b/examples/charges/payment-link/sendLinkEmail.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1000, +}; + +const body = { + email: 'oldbuck@gerencianet.com.br', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .sendLinkEmail(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/updateLink.ts b/examples/charges/payment-link/updateLink.ts new file mode 100755 index 0000000..fcbb31b --- /dev/null +++ b/examples/charges/payment-link/updateLink.ts @@ -0,0 +1,27 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + billet_discount: 0, + card_discount: 0, + message: '', + expire_at: '2024-12-01', + request_delivery_address: false, + payment_method: 'all', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateChargeLink(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/payment-link/updateLinkMetadata.ts b/examples/charges/payment-link/updateLinkMetadata.ts new file mode 100644 index 0000000..34e30b2 --- /dev/null +++ b/examples/charges/payment-link/updateLinkMetadata.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1008, +}; + +const body = { + notification_url: 'http://yourdomain.com', + custom_id: 'my_new_id', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateChargeMetadata(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/cancelSubscription.ts b/examples/charges/subscription/cancelSubscription.ts new file mode 100644 index 0000000..dbabdcf --- /dev/null +++ b/examples/charges/subscription/cancelSubscription.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .cancelSubscription(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createCharge.ts b/examples/charges/subscription/createCharge.ts new file mode 100644 index 0000000..9d35a52 --- /dev/null +++ b/examples/charges/subscription/createCharge.ts @@ -0,0 +1,39 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const planBody = { + name: 'My first plan', + repeats: 24, + interval: 2, +}; + +const subscriptionBody = { + items: [ + { + name: 'Product 1', + value: 1000, + amount: 2, + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +function createSubscription(response) { + const params = { + id: response.data.plan_id, + }; + + return gerencianet.createSubscription(params, subscriptionBody); +} + +gerencianet + .createPlan({}, planBody) + .then(createSubscription) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createOneStepBilletSubscription.ts b/examples/charges/subscription/createOneStepBilletSubscription.ts new file mode 100644 index 0000000..5be5b6d --- /dev/null +++ b/examples/charges/subscription/createOneStepBilletSubscription.ts @@ -0,0 +1,40 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + items: [ + { + name: 'Product One', + value: 600, + amount: 1, + }, + ], + payment: { + banking_billet: { + expire_at: '2024-09-20', + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .oneStepSubscription(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createOneStepCardSubscription.ts b/examples/charges/subscription/createOneStepCardSubscription.ts new file mode 100644 index 0000000..00979eb --- /dev/null +++ b/examples/charges/subscription/createOneStepCardSubscription.ts @@ -0,0 +1,49 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + items: [ + { + name: 'Product One', + value: 600, + amount: 1, + }, + ], + payment: { + credit_card: { + installments: 1, + payment_token: '83d52dbd590d9ebc991938c711ddd31f65df89a5', + billing_address: { + street: 'Street 3', + number: 10, + neighborhood: 'Bauxita', + zipcode: '35400000', + city: 'Ouro Preto', + state: 'MG', + }, + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .oneStepSubscription(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createOneStepSubscriptionLink.ts b/examples/charges/subscription/createOneStepSubscriptionLink.ts new file mode 100644 index 0000000..25117d4 --- /dev/null +++ b/examples/charges/subscription/createOneStepSubscriptionLink.ts @@ -0,0 +1,33 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + items: [ + { + name: 'Product One', + value: 600, + amount: 1, + }, + ], + settings: { + payment_method: 'all', + expire_at: '2022-12-15', + request_delivery_address: false, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .oneStepSubscriptionLink(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createPlan.ts b/examples/charges/subscription/createPlan.ts new file mode 100644 index 0000000..761f903 --- /dev/null +++ b/examples/charges/subscription/createPlan.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = {}; + +const body = { + name: 'My first plan', + repeats: 24, + interval: 2, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createPlan(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/createSubscriptionHistory.ts b/examples/charges/subscription/createSubscriptionHistory.ts new file mode 100755 index 0000000..167717f --- /dev/null +++ b/examples/charges/subscription/createSubscriptionHistory.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1001, +}; + +const body = { + description: 'This subscription is about a service', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createSubscriptionHistory(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/defineSubscriptionBillet.ts b/examples/charges/subscription/defineSubscriptionBillet.ts new file mode 100644 index 0000000..596a887 --- /dev/null +++ b/examples/charges/subscription/defineSubscriptionBillet.ts @@ -0,0 +1,33 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + payment: { + banking_billet: { + expire_at: '2024-09-20', + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .defineSubscriptionPayMethod(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/defineSubscriptionCard.ts b/examples/charges/subscription/defineSubscriptionCard.ts new file mode 100644 index 0000000..5932f56 --- /dev/null +++ b/examples/charges/subscription/defineSubscriptionCard.ts @@ -0,0 +1,41 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const body = { + payment: { + credit_card: { + payment_token: '33ffd6d982cd63f767fb2ee5c458cd39e8fc0ea0', + billing_address: { + street: 'Av. JK', + number: 909, + neighborhood: 'Bauxita', + zipcode: '35400000', + city: 'Ouro Preto', + state: 'MG', + }, + customer: { + name: 'Gorbadoc Oldbuck', + email: 'oldbuck@gerencianet.com.br', + cpf: '94271564656', + birth: '1977-01-15', + phone_number: '5144916523', + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .defineSubscriptionPayMethod(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/deletePlan.ts b/examples/charges/subscription/deletePlan.ts new file mode 100644 index 0000000..6ead70a --- /dev/null +++ b/examples/charges/subscription/deletePlan.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .deletePlan(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/detailSubscription.ts b/examples/charges/subscription/detailSubscription.ts new file mode 100644 index 0000000..4e2fb7a --- /dev/null +++ b/examples/charges/subscription/detailSubscription.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailSubscription(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/listPlans.ts b/examples/charges/subscription/listPlans.ts new file mode 100644 index 0000000..e7e69e6 --- /dev/null +++ b/examples/charges/subscription/listPlans.ts @@ -0,0 +1,20 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + name: 'My Plan', + limit: 20, + offset: 0, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .listPlans(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/sendSubscriptionLinkEmail.ts b/examples/charges/subscription/sendSubscriptionLinkEmail.ts new file mode 100644 index 0000000..0a036c8 --- /dev/null +++ b/examples/charges/subscription/sendSubscriptionLinkEmail.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1000, +}; + +const body = { + email: 'oldbuck@gerencianet.com.br', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .sendSubscriptionLinkEmail(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/updatePlan.ts b/examples/charges/subscription/updatePlan.ts new file mode 100755 index 0000000..29a37b1 --- /dev/null +++ b/examples/charges/subscription/updatePlan.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1008, +}; + +const body = { + name: 'My new plan', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updatePlan(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/charges/subscription/updateSubscriptionMetadata.ts b/examples/charges/subscription/updateSubscriptionMetadata.ts new file mode 100644 index 0000000..7fe2fbd --- /dev/null +++ b/examples/charges/subscription/updateSubscriptionMetadata.ts @@ -0,0 +1,23 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1009, +}; + +const body = { + notification_url: 'http://yourdomain.com', + custom_id: 'my_new_id', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateSubscriptionMetadata(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/config.ts b/examples/config.ts deleted file mode 100644 index 13176ec..0000000 --- a/examples/config.ts +++ /dev/null @@ -1,8 +0,0 @@ -export = { - // PRODUÇÃO = false - // HOMOLOGAÇÃO = true - sandbox: false, - client_id: 'seuClientId', - client_secret: 'seuClientSecret', - pix_cert: 'caminhoAteOCertificadoPix', -}; diff --git a/examples/credentials.ts b/examples/credentials.ts new file mode 100644 index 0000000..75f2ab5 --- /dev/null +++ b/examples/credentials.ts @@ -0,0 +1,9 @@ +export default { + // PRODUÇÃO = false + // HOMOLOGAÇÃO = true + sandbox: false, + client_id: 'seuClientId', + client_secret: 'seuClientSecret', + certificate: 'caminhoAteOCertificadoPix', + validateMtls: false, +}; diff --git a/examples/defaults/carnet/cancelCarnet.ts b/examples/defaults/carnet/cancelCarnet.ts deleted file mode 100644 index 6dfcc81..0000000 --- a/examples/defaults/carnet/cancelCarnet.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/cancelParcel.ts b/examples/defaults/carnet/cancelParcel.ts deleted file mode 100644 index 24e040f..0000000 --- a/examples/defaults/carnet/cancelParcel.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/createCarnet.ts b/examples/defaults/carnet/createCarnet.ts deleted file mode 100644 index c4545ef..0000000 --- a/examples/defaults/carnet/createCarnet.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* 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: 'oldbuck@gerencianet.com.br', - 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/createCarnetHistory.ts b/examples/defaults/carnet/createCarnetHistory.ts deleted file mode 100644 index fdc4330..0000000 --- a/examples/defaults/carnet/createCarnetHistory.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/detailCarnet.ts b/examples/defaults/carnet/detailCarnet.ts deleted file mode 100644 index 7a266bf..0000000 --- a/examples/defaults/carnet/detailCarnet.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/resendCarnet.ts b/examples/defaults/carnet/resendCarnet.ts deleted file mode 100644 index d6939cf..0000000 --- a/examples/defaults/carnet/resendCarnet.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* 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: 'oldbuck@gerencianet.com.br', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .resendCarnet(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/resendParcel.ts b/examples/defaults/carnet/resendParcel.ts deleted file mode 100644 index b404a1e..0000000 --- a/examples/defaults/carnet/resendParcel.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* 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: 'oldbuck@gerencianet.com.br', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .resendParcel(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/settleCarnetParcel.ts b/examples/defaults/carnet/settleCarnetParcel.ts deleted file mode 100644 index c4747d7..0000000 --- a/examples/defaults/carnet/settleCarnetParcel.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/updateCarnetMetadata.ts b/examples/defaults/carnet/updateCarnetMetadata.ts deleted file mode 100644 index 6c27759..0000000 --- a/examples/defaults/carnet/updateCarnetMetadata.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/carnet/updateParcel.ts b/examples/defaults/carnet/updateParcel.ts deleted file mode 100644 index 3402beb..0000000 --- a/examples/defaults/carnet/updateParcel.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/cancelCharge.ts b/examples/defaults/charge/cancelCharge.ts deleted file mode 100644 index e1e144e..0000000 --- a/examples/defaults/charge/cancelCharge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/chargeLink.ts b/examples/defaults/charge/chargeLink.ts deleted file mode 100644 index f1a114c..0000000 --- a/examples/defaults/charge/chargeLink.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createBilletPayment.ts b/examples/defaults/charge/createBilletPayment.ts deleted file mode 100644 index b62de4e..0000000 --- a/examples/defaults/charge/createBilletPayment.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* 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: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .payCharge(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createCardPayment.ts b/examples/defaults/charge/createCardPayment.ts deleted file mode 100644 index 4263a0f..0000000 --- a/examples/defaults/charge/createCardPayment.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* 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: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, -}; - -const params = { - id: 1000, -}; - -const gerencianet = Gerencianet(options); - -gerencianet.payCharge(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createCharge.ts b/examples/defaults/charge/createCharge.ts deleted file mode 100644 index e313728..0000000 --- a/examples/defaults/charge/createCharge.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* 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((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeBalanceSheet.ts b/examples/defaults/charge/createChargeBalanceSheet.ts deleted file mode 100644 index 7c57b00..0000000 --- a/examples/defaults/charge/createChargeBalanceSheet.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* 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 = { - title: 'Balancete Demonstrativo', - body: [ - { - header: 'Demonstrativo de Consumo', - tables: [ - { - rows: [ - [ - { - align: 'left', - color: '#000000', - style: 'bold', - text: 'Exemplo de despesa', - colspan: 2, - }, - { - align: 'left', - color: '#000000', - style: 'bold', - text: 'Total lançado', - colspan: 2, - }, - ], - [ - { - align: 'left', - color: '#000000', - style: 'normal', - text: 'Instalação', - colspan: 2, - }, - { - align: 'left', - color: '#000000', - style: 'normal', - text: 'R$ 100,00', - colspan: 2, - }, - ], - ], - }, - ], - }, - { - header: 'Balancete Geral', - tables: [ - { - rows: [ - [ - { - align: 'left', - color: '#000000', - style: 'normal', - text: - 'Confira na documentação da Gerencianet todas as configurações possíveis de um boleto balancete.', - colspan: 4, - }, - ], - ], - }, - ], - }, - ], -}; - -const gerencianet = Gerencianet(options); - -gerencianet.createChargeBalanceSheet(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeHistory.ts b/examples/defaults/charge/createChargeHistory.ts deleted file mode 100644 index a9dbfd3..0000000 --- a/examples/defaults/charge/createChargeHistory.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 charge was not fully paid', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .createChargeHistory(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeOneStep.ts b/examples/defaults/charge/createChargeOneStep.ts deleted file mode 100644 index 966d588..0000000 --- a/examples/defaults/charge/createChargeOneStep.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - payment: { - banking_billet: { - expire_at: '2021-08-30', - customer: { - name: 'Gorbadoc Oldbuck', - email: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, - - items: [ - { - name: 'Product 1', - value: 1000, - amount: 2, - }, - ], - shippings: [ - { - name: 'Default Shipping Cost', - value: 100, - }, - ], -}; - -const gerencianet = Gerencianet(options); - -gerencianet.oneStep([], body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeOneStepBilletMarketPlace.ts b/examples/defaults/charge/createChargeOneStepBilletMarketPlace.ts deleted file mode 100644 index 66754f7..0000000 --- a/examples/defaults/charge/createChargeOneStepBilletMarketPlace.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - payment: { - banking_billet: { - expire_at: '2019-09-20', - customer: { - name: 'Gorbadoc Oldbuck', - email: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, - - items: [ - { - name: 'Product 1', - value: 500, - amount: 1, - marketplace: { - repasses: [ - { - payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', - percentage: 2500, - }, - { - payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', - percentage: 1500, - }, - ], - }, - }, - ], - shippings: [ - { - name: 'Default Shipping Cost', - value: 100, - }, - ], -}; - -const gerencianet = Gerencianet(options); - -gerencianet.oneStep([], body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeOneStepCardMarketPlace.ts b/examples/defaults/charge/createChargeOneStepCardMarketPlace.ts deleted file mode 100644 index f222c98..0000000 --- a/examples/defaults/charge/createChargeOneStepCardMarketPlace.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* 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: 'InsiraAquiUmPayeementeCode', - billing_address: { - street: 'Street 3', - number: 10, - neighborhood: 'Bauxita', - zipcode: '35400000', - city: 'Ouro Preto', - state: 'MG', - }, - customer: { - name: 'Gorbadoc Oldbuck', - email: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, - - items: [ - { - name: 'Product 1', - value: 500, - amount: 1, - marketplace: { - repasses: [ - { - payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', - percentage: 2500, - }, - { - payee_code: 'Insira_aqui_o_indentificador_da_conta_destino', - percentage: 1500, - }, - ], - }, - }, - ], - shippings: [ - { - name: 'Default Shipping Cost', - value: 100, - }, - ], -}; - -const gerencianet = Gerencianet(options); - -gerencianet.oneStep([], body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/createChargeOneStepCreditCard.ts b/examples/defaults/charge/createChargeOneStepCreditCard.ts deleted file mode 100644 index b8efcbf..0000000 --- a/examples/defaults/charge/createChargeOneStepCreditCard.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* 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: '83d52dbd590d9ebc991938c711ddd31f65df89a5', - billing_address: { - street: 'Street 3', - number: 10, - neighborhood: 'Bauxita', - zipcode: '35400000', - city: 'Ouro Preto', - state: 'MG', - }, - customer: { - name: 'Gorbadoc Oldbuck', - email: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, - - items: [ - { - name: 'Product 1', - value: 1000, - amount: 2, - }, - ], - shippings: [ - { - name: 'Default Shipping Cost', - value: 100, - }, - ], -}; - -const gerencianet = Gerencianet(options); - -gerencianet.oneStep([], body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/detailCharge.ts b/examples/defaults/charge/detailCharge.ts deleted file mode 100644 index 880344b..0000000 --- a/examples/defaults/charge/detailCharge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - .detailCharge(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/resendBillet.ts b/examples/defaults/charge/resendBillet.ts deleted file mode 100644 index 4b33c79..0000000 --- a/examples/defaults/charge/resendBillet.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 1000, -}; - -const body = { - email: 'oldbuck@gerencianet.com.br', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .resendBillet(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/settleCharge.ts b/examples/defaults/charge/settleCharge.ts deleted file mode 100644 index c8f0015..0000000 --- a/examples/defaults/charge/settleCharge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 553834, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .settleCharge(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/updateBillet.ts b/examples/defaults/charge/updateBillet.ts deleted file mode 100644 index 4ce776f..0000000 --- a/examples/defaults/charge/updateBillet.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 1008, -}; - -const body = { - expire_at: '2020-12-12', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .updateBillet(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/updateChargeLink.ts b/examples/defaults/charge/updateChargeLink.ts deleted file mode 100644 index 0ac6c16..0000000 --- a/examples/defaults/charge/updateChargeLink.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* 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 - .updateChargeLink(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/charge/updateChargeMetadata.ts b/examples/defaults/charge/updateChargeMetadata.ts deleted file mode 100644 index 4428951..0000000 --- a/examples/defaults/charge/updateChargeMetadata.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 1008, -}; - -const body = { - notification_url: 'http://yourdomain.com', - custom_id: 'my_new_id', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .updateChargeMetadata(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/notification/getNotification.ts b/examples/defaults/notification/getNotification.ts deleted file mode 100644 index 17f9f33..0000000 --- a/examples/defaults/notification/getNotification.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - token: '252948279264ee47e117cb099ef81', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .getNotification(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/others/getInstallments.ts b/examples/defaults/others/getInstallments.ts deleted file mode 100644 index f68cbe3..0000000 --- a/examples/defaults/others/getInstallments.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - brand: 'visa', - total: 5000, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .getInstallments(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/cancelSubscription.ts b/examples/defaults/subscription/cancelSubscription.ts deleted file mode 100644 index 6c94709..0000000 --- a/examples/defaults/subscription/cancelSubscription.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - .cancelSubscription(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/createPlan.ts b/examples/defaults/subscription/createPlan.ts deleted file mode 100644 index d8ecc72..0000000 --- a/examples/defaults/subscription/createPlan.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = {}; - -const body = { - name: 'My first plan', - repeats: 24, - interval: 2, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .createPlan(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/createSubscription.ts b/examples/defaults/subscription/createSubscription.ts deleted file mode 100644 index d285e3b..0000000 --- a/examples/defaults/subscription/createSubscription.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const planBody = { - name: 'My first plan', - repeats: 24, - interval: 2, -}; - -const subscriptionBody = { - items: [ - { - name: 'Product 1', - value: 1000, - amount: 2, - }, - ], -}; - -const gerencianet = Gerencianet(options); - -const createSubscription = (response: any) => { - const params = { - id: response.data.plan_id, - }; - - return gerencianet.createSubscription(params, subscriptionBody); -}; - -gerencianet - .createPlan({}, planBody) - .then(createSubscription) - .then(console.log) - .catch(console.log) - .done(); diff --git a/examples/defaults/subscription/createSubscriptionHistory.ts b/examples/defaults/subscription/createSubscriptionHistory.ts deleted file mode 100644 index 7abcf56..0000000 --- a/examples/defaults/subscription/createSubscriptionHistory.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 subscription is about a service', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .createSubscriptionHistory(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/createSubscriptionPayment.ts b/examples/defaults/subscription/createSubscriptionPayment.ts deleted file mode 100644 index edb1274..0000000 --- a/examples/defaults/subscription/createSubscriptionPayment.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* 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: { - credit_card: { - payment_token: '33ffd6d982cd63f767fb2ee5c458cd39e8fc0ea0', - billing_address: { - street: 'Av. JK', - number: 909, - neighborhood: 'Bauxita', - zipcode: '35400000', - city: 'Ouro Preto', - state: 'MG', - }, - customer: { - name: 'Gorbadoc Oldbuck', - email: 'oldbuck@gerencianet.com.br', - cpf: '94271564656', - birth: '1977-01-15', - phone_number: '5144916523', - }, - }, - }, -}; - -const gerencianet = Gerencianet(options); - -gerencianet.paySubscription(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/deletePlan.ts b/examples/defaults/subscription/deletePlan.ts deleted file mode 100644 index 5f2dde3..0000000 --- a/examples/defaults/subscription/deletePlan.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - .deletePlan(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/detailSubscription.ts b/examples/defaults/subscription/detailSubscription.ts deleted file mode 100644 index 6e04433..0000000 --- a/examples/defaults/subscription/detailSubscription.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - .detailSubscription(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/getPlans.ts b/examples/defaults/subscription/getPlans.ts deleted file mode 100644 index fe02bb5..0000000 --- a/examples/defaults/subscription/getPlans.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - name: 'My Plan', - limit: 20, - offset: 0, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .getPlans(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/updatePlan.ts b/examples/defaults/subscription/updatePlan.ts deleted file mode 100644 index 568b6af..0000000 --- a/examples/defaults/subscription/updatePlan.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 1008, -}; - -const body = { - name: 'My new plan', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .updatePlan(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/defaults/subscription/updateSubscriptionMetadata.ts b/examples/defaults/subscription/updateSubscriptionMetadata.ts deleted file mode 100644 index c181a95..0000000 --- a/examples/defaults/subscription/updateSubscriptionMetadata.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: 1009, -}; - -const body = { - notification_url: 'http://yourdomain.com', - custom_id: 'my_new_id', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .updateSubscriptionMetadata(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/exclusives/account/getAccountBalance.ts b/examples/exclusives/account/getAccountBalance.ts new file mode 100644 index 0000000..628a11a --- /dev/null +++ b/examples/exclusives/account/getAccountBalance.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +gerencianet + .getAccountBalance() + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/account/listAccountConfig.ts b/examples/exclusives/account/listAccountConfig.ts new file mode 100644 index 0000000..34c408f --- /dev/null +++ b/examples/exclusives/account/listAccountConfig.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +gerencianet + .listAccountConfig() + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/account/updateAccountConfig.ts b/examples/exclusives/account/updateAccountConfig.ts new file mode 100644 index 0000000..f4c25ba --- /dev/null +++ b/examples/exclusives/account/updateAccountConfig.ts @@ -0,0 +1,30 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + pix: { + receberSemChave: true, + chaves: { + SUACHAVEPIX: { + recebimento: { + txidObrigatorio: false, + qrCodeEstatico: { + recusarTodos: false, + }, + }, + }, + }, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .updateAccountConfig([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/key/pixCreateEvp.ts b/examples/exclusives/key/pixCreateEvp.ts new file mode 100644 index 0000000..11dff07 --- /dev/null +++ b/examples/exclusives/key/pixCreateEvp.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixCreateEvp() + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/key/pixDeleteEvp.ts b/examples/exclusives/key/pixDeleteEvp.ts new file mode 100644 index 0000000..69ac5f2 --- /dev/null +++ b/examples/exclusives/key/pixDeleteEvp.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + chave: 'SUACHAVEPIX', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDeleteEvp(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/key/pixListEvp.ts b/examples/exclusives/key/pixListEvp.ts new file mode 100644 index 0000000..8934942 --- /dev/null +++ b/examples/exclusives/key/pixListEvp.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixListEvp() + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/report/createReport.ts b/examples/exclusives/report/createReport.ts new file mode 100644 index 0000000..9cfc50f --- /dev/null +++ b/examples/exclusives/report/createReport.ts @@ -0,0 +1,36 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + dataMovimento: '2023-04-24', + tipoRegistros: { + pixRecebido: true, + pixEnviadoChave: true, + pixEnviadoDadosBancarios: true, + estornoPixEnviado: true, + pixDevolucaoEnviada: true, + pixDevolucaoRecebida: true, + tarifaPixEnviado: true, + tarifaPixRecebido: true, + estornoTarifaPixEnviado: true, + saldoDiaAnterior: true, + saldoDia: true, + transferenciaEnviada: true, + transferenciaRecebida: true, + estornoTransferenciaEnviada: true, + tarifaTransferenciaEnviada: true, + estornoTarifaTransferenciaEnviada: true, + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .createReport([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/exclusives/report/detailReport.ts b/examples/exclusives/report/detailReport.ts new file mode 100644 index 0000000..2b0ec8b --- /dev/null +++ b/examples/exclusives/report/detailReport.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: 1, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .detailReport(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/gn/account/gnDetailBalance.ts b/examples/gn/account/gnDetailBalance.ts deleted file mode 100644 index 8a80d42..0000000 --- a/examples/gn/account/gnDetailBalance.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const gerencianet = Gerencianet(options); - -gerencianet - .gnDetailBalance() - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/gn/account/gnDetailSettings.ts b/examples/gn/account/gnDetailSettings.ts deleted file mode 100644 index 2d77001..0000000 --- a/examples/gn/account/gnDetailSettings.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ - -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const gerencianet = Gerencianet(options); - -gerencianet - .gnDetailSettings() - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/gn/account/gnUpdateSettings.ts b/examples/gn/account/gnUpdateSettings.ts deleted file mode 100644 index 54f237f..0000000 --- a/examples/gn/account/gnUpdateSettings.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - pix: { - receberSemChave: true, - chaves: { - SUACHAVEPIX: { - recebimento: { - txidObrigatorio: false, - qrCodeEstatico: { - recusarTodos: false, - }, - }, - }, - }, - }, -}; - -const gerencianet = Gerencianet(options); - -gerencianet.pixUpdateSettings([], body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/gn/key/gnCreateEvp.ts b/examples/gn/key/gnCreateEvp.ts deleted file mode 100644 index c6dffe6..0000000 --- a/examples/gn/key/gnCreateEvp.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ - -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const gerencianet = Gerencianet(options); - -gerencianet - .gnCreateEvp() - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/gn/key/gnDeleteEvp.ts b/examples/gn/key/gnDeleteEvp.ts deleted file mode 100644 index 6f7e742..0000000 --- a/examples/gn/key/gnDeleteEvp.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ - -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - chave: 'SUACHAVEPIX', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .gnDeleteEvp(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/gn/key/gnListEvp.ts b/examples/gn/key/gnListEvp.ts deleted file mode 100644 index bb57e9f..0000000 --- a/examples/gn/key/gnListEvp.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ - -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const gerencianet = Gerencianet(options); - -gerencianet - .gnListEvp() - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/open-finance/config/ofConfigDetail.ts b/examples/open-finance/config/ofConfigDetail.ts new file mode 100644 index 0000000..381d407 --- /dev/null +++ b/examples/open-finance/config/ofConfigDetail.ts @@ -0,0 +1,14 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +gerencianet + .ofConfigDetail() + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/open-finance/config/ofConfigUpdate.ts b/examples/open-finance/config/ofConfigUpdate.ts new file mode 100644 index 0000000..9761284 --- /dev/null +++ b/examples/open-finance/config/ofConfigUpdate.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const body = { + redirectURL: 'https:/suaUrl.com.br/redirect', + webhookURL: 'https://suaUrl.com.br/webhook', +}; + +gerencianet + .ofConfigUpdate([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/open-finance/participants/ofListParticipants.ts b/examples/open-finance/participants/ofListParticipants.ts new file mode 100644 index 0000000..3f94891 --- /dev/null +++ b/examples/open-finance/participants/ofListParticipants.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + nome: 'Gerencianet', +}; + +gerencianet + .ofListParticipants(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/open-finance/payment/ofDevolutionPix.ts b/examples/open-finance/payment/ofDevolutionPix.ts new file mode 100644 index 0000000..4615a86 --- /dev/null +++ b/examples/open-finance/payment/ofDevolutionPix.ts @@ -0,0 +1,22 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const body = { + valor: '0.01', +}; + +const params = { + identificadorPagamento: 'urn:gerencianet:ea807997-9c28-47a7-8ebc-eeb672ea59f0', +}; + +gerencianet + .ofDevolutionPix(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/open-finance/payment/ofListPixPayment.ts b/examples/open-finance/payment/ofListPixPayment.ts new file mode 100644 index 0000000..bf52212 --- /dev/null +++ b/examples/open-finance/payment/ofListPixPayment.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + inicio: '2022-01-01', + fim: '2022-06-30', +}; + +gerencianet + .ofListPixPayment(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/open-finance/payment/ofStartPixPayment.ts b/examples/open-finance/payment/ofStartPixPayment.ts new file mode 100644 index 0000000..6b34ac8 --- /dev/null +++ b/examples/open-finance/payment/ofStartPixPayment.ts @@ -0,0 +1,34 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const body = { + pagador: { + idParticipante: '', + cpf: '', + }, + valor: '0.01', + favorecido: { + contaBanco: { + codigoBanco: '', + agencia: '', + documento: '', + nome: '', + conta: '', + tipoConta: '', + }, + }, + codigoCidadeIBGE: '', + infoPagador: 'Cobrança referente ao pedido X', +}; + +gerencianet + .ofStartPixPayment([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/payments/billets/payDetailBarCode.ts b/examples/payments/billets/payDetailBarCode.ts new file mode 100644 index 0000000..f42826c --- /dev/null +++ b/examples/payments/billets/payDetailBarCode.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + codBarras: '', +}; + +gerencianet + .payDetailBarCode(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/payments/billets/payDetailPayment.ts b/examples/payments/billets/payDetailPayment.ts new file mode 100644 index 0000000..168ef56 --- /dev/null +++ b/examples/payments/billets/payDetailPayment.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + idPagamento: '0000', +}; + +gerencianet + .payDetailPayment(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/payments/billets/payListPayments.ts b/examples/payments/billets/payListPayments.ts new file mode 100644 index 0000000..59082b9 --- /dev/null +++ b/examples/payments/billets/payListPayments.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + dataInicio: '2022-01-01', + dataFim: '2022-06-30', +}; + +gerencianet + .payListPayments(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/payments/billets/payRequestBarCode.ts b/examples/payments/billets/payRequestBarCode.ts new file mode 100644 index 0000000..a5577fa --- /dev/null +++ b/examples/payments/billets/payRequestBarCode.ts @@ -0,0 +1,24 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const gerencianet = new Gerencianet(options); + +const params = { + codBarras: '', +}; + +const body = { + valor: 0, + dataPagamento: '2022-03-10', + descricao: 'Pagamento de boleto, teste API Pagamentos', +}; + +gerencianet + .payRequestBarCode(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/charge/pixCreateCharge.ts b/examples/pix/charge/pixCreateCharge.ts deleted file mode 100644 index 9ac9459..0000000 --- a/examples/pix/charge/pixCreateCharge.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - calendario: { - expiracao: 3600, - }, - devedor: { - cpf: '94271564656', - nome: 'Gorbadock Oldbuck', - }, - valor: { - original: '123.45', - }, - chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na Gerencianet - // o campo abaixo é opcional - infoAdicionais: [ - { - nome: 'Pagamento em', - valor: 'NOME DO SEU ESTABELECIMENTO', - }, - { - nome: 'Pedido', - valor: 'NUMERO DO PEDIDO DO CLIENTE', - }, - ], -}; - -const params = { - txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVq111', -}; - -const gerencianet = Gerencianet(options); - -gerencianet.pixCreateCharge(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/charge/pixCreateImmediateCharge.ts b/examples/pix/charge/pixCreateImmediateCharge.ts deleted file mode 100644 index 7f07218..0000000 --- a/examples/pix/charge/pixCreateImmediateCharge.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - calendario: { - expiracao: 3600, - }, - devedor: { - cpf: '94271564656', - nome: 'Gorbadock Oldbuck', - }, - valor: { - original: '123.45', - }, - chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na Gerencianet - infoAdicionais: [ - { - nome: 'Pagamento em', - valor: 'NOME DO SEU ESTABELECIMENTO', - }, - { - nome: 'Pedido', - valor: 'NUMERO DO PEDIDO DO CLIENTE', - }, - ], -}; - -const params = { - txid: 'dt9BHlyzrb5jrFNAdfEDmDbVqVxdVpHgiO', -}; - -const gerencianet = Gerencianet(options); - -gerencianet.pixCreateImmediateCharge(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/charge/pixDetailCharge.ts b/examples/pix/charge/pixDetailCharge.ts deleted file mode 100644 index a6b5154..0000000 --- a/examples/pix/charge/pixDetailCharge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixDetailCharge(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/charge/pixListCharges.ts b/examples/pix/charge/pixListCharges.ts deleted file mode 100644 index 86c91c4..0000000 --- a/examples/pix/charge/pixListCharges.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - inicio: '2021-01-22T16:01:35Z', - fim: '2021-11-30T20:10:00Z', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixListCharges(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/charge/pixUpdateCharge.ts b/examples/pix/charge/pixUpdateCharge.ts deleted file mode 100644 index f71c2c8..0000000 --- a/examples/pix/charge/pixUpdateCharge.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -// Informe no body somente os dados que deseja atualizar -const body = { - calendario: { - expiracao: 3600, - }, - devedor: { - cpf: '94271564656', - nome: 'Gorbadock Oldbuck', - }, - valor: { - original: '123.45', - }, - chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na Gerencianet - infoAdicionais: [ - { - nome: 'Pagamento em', - valor: 'NOME DO SEU ESTABELECIMENTO', - }, - { - nome: 'Pedido', - valor: 'NUMERO DO PEDIDO DO CLIENTE', - }, - ], -}; - -const params = { - txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', // Informe o TxId da cobrança -}; - -const gerencianet = Gerencianet(options); - -gerencianet.pixUpdateCharge(params, body).then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/cob/pixCreateCharge.ts b/examples/pix/cob/pixCreateCharge.ts new file mode 100644 index 0000000..0a6d013 --- /dev/null +++ b/examples/pix/cob/pixCreateCharge.ts @@ -0,0 +1,42 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + calendario: { + expiracao: 3600, + }, + devedor: { + cpf: '94271564656', + nome: 'Gorbadock Oldbuck', + }, + valor: { + original: '123.45', + }, + chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na gerencianet //o campo abaixo é opcional + infoAdicionais: [ + { + nome: 'Pagamento em', + valor: 'NOME DO SEU ESTABELECIMENTO', + }, + { + nome: 'Pedido', + valor: 'NUMERO DO PEDIDO DO CLIENTE', + }, + ], +}; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVq111', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixCreateCharge(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cob/pixCreateImmediateCharge.ts b/examples/pix/cob/pixCreateImmediateCharge.ts new file mode 100644 index 0000000..8d8ddcf --- /dev/null +++ b/examples/pix/cob/pixCreateImmediateCharge.ts @@ -0,0 +1,38 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + calendario: { + expiracao: 3600, + }, + devedor: { + cpf: '94271564656', + nome: 'Gorbadock Oldbuck', + }, + valor: { + original: '123.45', + }, + chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na gerencianet + infoAdicionais: [ + { + nome: 'Pagamento em', + valor: 'NOME DO SEU ESTABELECIMENTO', + }, + { + nome: 'Pedido', + valor: 'NUMERO DO PEDIDO DO CLIENTE', + }, + ], +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixCreateImmediateCharge([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cob/pixDetailCharge.ts b/examples/pix/cob/pixDetailCharge.ts new file mode 100644 index 0000000..19494cb --- /dev/null +++ b/examples/pix/cob/pixDetailCharge.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDetailCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cob/pixListCharges.ts b/examples/pix/cob/pixListCharges.ts new file mode 100644 index 0000000..37fe2c3 --- /dev/null +++ b/examples/pix/cob/pixListCharges.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2022-01-22T16:01:35Z', + fim: '2022-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixListCharges(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cob/pixUpdateCharge.ts b/examples/pix/cob/pixUpdateCharge.ts new file mode 100644 index 0000000..ac85afb --- /dev/null +++ b/examples/pix/cob/pixUpdateCharge.ts @@ -0,0 +1,43 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +// Informe no body somente os dados que deseja atualizar +const body = { + calendario: { + expiracao: 3600, + }, + devedor: { + cpf: '94271564656', + nome: 'Gorbadock Oldbuck', + }, + valor: { + original: '123.45', + }, + chave: 'SUACHAVEPIX', // Informe sua chave Pix cadastrada na gerencianet + infoAdicionais: [ + { + nome: 'Pagamento em', + valor: 'NOME DO SEU ESTABELECIMENTO', + }, + { + nome: 'Pedido', + valor: 'NUMERO DO PEDIDO DO CLIENTE', + }, + ], +}; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', // Informe o TxId da cobrança +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixUpdateCharge(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cobv/pixCreateDueCharge.ts b/examples/pix/cobv/pixCreateDueCharge.ts new file mode 100644 index 0000000..d052080 --- /dev/null +++ b/examples/pix/cobv/pixCreateDueCharge.ts @@ -0,0 +1,54 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const body = { + calendario: { + dataDeVencimento: '2022-12-01', + validadeAposVencimento: 30, + }, + devedor: { + logradouro: 'Alameda Souza, Numero 80, Bairro Braz', + cidade: 'Recife', + uf: 'PE', + cep: '70011750', + cpf: '12345678909', + nome: 'Francisco da Silva', + }, + valor: { + original: '123.45', + multa: { + modalidade: 2, + valorPerc: '15.00', + }, + juros: { + modalidade: 2, + valorPerc: '2.00', + }, + desconto: { + modalidade: 1, + descontoDataFixa: [ + { + data: '2022 - 11 - 30', + valorPerc: '30.00', + }, + ], + }, + }, + chave: 'suaChavePix', +}; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVq111', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixCreateDueCharge(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cobv/pixDetailDueCharge.ts b/examples/pix/cobv/pixDetailDueCharge.ts new file mode 100644 index 0000000..257b967 --- /dev/null +++ b/examples/pix/cobv/pixDetailDueCharge.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDetailDueCharge(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cobv/pixListDueCharges.ts b/examples/pix/cobv/pixListDueCharges.ts new file mode 100644 index 0000000..bea3f6c --- /dev/null +++ b/examples/pix/cobv/pixListDueCharges.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2023-01-22T16:01:35Z', + fim: '2023-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixListDueCharges(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/cobv/pixUpdateDueCharge.ts b/examples/pix/cobv/pixUpdateDueCharge.ts new file mode 100644 index 0000000..aa8698d --- /dev/null +++ b/examples/pix/cobv/pixUpdateDueCharge.ts @@ -0,0 +1,37 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +// Informe no body somente os dados que deseja atualizar +const body = { + loc: { + id: 789, + }, + devedor: { + logradouro: 'Alameda Souza, Numero 80, Bairro Braz', + cidade: 'Recife', + uf: 'PE', + cep: '70011750', + cpf: '12345678909', + nome: 'Francisco da Silva', + }, + valor: { + original: '123.45', + }, + solicitacaoPagador: 'Cobrança dos serviços prestados.', +}; + +const params = { + txid: 'dt9BHlyzrb5jrFNAdfEDVpHgiOmDbVqVxd', // Informe o TxId da cobrança +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixUpdateDueCharge(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixCreateLocation.ts b/examples/pix/location/pixCreateLocation.ts index f1bf171..2036ef6 100644 --- a/examples/pix/location/pixCreateLocation.ts +++ b/examples/pix/location/pixCreateLocation.ts @@ -1,20 +1,18 @@ /* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; +import options from '../../credentials'; const body = { - tipoCob: 'cob', + tipoCob: 'cob', }; -const gerencianet = Gerencianet(options); +const gerencianet = new Gerencianet(options); gerencianet - .pixCreateLocation([], body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); + .pixCreateLocation([], body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixDetailLocation.ts b/examples/pix/location/pixDetailLocation.ts index 38722ab..2efc55a 100644 --- a/examples/pix/location/pixDetailLocation.ts +++ b/examples/pix/location/pixDetailLocation.ts @@ -1,20 +1,18 @@ /* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; +import options from '../../credentials'; const params = { - id: '95', + id: '95', }; -const gerencianet = Gerencianet(options); +const gerencianet = new Gerencianet(options); gerencianet - .pixDetailLocation(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); + .pixDetailLocation(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixGenerateQRCode.ts b/examples/pix/location/pixGenerateQRCode.ts index d739e64..1cfb4f2 100644 --- a/examples/pix/location/pixGenerateQRCode.ts +++ b/examples/pix/location/pixGenerateQRCode.ts @@ -1,20 +1,18 @@ /* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; +import options from '../../credentials'; const params = { - id: '95', + id: '95', }; -const gerencianet = Gerencianet(options); +const gerencianet = new Gerencianet(options); gerencianet - .pixGenerateQRCode(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); + .pixGenerateQRCode(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixListLocation.ts b/examples/pix/location/pixListLocation.ts deleted file mode 100644 index 0d9015b..0000000 --- a/examples/pix/location/pixListLocation.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - inicio: '2021-01-22T16:01:35Z', - fim: '2021-11-30T20:10:00Z', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixListLocation(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/location/pixLocationList.ts b/examples/pix/location/pixLocationList.ts new file mode 100644 index 0000000..43bfe63 --- /dev/null +++ b/examples/pix/location/pixLocationList.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2022-01-22T16:01:35Z', + fim: '2022-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixLocationList(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixUnlinkTxidLocation.ts b/examples/pix/location/pixUnlinkTxidLocation.ts new file mode 100644 index 0000000..451e378 --- /dev/null +++ b/examples/pix/location/pixUnlinkTxidLocation.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + id: '95', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixUnlinkTxidLocation(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/location/pixUnsetTxid.ts b/examples/pix/location/pixUnsetTxid.ts deleted file mode 100644 index 0681a2c..0000000 --- a/examples/pix/location/pixUnsetTxid.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - id: '95', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixUnsetTxid(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/pix/pixDetail.ts b/examples/pix/pix/pixDetail.ts deleted file mode 100644 index 1ed2fa4..0000000 --- a/examples/pix/pix/pixDetail.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - e2eId: 'E18236120202104191813s0326120V4K', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixDetail(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/pix/pixDetailDevolution.ts b/examples/pix/pix/pixDetailDevolution.ts index 66190ba..41087b7 100644 --- a/examples/pix/pix/pixDetailDevolution.ts +++ b/examples/pix/pix/pixDetailDevolution.ts @@ -1,21 +1,19 @@ /* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; +import options from '../../credentials'; const params = { - e2eId: 'E18236120202104191813s0326120V4K', - id: '607dc88bb83bf', + e2eId: 'E18236120202104191813s0326120V4K', + id: '607dc88bb83bf', }; -const gerencianet = Gerencianet(options); +const gerencianet = new Gerencianet(options); gerencianet - .pixDetailDevolution(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); + .pixDetailDevolution(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/pix/pixDetailReceived.ts b/examples/pix/pix/pixDetailReceived.ts new file mode 100644 index 0000000..1bf6d31 --- /dev/null +++ b/examples/pix/pix/pixDetailReceived.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + e2eId: 'E18236120202104191813s0326120V4K', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDetailReceived(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/pix/pixDevolution.ts b/examples/pix/pix/pixDevolution.ts index 4956dae..102606d 100644 --- a/examples/pix/pix/pixDevolution.ts +++ b/examples/pix/pix/pixDevolution.ts @@ -1,25 +1,23 @@ /* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; +import options from '../../credentials'; const body = { - valor: '7.89', + valor: '7.89', }; const params = { - e2eId: 'E18236120202104191813s0326120V4K', - id: '101', + e2eId: 'E18236120202104191813s0326120V4K', + id: '101', }; -const gerencianet = Gerencianet(options); +const gerencianet = new Gerencianet(options); gerencianet - .pixDevolution(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); + .pixDevolution(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/pix/pixListReceived.ts b/examples/pix/pix/pixListReceived.ts deleted file mode 100644 index b9068e8..0000000 --- a/examples/pix/pix/pixListReceived.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - inicio: '2021-01-22T16:01:35Z', - fim: '2021-11-30T20:10:00Z', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixListReceived(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/pix/pixReceivedList.ts b/examples/pix/pix/pixReceivedList.ts new file mode 100644 index 0000000..5ae1ff5 --- /dev/null +++ b/examples/pix/pix/pixReceivedList.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2022-01-22T16:01:35Z', + fim: '2022-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixReceivedList(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/pix/pixSend.ts b/examples/pix/pix/pixSend.ts deleted file mode 100644 index 48e6fc9..0000000 --- a/examples/pix/pix/pixSend.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const body = { - valor: '12.34', - pagador: { - chave: 'SUACHAVEPIX', - }, - favorecido: { - chave: 'ChavePixDeDestino', - }, -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixSend(null, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/send/pixSend.ts b/examples/pix/send/pixSend.ts new file mode 100644 index 0000000..a66bee4 --- /dev/null +++ b/examples/pix/send/pixSend.ts @@ -0,0 +1,28 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + idEnvio: '01', +}; + +const body = { + valor: '12.34', + pagador: { + chave: 'SUACHAVEPIX', + }, + favorecido: { + chave: 'ChavePixDeDestino', + }, +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixSend(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/send/pixSendDetail.ts b/examples/pix/send/pixSendDetail.ts new file mode 100644 index 0000000..3493115 --- /dev/null +++ b/examples/pix/send/pixSendDetail.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + e2eid: '', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixSendDetail(params, []) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/send/pixSendList.ts b/examples/pix/send/pixSendList.ts new file mode 100644 index 0000000..4d25910 --- /dev/null +++ b/examples/pix/send/pixSendList.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2023-01-22T16:01:35Z', + fim: '2023-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixSendList(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/webhook/pixConfigWebhook.ts b/examples/pix/webhook/pixConfigWebhook.ts deleted file mode 100644 index e49c894..0000000 --- a/examples/pix/webhook/pixConfigWebhook.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable dot-notation */ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -// Validar Mtls? -options['validateMtls'] = true; - -const body = { - webhookUrl: 'https://exemplo-pix/webhook', -}; - -const params = { - chave: 'SUACHAVEPIX', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixConfigWebhook(params, body) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/webhook/pixDeleteWebhook.ts b/examples/pix/webhook/pixDeleteWebhook.ts deleted file mode 100644 index 2be10f2..0000000 --- a/examples/pix/webhook/pixDeleteWebhook.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - chave: 'SUACHAVEPIX', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixDeleteWebhook(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/webhook/pixDetailWebhook.ts b/examples/pix/webhook/pixDetailWebhook.ts deleted file mode 100644 index fa71474..0000000 --- a/examples/pix/webhook/pixDetailWebhook.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - chave: 'SUACHAVEPIX', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixDetailWebhook(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/webhook/pixListWebhook.ts b/examples/pix/webhook/pixListWebhook.ts deleted file mode 100644 index 01fc115..0000000 --- a/examples/pix/webhook/pixListWebhook.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint-disable import/extensions */ -/* eslint-disable import/no-unresolved */ -import Gerencianet from 'gn-api-sdk-typescript'; -import options from '../../config'; - -const params = { - inicio: '2021-01-22T16:01:35Z', - fim: '2021-11-30T20:10:00Z', -}; - -const gerencianet = Gerencianet(options); - -gerencianet - .pixListWebhook(params) - .then((resposta: any) => { - console.log(resposta); - }) - .catch((error: any) => { - console.log(error); - }) - .done(); diff --git a/examples/pix/webhooks/pixConfigWebhook.ts b/examples/pix/webhooks/pixConfigWebhook.ts new file mode 100644 index 0000000..e5444a8 --- /dev/null +++ b/examples/pix/webhooks/pixConfigWebhook.ts @@ -0,0 +1,24 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +options.validateMtls = false; + +const body = { + webhookUrl: 'https://exemplo-pix/webhook', +}; + +const params = { + chave: 'SUACHAVEPIX', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixConfigWebhook(params, body) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/webhooks/pixDeleteWebhook.ts b/examples/pix/webhooks/pixDeleteWebhook.ts new file mode 100644 index 0000000..f3ccd23 --- /dev/null +++ b/examples/pix/webhooks/pixDeleteWebhook.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + chave: 'SUACHAVEPIX', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDeleteWebhook(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/webhooks/pixDetailWebhook.ts b/examples/pix/webhooks/pixDetailWebhook.ts new file mode 100644 index 0000000..ba34637 --- /dev/null +++ b/examples/pix/webhooks/pixDetailWebhook.ts @@ -0,0 +1,18 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + chave: 'SUACHAVEPIX', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixDetailWebhook(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + }); diff --git a/examples/pix/webhooks/pixListWebhook.ts b/examples/pix/webhooks/pixListWebhook.ts new file mode 100644 index 0000000..eb25de6 --- /dev/null +++ b/examples/pix/webhooks/pixListWebhook.ts @@ -0,0 +1,19 @@ +/* eslint-disable import/extensions */ +import Gerencianet from 'gn-api-sdk-typescript'; +import options from '../../credentials'; + +const params = { + inicio: '2022-01-22T16:01:35Z', + fim: '2022-11-30T20:10:00Z', +}; + +const gerencianet = new Gerencianet(options); + +gerencianet + .pixListWebhook(params) + .then((resposta: Promise) => { + console.log(resposta); + }) + .catch((error: Promise) => { + console.log(error); + });