0.2.1 • Published 7 months ago

pavelon-verify-kyc v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago
import EnhancedKyc from 'pavelon-verify-kyc';

const enhanced = new EnhancedKyc({
  senderId: string  //required for otp verification
  authToken: string
  appId: string
  domainId: string
  otpLength: string
})

The onSend() function is an asynchronous function that sends an OTP (One Time Password) to a specified phone number using the enhanced.sendOtp() method. It takes a phoneNumber parameter as its input, which is passed as the phone property to the enhanced.sendOtp() method.

  async function onSend() {
    try {
      const response = await enhanced.sendOtp({ phone: phone });
      
    // handle successful sent code here
      
      console.log(response);
      
    } catch (error) {
    
     //handle error here
     
      console.log(error);
    }
  }
  

The onVerify() function is an asynchronous function that verifies an OTP (One Time Password) for a specified phone number using the enhanced.verifyOtp() method. It takes a code parameter as its input, which is passed as the verifyCode property to the enhanced.verifyOtp() method.

  async function onVerify() {
    try {
      const response = await enhanced.verifyOtp({ verifyCode: code });
      
    // handle successful verification here
      
      console.log(response);
      
    } catch (error) {
    
     //handle error here
     
      console.log(error);
    }
  }
  

The verification() method is designed to support various types of identification verification, including passports, national IDs, SSNIT, driver's licenses, TIN, and digital address verification, it is intended to provide a consistent and scalable way to verify multiple types of identification. Depending on the specific use case, the verification process for each type of identification may have different requirements and validation steps. However, this method can be used as a general-purpose function for handling these requirements.

async function onIDVerify () {

  try {
    const response = await enhanced.verification({
      passport: {
        id: "AB123456",
        firstName: "John",
        lastName: "Doe",
        middleName: "",
        dob: "01/01/1980"
      }
    });
    
    // handle successful verification here
    
    console.log(response);
    
  } catch(error) {
  
    // handle errors here
    
    console.error(error);
  
  }
};
async function verification() {

  const formData = new FormData();
  formData.append("nameOnCard", string);
  formData.append("idNumber", string);
  formData.append("idPhoto", File);
  formData.append("userId", string);   //optional

  try {
    const response = await config.ghanaCard(formData);
    console.log(response);
  } catch (error) {
    console.log(error);
  }
}
  //digital address verification
   digitalAddress: {
        digitalAddress: "",
      },



   //driver license verification
    driver_license: {
        id: "",
        fullName: "",
        dob: ""
    }


   //tin number verification
    tin: "",

    ssnit: {
        id: "",
        fullName: "",
        dob: ""
    },


   //passport verification
    passport: {
        id: "",
        firstName: "",
        lastName: "",
        middleName: "",
        dob: ""
    },


   //voter's id verification
    voter: {
        id: "",
        fullName: "",
    },

    




  };
0.2.1

7 months ago

0.2.0

7 months ago

0.1.8

7 months ago

0.1.9

7 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.7

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago