16 lines
484 B
JavaScript
16 lines
484 B
JavaScript
const tpasswordValidator = require('./tpassword.validator.js');
|
|
const tpinValidator = require('./tpin.validator.js');
|
|
|
|
const paymentSecretValidator = async (req, res, next) => {
|
|
const { tpin, tpassword } = req.body;
|
|
if (tpin) {
|
|
return tpinValidator(req, res, next);
|
|
} else if (tpassword) {
|
|
return tpasswordValidator(req, res, next);
|
|
} else {
|
|
return res.status(400).json({ error: 'tpin or tpassword is required' });
|
|
}
|
|
};
|
|
|
|
module.exports = paymentSecretValidator;
|