Commit eaaadb46 by tdgiang

fix bug

parent 6e028fd5
......@@ -1046,7 +1046,7 @@ exports.epayReturn = function (req, res, next) {
trxId: merTrxId,
},
(err, result) => {
if (err || (result && result.code && result.code === "400")) {
if (err || !result || !result.data || result.code === "400") {
return renderPage(req, res, "frontend/paymentSuccess", {
data: {
error_text: "Thanh toán thất bại!",
......@@ -1113,7 +1113,7 @@ exports.epayIPN = function (req, res, next) {
}
ApiRequest.get(urlCheckInvoice + "/" + merTrxId, (err, result) => {
if (err || (result && result.code && result.code === "400")) {
if (err || !result || !result.data || result.code === "400") {
return res
.status(400)
.json({ code: "99", data: "ERROR_TRX_ID_INCORRECT" });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment