added beneficiary routes, controllers and services

This commit is contained in:
2025-07-30 12:26:04 +05:30
parent d4d741b8cc
commit b88e00f758
3 changed files with 34 additions and 4 deletions

View File

@@ -22,4 +22,29 @@ async function validateWithinBank(req, res) {
}
}
module.exports = { validateWithinBank };
async function validateOutsideBank(req, res) {
res.status(400).send('WIP. Try after sometime');
}
async function npciResponse(req, res) {
const { resp } = req.body;
console.log(req.body);
if (resp === 'Success') {
await handleNPCISuccess(resp);
} else {
await handleNPCIFailure(resp);
}
res.send('ok');
}
async function handleNPCISuccess(response) {
const { txnid, benename } = response;
console.log(txnid);
console.log(benename);
}
async function handleNPCIFailure(response) {
console.log(response);
}
module.exports = { validateWithinBank, npciResponse, validateOutsideBank };