From 2bceba948d9f4ad4b96c2d9acc22397b0a3c3d89 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 23 May 2024 10:57:39 -0700 Subject: [PATCH] Resolve postback logging. --- server/intellipay/intellipay.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/intellipay/intellipay.js b/server/intellipay/intellipay.js index c7cc7d365..bebc05ade 100644 --- a/server/intellipay/intellipay.js +++ b/server/intellipay/intellipay.js @@ -145,19 +145,19 @@ exports.generate_payment_url = async (req, res) => { }; exports.postback = async (req, res) => { - logger.log("intellipay-postback", "DEBUG", req.user?.email, null, req.body); - const { body: values } = req; - - const comment = Buffer.from(values?.comment, "base64").toString(); - - if ((!values.invoice || values.invoice === "") && !comment) { - //invoice is specified through the pay link. Comment by IO. - logger.log("intellipay-postback-ignored", "DEBUG", req.user?.email, null, req.body); - res.sendStatus(200); - return; - } - try { + logger.log("intellipay-postback", "DEBUG", req.user?.email, null, req.body); + const { body: values } = req; + + const comment = Buffer.from(values?.comment, "base64").toString(); + + if ((!values.invoice || values.invoice === "") && !comment) { + //invoice is specified through the pay link. Comment by IO. + logger.log("intellipay-postback-ignored", "DEBUG", req.user?.email, null, req.body); + res.sendStatus(200); + return; + } + if (values.invoice) { //This is a link email that's been sent out. const job = await gqlClient.request(queries.GET_JOB_BY_PK, {