Commit b6e12424 by tdgiang

Update Sổ Bán Lẻ order status to paid after successful epay IPN

Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KPzWwuTEeX2vXGXvyGn4q
parent 9c6735e3
......@@ -213,6 +213,18 @@ exports.epayIPN = function (req, res) {
console.error("epayIPN: DB error updating merTrxId=" + merTrxId + ":", updateErr.message);
return res.status(500).json({ code: "99", data: "DB_ERROR" });
}
if (newStatus === "success" && tx.sobanleOrderId) {
SobanleClient.changeSaleStatus(tx.sobanleOrderId, function (sobanleErr) {
if (sobanleErr) {
console.error(
"epayIPN: SobanleClient.changeSaleStatus failed for orderId=" + tx.sobanleOrderId + ":",
sobanleErr.message
);
}
});
}
return res.status(200).json({ code: "00", data: "Success" });
}
);
......
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