mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
add validation card number prod or not with see the first number is 1
This commit is contained in:
@@ -81,6 +81,43 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking production card number or not...`
|
||||
);
|
||||
|
||||
if (process.env.SERVER_FOR == "production") {
|
||||
if (card_number.substring(0, 1) != "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's not production card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
} else {
|
||||
if (card_number.substring(0, 1) == "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's production card number. Please use the development card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// time
|
||||
let now = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
let year = moment().format("Y");
|
||||
@@ -480,6 +517,43 @@ const loadingBalance = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking production card number or not...`
|
||||
);
|
||||
|
||||
if (process.env.SERVER_FOR == "production") {
|
||||
if (card_number.substring(0, 1) != "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's not production card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
} else {
|
||||
if (card_number.substring(0, 1) == "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's production card number. Please use the development card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// time
|
||||
let now = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
let today = moment().format("YYYY-MM-DD");
|
||||
|
||||
@@ -100,6 +100,43 @@ const checkReservation = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking production card number or not...`
|
||||
);
|
||||
|
||||
if (process.env.SERVER_FOR == "production") {
|
||||
if (card_number.substring(0, 1) != "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's not production card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
} else {
|
||||
if (card_number.substring(0, 1) == "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's production card number. Please use the development card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking reservation with pending status and in progress status...`
|
||||
@@ -182,6 +219,43 @@ const reservationValidate = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking production card number or not...`
|
||||
);
|
||||
|
||||
if (process.env.SERVER_FOR == "production") {
|
||||
if (card_number.substring(0, 1) != "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's not production card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
} else {
|
||||
if (card_number.substring(0, 1) == "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's production card number. Please use the development card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// time
|
||||
let now = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
let today = moment().format("YYYY-MM-DD");
|
||||
@@ -468,6 +542,43 @@ const reservation = async (req, res) => {
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(
|
||||
`${uniqueCode} checking production card number or not...`
|
||||
);
|
||||
|
||||
if (process.env.SERVER_FOR == "production") {
|
||||
if (card_number.substring(0, 1) != "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's not production card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
} else {
|
||||
if (card_number.substring(0, 1) == "1") {
|
||||
result = {
|
||||
code: "400",
|
||||
message: "It's production card number. Please use the development card number.",
|
||||
data: {},
|
||||
};
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} RESPONSE check reservation: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
return res.status(200).json(result);
|
||||
}
|
||||
}
|
||||
|
||||
// time
|
||||
let now = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
let today = moment().format("YYYY-MM-DD");
|
||||
|
||||
Reference in New Issue
Block a user