diff --git a/server/intellipay/lib/handleCommentBasedPayment.js b/server/intellipay/lib/handleCommentBasedPayment.js index b6f503d33..fd2ff3ef8 100644 --- a/server/intellipay/lib/handleCommentBasedPayment.js +++ b/server/intellipay/lib/handleCommentBasedPayment.js @@ -49,7 +49,7 @@ const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta type: getPaymentType(ipMapping, values.cardtype), jobid: p.jobid, date: moment() - .tz(bodyshop.bodyshops_by_pk.timezone || "UTC") + .tz(bodyshop?.bodyshops_by_pk?.timezone ?? "UTC") .format("YYYY-MM-DD"), payment_responses: { data: { diff --git a/server/intellipay/lib/handleInvoiceBasedPayment.js b/server/intellipay/lib/handleInvoiceBasedPayment.js index 2279a9da5..34a1a5e8d 100644 --- a/server/intellipay/lib/handleInvoiceBasedPayment.js +++ b/server/intellipay/lib/handleInvoiceBasedPayment.js @@ -98,7 +98,7 @@ const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => { type: getPaymentType(ipMapping, values.cardtype), jobid: job.id, date: moment() - .tz(bodyshop.timezone || "UTC") + .tz(bodyshop?.timezone ?? "UTC") .format("YYYY-MM-DD") } });