Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary console.log statements and improve error handling …
Browse files Browse the repository at this point in the history
…in payment routes
  • Loading branch information
MrlolDev committed Dec 12, 2023
1 parent 77f77e3 commit 617ea5c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/routes/payment.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Expand Down

0 comments on commit 617ea5c

Please # to comment.