Skip to main content

Customer Verification

Introduction

The customer verification service exposes operations for verifying customers:

  • Start Customer Verification
  • Get a Customer KYC (Know Your Customer) Status

Use the following code to obtain an instance of CustomerVerificationService:

val customerVerificationService = Wallet.getInstance().getCustomerVerificationService()
IMPORTANT

It is responsibility of the client application to request the camera permission that is required for the customer verification flow.

Starts Customer Verification

Use startCustomerVerification method to start a screen for result of the customer verification flow. After the verification flow has finished, a result of type VerificationResult is returned to the client application.

Customer Verification Request

ParameterData typeDescriptionExample
merchantRefNumStringRequired parameter, representing a generated string that is unique for each session."oidfjsdkljfh2131"
languageStringOptional parameter. Displays content for the customer in the specified language."en"

In Android there are two ways to open a screen by using startActivityForResult method or registerForActivityResult:

val customerVerificationRequest = CustomerVerificationRequest(
merchantRefNum = "oidfjsdkljfh2131",
language = "en"
)

// Start the verification screen for result
customerVerificationService.startCustomerVerification(this, 100, customerVerificationRequest)

// Then, obtain the verification result in onActivityResult
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == 100 && data != null) {
val result = IntentCompat.getParcelableExtra(data, "EXTRA_CUSTOMER_VERIFICATION_RESULT", VerificationResult::class.java)
when (result) {
VerificationResult.COMPLETE -> handleComplete()
VerificationResult.FAILED -> handleFailed()
VerificationResult.CANCELLED -> handleCancelled()
VerificationResult.MISSING_CAMERA_PERMISSION -> handleMissingPermission()
else -> handleOtherError()
}
}
}

// Alternatively, the registerForActivityResult API can be used
val launcher = registerForActivityResult(OpenCustomerVerification()) { result ->
when (result) {
VerificationResult.COMPLETE -> handleComplete()
VerificationResult.FAILED -> handleFailed()
VerificationResult.CANCELLED -> handleCancelled()
VerificationResult.MISSING_CAMERA_PERMISSION -> handleMissingPermission()
else -> handleOtherError()
}
}
launcher.launch(customerVerificationRequest)

Get KYC Status

Use getKycStatus method to retrieve the KYC status of the user. The result is a KycVerification object, containing the customer ID and the current status - completed, in progress or incomplete.

try {
val kycStatus = customerVerificationService.getKycStatus()
Log.d(TAG, kycStatus.toString())
} catch (exception: Exception) {
Log.d(TAG, exception.toString())
}