From d0e329c5bdecabc190d04f6d19c83d26f79a9971 Mon Sep 17 00:00:00 2001 From: Dnyanesh Date: Sat, 30 Apr 2022 21:05:01 +0530 Subject: [PATCH 1/3] Select file state storage --- .../src/customer/onboarding/panProofComponents/PanUpload.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/customer/onboarding/panProofComponents/PanUpload.js b/frontend/src/customer/onboarding/panProofComponents/PanUpload.js index 2ccd855..0f78e29 100644 --- a/frontend/src/customer/onboarding/panProofComponents/PanUpload.js +++ b/frontend/src/customer/onboarding/panProofComponents/PanUpload.js @@ -13,7 +13,9 @@ const PanUpload = ({ handleClick }) => { // Handle file selection const handleChange = async (event) => { - const res = await getOCRFetch(event.target.files[0], ''); + setSelectedFile(event.target.files[0]); + const res = await getOCRFetch(selectedFile, ''); + console.log(res); }; From 420b5b27d012b04e2bb5b2f2b3a660093e5d5722 Mon Sep 17 00:00:00 2001 From: Dnyanesh Date: Tue, 3 May 2022 16:24:42 +0530 Subject: [PATCH 2/3] Aadhaar otp and it's validation --- frontend/src/services/dygnifyAxiosOptions.js | 43 +++++++++++++++++++- frontend/src/services/serviceHelper.js | 28 +++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/frontend/src/services/dygnifyAxiosOptions.js b/frontend/src/services/dygnifyAxiosOptions.js index 2b488df..0934244 100644 --- a/frontend/src/services/dygnifyAxiosOptions.js +++ b/frontend/src/services/dygnifyAxiosOptions.js @@ -495,6 +495,45 @@ function dygnifyGetMobileDetails(reqId, phoneNo, bearerToken) { return api_options; } +function dygnifySendAadhaarOTP(aadhaarNo, name, bearerToken) { + var data = JSON.stringify({ + "aadhaarNo": aadhaarNo, + "name": name + }); + + var api_options = { + method: 'post', + url: process.env.REACT_APP_DYGNIFY_URL + 'utility/getAadhaarOTP', + headers: { + 'Authorization': bearerToken, + 'Content-Type': 'application/json' + }, + data: data + } + + return api_options; +} + +function dygnifyValidateAadhaarOTP(otp, accessKey, caseId, bearerToken) { + var data = JSON.stringify({ + "otp": otp, + "accessKey": accessKey, + "caseId": caseId + }); + + var api_options = { + method: 'post', + url: process.env.REACT_APP_DYGNIFY_URL + 'utility/validateAadhaarOTP', + headers: { + 'Authorization': bearerToken, + 'Content-Type': 'application/json' + }, + data: data + } + + return api_options; +} + module.exports = { dygnifyBusinessOwnerCreationOption, dygnifycreateBusinessOptions, @@ -522,5 +561,7 @@ module.exports = { dygnifyKycOCR, dygnifySendMobileOTP, dygnifyValidateMobileOTP, - dygnifyGetMobileDetails + dygnifyGetMobileDetails, + dygnifySendAadhaarOTP, + dygnifyValidateAadhaarOTP } \ No newline at end of file diff --git a/frontend/src/services/serviceHelper.js b/frontend/src/services/serviceHelper.js index 17f7b4d..bfca8b4 100644 --- a/frontend/src/services/serviceHelper.js +++ b/frontend/src/services/serviceHelper.js @@ -64,4 +64,32 @@ export async function getOCRFetch(file, bearerToken) { console.log(error); } return { 'status': false }; +} + +export async function sendAadhaarOTP(aadhaarNo, name, bearerToken) { + try { + if (aadhaarNo && name && bearerToken) { + let aadhaarOTPRes = await axiosHttpService(dygnifySendAadhaarOTP(aadhaarNo, name, bearerToken)); + if (aadhaarOTPRes.code === 200) { + return { 'status': true, data: aadhaarOTPRes.res }; + } + } + } catch (error) { + console.log(error); + } + return { 'status': false }; +} + +export async function ValidateAadhaarOTP(otp, accessKey, caseId, bearerToken) { + try { + if (otp && accessKey && caseId && bearerToken) { + let otpValidationRes = await axiosHttpService(dygnifyValidateAadhaarOTP(otp, accessKey, caseId, bearerToken)); + if (otpValidationRes.code === 200) { + return { 'status': true, data: otpValidationRes.res }; + } + } + } catch (error) { + console.log(error); + } + return { 'status': false }; } \ No newline at end of file From 04f339b8653d71b74767bfa3b927e22a38fc41cf Mon Sep 17 00:00:00 2001 From: Dnyanesh Date: Wed, 4 May 2022 17:00:46 +0530 Subject: [PATCH 3/3] corrected the import error --- frontend/src/services/serviceHelper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/services/serviceHelper.js b/frontend/src/services/serviceHelper.js index bfca8b4..3105ee6 100644 --- a/frontend/src/services/serviceHelper.js +++ b/frontend/src/services/serviceHelper.js @@ -1,5 +1,8 @@ import axiosHttpService from './axioscall'; -import { dygnifySendMobileOTP, dygnifyValidateMobileOTP, dygnifyGetMobileDetails, dygnifyKycOCR } from './dygnifyAxiosOptions'; +import { + dygnifySendMobileOTP, dygnifyValidateMobileOTP, dygnifyGetMobileDetails, + dygnifyKycOCR, dygnifySendAadhaarOTP, dygnifyValidateAadhaarOTP +} from './dygnifyAxiosOptions'; function sanitizePhoneNo(phone) { // Remove additional symbols from the phone number