changed npci reponse body and added redis url to config
This commit is contained in:
@@ -6,5 +6,6 @@ dotenv.config({ path: path.resolve(__dirname, '../../.env') });
|
||||
module.exports = {
|
||||
port: process.env.PORT || 8080,
|
||||
dbUrl: process.env.DATABASE_URL,
|
||||
redisUrl: process.env.REDIS_URL,
|
||||
jwtSecret: process.env.JWT_SECRET,
|
||||
};
|
||||
|
||||
@@ -4,11 +4,11 @@ const { logger } = require('../util/logger');
|
||||
|
||||
async function npciResponse(req, res) {
|
||||
const { resp } = req.body;
|
||||
logger.info(resp, 'received from NPCI');
|
||||
if (resp.status === 'Success') {
|
||||
await handleNPCISuccess(resp);
|
||||
logger.info(req.body, 'received response from NPCI');
|
||||
if (resp === 'SUCCESS') {
|
||||
await handleNPCISuccess(req.body);
|
||||
} else {
|
||||
await handleNPCIFailure(resp);
|
||||
await handleNPCIFailure(req.body);
|
||||
}
|
||||
res.send('ok');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user