Comunidade

Ask a Question
Back to all

Adição de um novo body parametro adicional no Webhook

Bom dia! Eu gostaria de saber, se é possível adicionar um body adicional, quando o pagamento no BTG é aceito.

Eu gostaria de ter uma diretiva chamada: card_origem, ao final de um hook como esse de pagamento:

{
"payload": {
"webhookId": "",
"event": "",
"data": {
"paymentId": "",
"type": "",
"amount": 0,
"batchId": "",
"scheduledDate": "",
"paymentDate": "",
"status": "",
"debitParty": {
"taxId": "",
"name": "",
"number": "",
"branchCode": "",
"bankCode": ""
},
"detail": {
"key": {
"value": "",
"type": ""
},
"endToEndId": "",
"creditParty": {
"taxId": "",
"name": "",
"account": {
"type": "",
"number": "",
"branch": "",
"bankCode": "",
"ispb": ""
}
},
"priority": "",
"serviceLevel": ""
},
"authenticationCode": "",
"tags": {}
},
"tags": {}
},
"params": {}
}

Ai com a nova diretiva ficaria no final:

{
"payload": {
"webhookId": "",
"event": "",
"data": {
"paymentId": "",
"type": "",
"amount": 0,
"batchId": "",
"scheduledDate": "",
"paymentDate": "",
"status": "",
"debitParty": {
"taxId": "",
"name": "",
"number": "",
"branchCode": "",
"bankCode": ""
},
"detail": {
"key": {
"value": "",
"type": ""
},
"endToEndId": "",
"creditParty": {
"taxId": "",
"name": "",
"account": {
"type": "",
"number": "",
"branch": "",
"bankCode": "",
"ispb": ""
}
},
"priority": "",
"serviceLevel": ""
},
"authenticationCode": "",
"tags": {}
},
"tags": {}
},
"params": {},

"card_origem": ""
}

Teria como fazer algo do tipo?