mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 20:26:28 +00:00
add paramter checking card product
This commit is contained in:
@@ -108,27 +108,35 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// // log debug
|
||||
// winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
// get reservation expiration date by parameter
|
||||
let getCheckByCardProductStatusValue =
|
||||
await model.getCheckByCardProductStatusValue();
|
||||
let checkByCardProductStatusValue =
|
||||
getCheckByCardProductStatusValue.c_value;
|
||||
|
||||
// // check card number
|
||||
// let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
// if (!checkCardNumber) {
|
||||
// result = {
|
||||
// code: "413",
|
||||
// message: "card number is not registered",
|
||||
// data: {},
|
||||
// };
|
||||
if (checkByCardProductStatusValue == "A") {
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} checking card number...`);
|
||||
|
||||
// // log warn
|
||||
// winston.logger.warn(
|
||||
// `${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
// result
|
||||
// )}`
|
||||
// );
|
||||
// check card number
|
||||
let checkCardNumber = await model.checkCardNumber(card_number);
|
||||
if (!checkCardNumber) {
|
||||
result = {
|
||||
code: "413",
|
||||
message: "card number is not registered",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// return res.status(200).json(result);
|
||||
// }
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
result
|
||||
)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
|
||||
Reference in New Issue
Block a user