Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let -> const subcontas #33

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/contadigital/administradores/Administradores.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Administradores {

convidar(email) {

let endpoint = `contadigital/${this._credencial_conta}/administradores`;
const endpoint = `contadigital/${this._credencial_conta}/administradores`;

let headers = {
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -27,9 +27,9 @@ class Administradores {

desativar(email) {

let endpoint = `contadigital/${this._credencial_conta}/administradores/${email}`;
const endpoint = `contadigital/${this._credencial_conta}/administradores/${email}`;

let headers = {
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -39,9 +39,9 @@ class Administradores {

listar() {

let endpoint = `contadigital/${this._credencial_conta}/administradores`;
const endpoint = `contadigital/${this._credencial_conta}/administradores`;

let headers = {
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -52,4 +52,4 @@ class Administradores {

}

module.exports = Administradores;
module.exports = Administradores;
17 changes: 9 additions & 8 deletions lib/contadigital/subconta/Subconta.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ class Subconta {

subconta(hash_conta) {

let endpoint = `contadigital/${this._credencial}/subcontas/${hash_conta}`;
let headers = {
const endpoint = `contadigital/${this._credencial}/subcontas/${hash_conta}`;
const headers = {
"X-CHAVE-CONTA": this._chave
};

return APIClient.get(endpoint, {}, headers);
}

criarSubconta(dadosSubconta) {
let endpoint = `contadigital/${this._credencial}/subcontas`;
let headers = {

const endpoint = `contadigital/${this._credencial}/subcontas`;
const headers = {
"X-CHAVE-CONTA": this._chave
};

Expand All @@ -29,13 +30,13 @@ class Subconta {

adicionarSaldo(hash_conta, valor) {

let endpoint = `contadigital/${this._credencial}/subcontas/${hash_conta}`;
const endpoint = `contadigital/${this._credencial}/subcontas/${hash_conta}`;

let postData = {
const postData = {
"valor": valor
};

let headers = {
const headers = {
"X-CHAVE-CONTA": this._chave
};

Expand All @@ -45,4 +46,4 @@ class Subconta {

}

module.exports = Subconta;
module.exports = Subconta;
18 changes: 9 additions & 9 deletions lib/contadigital/transacoes/Transacoes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Despesas {

}

let endpoint = `contadigital/${this._credencial_conta}/transacoes`;
let headers = {
const endpoint = `contadigital/${this._credencial_conta}/transacoes`;
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -44,8 +44,8 @@ class Despesas {

cancelarTransacao(id_operacao) {

let endpoint = `contadigital/${this._credencial_conta}/transacoes/${id_operacao}`;
let headers = {
const endpoint = `contadigital/${this._credencial_conta}/transacoes/${id_operacao}`;
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -54,8 +54,8 @@ class Despesas {

Extrato(opcoes = {}) {

let endpoint = `contadigital/${this._credencial_conta}/transacoes`;
let headers = {
const endpoint = `contadigital/${this._credencial_conta}/transacoes`;
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -67,8 +67,8 @@ class Despesas {

Detalhes(id_operacao) {

let endpoint = `contadigital/${this._credencial_conta}/transacoes/${id_operacao}`;
let headers = {
const endpoint = `contadigital/${this._credencial_conta}/transacoes/${id_operacao}`;
const headers = {
"X-CHAVE-CONTA": this._chave_conta
};

Expand All @@ -77,4 +77,4 @@ class Despesas {

}

module.exports = Despesas;
module.exports = Despesas;
12 changes: 6 additions & 6 deletions lib/recebimento/boleto/Boleto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Boleto {

NovoBoleto(boletoItens) {

let endpoint = `recebimentos/${this._credencial}/transacoes`;
let headers = {
const endpoint = `recebimentos/${this._credencial}/transacoes`;
const headers = {
"Content-type": "application/json",
"X-CHAVE": this._chave
};
Expand All @@ -22,13 +22,13 @@ class Boleto {

Imprimir(IdsDosBoletos) {

let endpoint = `recebimentos/${this._credencial}/transacoes/lotes`;
const endpoint = `recebimentos/${this._credencial}/transacoes/lotes`;

let boletos = {
const boletos = {
'pedido_numero': IdsDosBoletos
};

let headers = {
const headers = {
"Content-type": "application/json",
"X-CHAVE": this._chave
};
Expand All @@ -39,4 +39,4 @@ class Boleto {
}


module.exports = Boleto;
module.exports = Boleto;
16 changes: 9 additions & 7 deletions lib/recebimento/cartao/Cartao.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const APIClient = require('pjbank-api-client');

class Cartao {

constructor(credencial, chave) {
Expand All @@ -10,8 +11,8 @@ class Cartao {

NovaTransacao(dadosPagamento) {

let endpoint = `recebimentos/${this._credencial}/transacoes`;
let headers = {
const endpoint = `recebimentos/${this._credencial}/transacoes`;
const headers = {
"X-CHAVE": this._chave
};

Expand All @@ -20,8 +21,8 @@ class Cartao {

Cancelar(tid) {

let endpoint = `recebimentos/${this._credencial}/transacoes/${tid}`;
let headers = {
const endpoint = `recebimentos/${this._credencial}/transacoes/${tid}`;
const headers = {
"Content-type": "application/json",
"X-CHAVE": this._chave
};
Expand All @@ -31,8 +32,9 @@ class Cartao {
}

Tokenizar(dadosCartao) {
let endpoint = `recebimentos/${this._credencial}/tokens`;
let headers = {

const endpoint = `recebimentos/${this._credencial}/tokens`;
const headers = {
"Content-type": "application/json",
"X-CHAVE": this._chave
};
Expand All @@ -41,4 +43,4 @@ class Cartao {
}
}

module.exports = Cartao;
module.exports = Cartao;
6 changes: 3 additions & 3 deletions lib/recebimento/credenciamento/Recebimento.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class Recebimento {
}

credenciar(dadosEmpresa) {
let endpoint = `recebimentos`;
let headers = {
const endpoint = `recebimentos`;
const headers = {
"Content-type": "application/json"
};

Expand All @@ -20,4 +20,4 @@ class Recebimento {

}

module.exports = Recebimento;
module.exports = Recebimento;
6 changes: 3 additions & 3 deletions lib/recebimento/extrato/Extrato.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Extrato {

gerar(opcoes = {}) {

let endpoint = `recebimentos/${this._credencial}/transacoes`;
const endpoint = `recebimentos/${this._credencial}/transacoes`;

let headers = {
const headers = {
"Content-type": "application/json",
"X-CHAVE": this._chave
};
Expand All @@ -22,4 +22,4 @@ class Extrato {
}
}

module.exports = Extrato;
module.exports = Extrato;
6 changes: 3 additions & 3 deletions lib/recebimento/utilitarios/Bancos.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const APIClient = require('pjbank-api-client');

module.exports = (() => {

let endpoint = "bancos";
const endpoint = "bancos";

let headers = {
const headers = {
"Content-type": "application/json"
};

return APIClient.get(endpoint, {}, headers);

});
});