From 617ea5c33caba1110fbae5878853851d526993cb Mon Sep 17 00:00:00 2001 From: MrlolDev Date: Tue, 12 Dec 2023 17:04:08 +0100 Subject: [PATCH] Remove unnecessary console.log statements and improve error handling in payment routes --- src/routes/payment.routes.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/payment.routes.ts b/src/routes/payment.routes.ts index ea55d12..af01003 100644 --- a/src/routes/payment.routes.ts +++ b/src/routes/payment.routes.ts @@ -141,10 +141,8 @@ router.post("/pay", key, geo, async (req, res) => { router.post("/webhook", async (req, res) => { const payload = req.body; const headerSignature = req.headers["x-sellix-unescaped-signature"]; - console.log(payload, headerSignature); if (!headerSignature) { return res.status(401).send("No signature"); - return; } const signature = crypto @@ -159,8 +157,8 @@ router.post("/webhook", async (req, res) => { Buffer.from(headerSignature, "utf-8") ) ) { + console.log("Invalid signature"); return res.status(401).send("Invalid signature"); - return; } if (payload.event != "order:paid") { return res.status(400).send("Invalid event type");