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

Feature/full api integration #1

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ec79c7f
Start Send Transfer development
LucasSte Aug 25, 2020
cf05a43
Fixing wrong password bug
LucasSte Aug 26, 2020
9a6d66b
Read privatekey implemented
LucasSte Aug 26, 2020
4adccb2
Add externaId and description to transfer dialog
LucasSte Aug 26, 2020
e7fc131
Add privateKey check before sending transfers
LucasSte Aug 31, 2020
f475ed2
Add check privateKey before sending transfer
LucasSte Aug 31, 2020
d7d5bce
Sketch transfer
LucasSte Sep 1, 2020
8886f3e
Finish transfer
LucasSte Sep 1, 2020
eaa4223
Start Boleto payment implementation
LucasSte Sep 2, 2020
cd5dee7
Finish PayBoleto
LucasSte Sep 2, 2020
6ac4038
Implement fetch customers
LucasSte Sep 2, 2020
aa4bcdc
Start implementing createBoleto
LucasSte Sep 2, 2020
f942d46
Continue implementation of createBoleto
LucasSte Sep 3, 2020
469ae6e
Implement CreateBoleto
LucasSte Sep 4, 2020
3e69a69
Start implementation of SendTransaction
LucasSte Sep 4, 2020
9653ed5
Finish sdkSendTransfer
LucasSte Sep 8, 2020
95e3b0c
Start implementation of sdkViewChargeEvent
LucasSte Sep 8, 2020
e8fa804
Implement ViewChargeEvent
LucasSte Sep 9, 2020
99940c7
Implement createCustomers
LucasSte Sep 9, 2020
11eccc0
Implement getBalance and center spinner position
LucasSte Sep 10, 2020
729ae89
Add DigitalSignature tab to Navigation
LucasSte Sep 10, 2020
b3d84da
Refactor front end
LucasSte Sep 11, 2020
6c2337c
Implement digital signature tab
LucasSte Sep 11, 2020
7a9e147
Add goHelp funcation to navigationUtils
LucasSte Sep 14, 2020
a3e3d36
Add MAINTAINERS.md
LucasSte Sep 14, 2020
0cd761c
Fix typo on MAINTAINERS.md
LucasSte Sep 14, 2020
8ebb5bb
Fix typo on MAINTAINERS.md
LucasSte Sep 14, 2020
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
Prev Previous commit
Next Next commit
Continue implementation of createBoleto
LucasSte committed Sep 3, 2020
commit f942d4642712b2b55d19c83766618a416c6d6d5b
78 changes: 70 additions & 8 deletions sdkCreateBoleto.js
Original file line number Diff line number Diff line change
@@ -7,16 +7,78 @@ function createBoleto()
formatHeader(sheet);

for(let i=11; i<=sheet.getLastRow(); i++) {

let descriptions = [];
for(let j=0; j<3; j++)
{
let column = String.fromCharCode(73 + j);
let text = sheet.getRange(column + i.toString()).getValue();
if(text.lenght > 0)
{
let description = {
text: text,
amount: parseInt(sheet.getRange(column + i.toString()).getValue())
};
descriptions.push(description);
}
}

let boleto = {
customerId: sheet.getRange('A' + i.toString()).getValue(),
amount: parseInt(100*sheet.getRange('B' + i.toString()).getValue(), 10),
dueDate: formatDateToISO(sheet.getRange('C' + i.toString()).getValue()),
fine: parseFloat(sheet.getRange('D' + i.toString().getValue())),
interest: parseFloat(sheet.getRange('E' + i.toString()).getValue()),
overdueLimit: parseInt(sheet.getRange('F' + i.toString()).getValue()),
discount: parseFloat(sheet.getRange('G' + i.toString()).getValue()),
discountDate: formatDateToISO(sheet.getRange('H' + i.toString()).getValue()),

amount: parseInt(100*sheet.getRange('B' + i.toString()).getValue(), 10)
};

let dueDate = sheet.getRange('C' + i.toString()).getValue();
if(dueDate.length > 0)
{
boleto["dueDate"] = formatDateToISO(dueDate);
}
let fine = sheet.getRange('D' + i.toString()).getValue();
if(fine.length > 0)
{
boleto["fine"] = parseFloat(fine);
}
let interest = sheet.getRange('E' + i.toString()).getValue();
if(interest.length > 0)
{
boleto["interest"] = parseFloat(interest);
}
let overdueLimit = sheet.getRange('F' + i.toString()).getValue();
if(overdueLimit.length > 0)
{
boleto["overdueLimit"] = parseInt(overdueLimit);
}
let discount = sheet.getRange('G' + i.toString()).getValue();
if(discount.length > 0)
{
boleto["dicount"] = parseFloat(discount);
}
let discountDate = sheet.getRange('H' + i.toString()).getValue();
if(discountDate.length > 0)
{
boleto["discountDate"] = formatDateToISO(discountDate);
}


if(descriptions.length > 0)
{
boleto["descriptions"] = descriptions;
}
let tags = sheet.getRange('O' + i.toString()).getValue().split(",");
if(tags.lenght > 0)
{
boleto["tags"] = tags;
}

boletos.push(boleto);
}

let payload = {
charges: boletos
};

Browser.msgBox(JSON.stringify(payload));
//throw new Error(payload);

//json = JSON.parse(fetch("/charge", method = 'POST', payload, null).content);
}
2 changes: 1 addition & 1 deletion utilsBase.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ function getHeaderColumns(sheet){
'Consulta de Transferência': ["Data de Criação", "Id Transferência", "Valor", "Status", "Nome", "CPF/CNPJ", "Código do Banco", "Agência", "Número da Conta", "Ids de Transação (Saída, Estorno)"],
'Pagamento de Boletos': ["Linha Digitável ou Código de Barras", "CPF/CPNJ do Beneficiário", "Data de Agendamento", "Descrição", "Tags"],
'Consulta de Clientes': ["Id do Cliente", "Nome", "CPF/CNPJ", "E-Mail", "Telefone", "Logradouro", "Complemento", "Bairro", "Cidade", "Estado", "CEP", "Tags"],
'Emissão de Boletos': ["Id do Cliente", "Valor", "Data de Vencimento", "Multa", "Juros ao Mês", "Dias para Baixa Automática", "Desconto", "Data Limite do Desconto", "Descrição 1", "Valor 1", "Descrição 2", "Valor 2", "Descrição 3", "Valor 3"]
'Emissão de Boletos': ["Id do Cliente", "Valor", "Data de Vencimento", "Multa", "Juros ao Mês", "Dias para Baixa Automática", "Desconto", "Data Limite do Desconto", "Descrição 1", "Valor 1", "Descrição 2", "Valor 2", "Descrição 3", "Valor 3", "Tags"]
}[sheet.getName()];
}