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

simplificação/refatoração de codigo #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gustavovianaveiga
Copy link

para uma melhor leitura e compatibilidade do codigo, no retorno do webHookEvent parse starkbank.event.parse() é melhor usar:

const subscription = event.log[event.subscription]
console.log(subscription)

ao inves de:

if (event.subscription === 'transfer') {
            console.log(event.log.transfer);
        } else if (event.subscription === 'boleto') {
            console.log(event.log.boleto);
        } else if (event.subscription === 'boleto-payment') {
            console.log(event.log.payment);
        } else if (event.subscription === 'utility-payment') {
            console.log(event.log.payment);
        } else if (event.subscription === 'boleto-holmes') {
            console.log(event.log.holmes);
        } else if (event.subscription === 'brcode-payment') {
            console.log(event.log.payment);
        } else if (event.subscription === 'deposit') {
            console.log(event.log.deposit);
        } else if (event.subscription === 'invoice') {
            console.log(event.log.invoice);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant