From 37129c827cf270a5f4374908cf3143af31f575c1 Mon Sep 17 00:00:00 2001 From: Antonio Roberto Silva Date: Wed, 28 Feb 2024 23:43:25 -0300 Subject: [PATCH] use R.isNil also to check undefined and null --- services/hook-service-api/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/hook-service-api/server.js b/services/hook-service-api/server.js index f2c006471..ff4391bad 100644 --- a/services/hook-service-api/server.js +++ b/services/hook-service-api/server.js @@ -169,7 +169,7 @@ server.post('/postbacks/:gateway_name', async (req, resp) => { const transaction = req.body.transaction; const payment_gateway_id = payment.gateway_general_data.gateway_id - if(!R.isEmpty(payment_gateway_id) && transaction.id.toString() === payment_gateway_id) { + if((!R.isEmpty(payment_gateway_id) && !R.isNil(payment_gateway_id)) && transaction.id.toString() === payment_gateway_id.toString()) { if (!['authorized', 'processing', 'waiting_payment', 'pending_review','pending_refund'].includes(current_status)) { const payables = await gateway_client.