added beneficiary routes, controllers and services
This commit is contained in:
@@ -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 };
|
||||
|
Reference in New Issue
Block a user