diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 3e29387bb..d13de62c2 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -2901,6 +2901,7 @@ exports.GET_BODYSHOP_BY_ID = ` intellipay_config state notification_followers + timezone } } `; @@ -2992,6 +2993,7 @@ query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!) id intellipay_config email + timezone } } }`; @@ -3001,6 +3003,7 @@ query GET_BODYSHOP_BY_MERCHANTID($merchantID: String!) { bodyshops(where: {intellipay_merchant_id: {_eq: $merchantID}}) { id email + timezone } }`; diff --git a/server/intellipay/lib/handleCommentBasedPayment.js b/server/intellipay/lib/handleCommentBasedPayment.js index 535e92ab8..fd2ff3ef8 100644 --- a/server/intellipay/lib/handleCommentBasedPayment.js +++ b/server/intellipay/lib/handleCommentBasedPayment.js @@ -48,7 +48,9 @@ const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta payer: "Customer", type: getPaymentType(ipMapping, values.cardtype), jobid: p.jobid, - date: moment(Date.now()), + date: moment() + .tz(bodyshop?.bodyshops_by_pk?.timezone ?? "UTC") + .format("YYYY-MM-DD"), payment_responses: { data: { amount: values.total, diff --git a/server/intellipay/lib/handleInvoiceBasedPayment.js b/server/intellipay/lib/handleInvoiceBasedPayment.js index d5fc97b9c..34a1a5e8d 100644 --- a/server/intellipay/lib/handleInvoiceBasedPayment.js +++ b/server/intellipay/lib/handleInvoiceBasedPayment.js @@ -97,7 +97,9 @@ const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => { payer: "Customer", type: getPaymentType(ipMapping, values.cardtype), jobid: job.id, - date: moment(Date.now()) + date: moment() + .tz(bodyshop?.timezone ?? "UTC") + .format("YYYY-MM-DD") } });