diff --git a/.env b/.env index 5602c8d..174cb8f 100644 --- a/.env +++ b/.env @@ -3,4 +3,6 @@ MONGO_URL = "mongodb://digifi:digifi@10.10.10.48:27017" VERIFY_ME_ENDPOINT = "https://vapi.verifyme.ng/v1/verifications/identities/bvn" VERIFY_ME_PUBLIC_KEY = "pk_live_9f4c2642862cb0190d3b72ca94579b2670fd797a124" -VERIFY_ME_PUBLIC_TEST_SECRET = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE1MjgzNywiZW52IjoidGVzdCIsImlhdCI6MTY1ODgyMzY0OH0.PszalhCuvCv6Y7kK41o3LuJh_R9kIlodbtWSi8HoFnI" \ No newline at end of file +VERIFY_ME_PUBLIC_TEST_SECRET = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE1MjgzNywiZW52IjoidGVzdCIsImlhdCI6MTY1ODgyMzY0OH0.PszalhCuvCv6Y7kK41o3LuJh_R9kIlodbtWSi8HoFnI" +VERIFY_ME_PUBLIC_LIVE_SECRET = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE1MjgzNywiZW52IjoibGl2ZSIsImlhdCI6MTY1ODgyMzY0OH0.jGwa1S6BKr14-QC_0isfVdmhjo_geC1EgyqIh65fhY4" + diff --git a/controller/verifyController.js b/controller/verifyController.js index 4d9968d..c8699cc 100644 --- a/controller/verifyController.js +++ b/controller/verifyController.js @@ -6,10 +6,20 @@ export const fetch = async (req, res)=>{ try{ console.log("BVN REQ-----------------------------------------"); console.log(req.body); + //{ bvn: '12345678912', '10000000001': '10000000001', verify_mode: 1000 } + const userBNV = req.body.bvn; + const verifyMode = req.body.verify_mode; console.log("BVN REQ========================================="); + const envKey = process.env.VERIFY_ME_PUBLIC_TEST_SECRET; + + if (verifyMode === 100) // this is live + { + const envKey = process.env.VERIFY_ME_PUBLIC_LIVE_SECRET; + } + // 'Authorization': 'Bearer ' + `${process.env.VERIFY_ME_PUBLIC_TEST_SECRET}`, let config = { headers: { - 'Authorization': 'Bearer ' + `${process.env.VERIFY_ME_PUBLIC_TEST_SECRET}`, + 'Authorization': 'Bearer ' + `${envKey}`, 'Content-Type': 'application/json' } }; @@ -19,10 +29,11 @@ export const fetch = async (req, res)=>{ "lastname":"Doe", "dob":"04-04-1944" }; -//22349419550 real live +//22349419550 real live userBNV //10000000001 test + // `${process.env.VERIFY_ME_ENDPOINT}/10000000001`, axios.post( - `${process.env.VERIFY_ME_ENDPOINT}/10000000001`, + `${process.env.VERIFY_ME_ENDPOINT}/${userBNV}`, bodyParameters , config diff --git a/controller/verifyEmployer.js b/controller/verifyEmployer.js index 7252db8..12c94a2 100644 --- a/controller/verifyEmployer.js +++ b/controller/verifyEmployer.js @@ -27,7 +27,7 @@ export const verifyEmployer = async (req, res)=>{ "This serves as an employer’s commitment to notify you that your staff ("+employee_name+") who holds the position of software engineer in your organization took a loan facility from our bank and has prompted us to notify you so as to confirm his existence as a staff of your organization." + " Please click on the link below to confirm this before we can approve his loan\n " + "

\n" + - "***Employer commitment link (You are to login with this email address and default password "+approve_password+" )\n " + + "***Employer commitment link (You are to login with this email address and default password "+approve_password+" )\n " + "

\n" + "If you have any questions or concerns with respect to this email, please contact our finance department at "+req.body.processing_bank_email+".\n \n Kind Regards,

\n" + "Finance team,
"+req.body.processing_bank_name+"
\n";