feature/IO-2885-IntelliPay-App-Postback

- Refactor / Add Tests
This commit is contained in:
Dave Richer
2025-04-02 11:09:03 -04:00
parent c78b9866a3
commit 9bf6ba9cf0
12 changed files with 686 additions and 275 deletions

View File

@@ -0,0 +1,18 @@
/**
* @description Log validation error and send response
* @param res
* @param logger
* @param logCode
* @param message
* @param logMeta
* @returns {*}
*/
const handlePaymentValidationError = (res, logger, logCode, message, logMeta) => {
logger.log(logCode, "ERROR", "api", null, {
message,
...logMeta
});
return res.status(400).send(`Bad Request: ${message}`);
};
module.exports = handlePaymentValidationError;