1.0.10 • Published 3 years ago

@asnopm/kyc-client v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

KYC - CLIENT

KYC Client provides a function ready to validate user data. This library is made in typescript and wraps API-Calls to validation server.

Usage

Install

npm i @asnopm/kyc-cient

Import & Run

import client from 'kyc-client'

const kycClient = new client.KYC('<API-KEY>','https://australia-southeast1-reporting-290bc.cloudfunctions.net/driverlicence')

const userData = {
            birthDate : "1985-02-08",
            givenName : "James",
            middleName : "Robert",
            familyName : "Smith",
            licenceNumber : "94977000",
            stateOfIssue : "NSW",
            expiryDate : "2020-01-01"
}

const main = async() => {
  try{  
      const res = await kycClient.validate(userData)
      console.log(`Validation was: ${res.kycResult}`)
  }catch(error){
      console.log(`Validation failed: `${error.message}`)
  }
}

main()
Valid parameters
ParameterTypeConstraints
birtDatestringFormat: YYYY-MM-DD
givenNamestringMax 100 characters
middleNamestringOptional. Max 100 characters
familyNamestringMax 100 characters
licenceNumberstringOnly numbers
stateOfIssuestringValid states: NSW, QLD, SA, TAS, VIC, WA, ACT, NT
expiryDatestringOptional Format: YYYY-MM-DD

Possible Errors

INVALID_PARAMETERS_ERROR: Indicates wrong parameters in payload.

VERIFY_DOCUMENT_ERROR: Indicates API had either a document error or a server error.

API_ERROR: Indicates a failure in http communication with third party API. Check your API_KEY was entered correctly.

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago