Skip to content

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