KYC (Android SDK)
Know Your Customer (KYCKYC Know Your Customer - the identity verification process for consumer identities. This process allows you to seamlessly and securely verify your user's identity. Weavr will ask users to submit the necessary information and documentation so that they can get approved by financial providers.) due diligence is one of the steps required to onboard consumers onto your app. We provide a KYCKYC Know Your Customer - the identity verification process for consumer identities. This process allows you to seamlessly and securely verify your user's identity. Weavr will ask users to submit the necessary information and documentation so that they can get approved by financial providers. component that you can embed in your app. This lets you provide a seamless experience to your user while capturing the required documentation to verify their identity.
Use it for: the identity-verification step of consumer onboarding, after the consumer's profileProfile A template defining the configuration for one type of object - corporate identity, consumer identity, managed account, managed card, transfer, or outgoing wire transfer. When you create one of these objects you reference its Profile ID, which tells Weavr which limits, currencies, supported countries, branding, and fees to apply. Your programme ships with one or more Profile IDs per supported object type. has been created.
Start KYC
Once setup is done you are ready to present the SDK on the screen. See this code example for a quick start.
Customize the look and feel of the KYC component
Refer to SumSub MobileSDK Documentation for detailed information on how to customize UI components in your app.
To create Weavr theme object, you can use:
val colors = mutableMapOf<WeavrSNSColorElement, WeavrSNSColor>()
colors[WeavrSNSColorElement.BACKGROUND_COMMON] = WeavrSNSColor(
Color.parseColor("#ff0000"),
Color.parseColor("#ffff00")
)
val fonts = mutableMapOf<WeavrSNSTypographyElement, WeavrSNSFont>()
fonts[WeavrSNSTypographyElement.HEADLINE1] = WeavrSNSFont(TypefaceMONOSPACE, 20)
val metrics = mutableMapOf<WeavrSNSMetricElement, Any>()
metrics[WeavrSNSMetricElement.ACTIVITY_INDICATOR_STYLE] = SNSThemeMetric.Size.LARGE
metrics[WeavrSNSMetricElement.CARD_CORNER_RADIUS] = 0f
metrics[WeavrSNSMetricElement.DOCUMENT_TYPE_CARD_STYLE] = SNSThemeMetric.CardStyle.DEFAULT
val theme = WeavrSNSTheme(colors = colors, fonts = fonts, metrics = metrics)
You can customize your fonts, colors, and icons. e.g.:
UXComponents.kyc.startKYC(
this,
reference = "<YOUR_CONSUMER_OR_CORPORATE_REFERENCE>",
kycLevel = KYC_LEVELS.KYC_LEVEL_2,
kycListeners = kycListeners,
theme = theme,
onKycCompleteListener =
object : OnKycCompleteListener<String, ErrorResponse> {
override fun onKYCSuccessful(result: String) {
Log.d(Tag, "onKYCSuccessful: $result")
}
override fun onKYCFailed(error: ErrorResponse) {
Log.d(Tag, "onKYCFailed: $error")
Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show()
}
},
)
Also, you can customize the text's shape, font, and colors by modifying the theme options in your app's styles. For example:
<style name="Base.Theme.SNSCore" parent="Base.Theme.MaterialThemeBuilder">
<item name="colorPrimary">@color/sns_color_primary_50</item>
<item name="colorPrimaryVariant">@color/sns_color_primary_60</item>
<item name="colorSecondary">@color/sns_color_primary_50</item>
....
Example: add KYC listeners
val kycListeners: KYCListeners =
object : KYCListeners {
override fun onWeavrKYCCompleteHandler(
weavrKYCCompleteHandler: WeavrKYCCompleteHandler
) {
when (weavrKYCCompleteHandler) {
is WeavrKYCCompleteHandler.AbnormalTermination ->
Log.d(
Tag,
"onException: ${weavrKYCCompleteHandler.exception}"
)
is WeavrKYCCompleteHandler.SuccessTermination ->
Log.d(
Tag,
"onSuccess: ${weavrKYCCompleteHandler.stateName}"
)
}
}
override fun onWeavrKYCSDKErrorHandler(kycException: KYCException) {
when (kycException) {
is KYCException.API ->
Log.d(
Tag,
"onWeavrKYCSDKErrorHandler: Api exception. ${kycException.description}"
)
is KYCException.Network ->
Log.d(
Tag,
"onWeavrKYCSDKErrorHandler: Network exception. ${kycException}"
)
is KYCException.UnKnown ->
Log.d(
Tag,
"onWeavrKYCSDKErrorHandler: UnKnown exception. ${kycException}"
)
}
}
override val tokenExpirationHandler: WeavrKYCTokenExpirationHandler
get() =
object : WeavrKYCTokenExpirationHandler {
override fun onTokenExpired(): String? {
// Access token expired
// get a new one and pass it to the callback to re-initiate the
// SDK
// val newToken = "..." // get a ew token from your backend
return ""
}
}
override fun onKYCSDKStateChangeHandler(kycSdkState: KYCSDKState) {
when (kycSdkState) {
KYCSDKState.Ready -> Log.d(Tag, "SDK is ready")
is KYCSDKState.Failed -> {
when (kycSdkState) {
is KYCSDKState.Failed.ApplicantMisconfigured ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: ${kycSdkState.message}",
)
is KYCSDKState.Failed.ApplicationNotFound ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: ${kycSdkState.message}",
)
is KYCSDKState.Failed.InitialLoadingFailed ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: ${kycSdkState.message}",
kycSdkState.exception
)
is KYCSDKState.Failed.InvalidParameters ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: ${kycSdkState.message}",
)
is KYCSDKState.Failed.NetworkError ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: ${kycSdkState.message}",
kycSdkState.exception
)
is KYCSDKState.Failed.Unauthorized ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: Invalid token or a token can't be refreshed by the SDK. Check your token expiration handler",
kycSdkState.exception
)
is KYCSDKState.Failed.Unknown ->
Log.e(
Tag,
"onKYCSDKStateChangeHandler: Unknown error",
kycSdkState.exception
)
}
}
KYCSDKState.Initial ->
Log.d(Tag, "No verification steps are passed yet ")
KYCSDKState.Incomplete ->
Log.d(
Tag,
"Some but not all verification steps are passed over"
)
KYCSDKState.Pending -> Log.d(
Tag,
"Verification is in pending state"
)
KYCSDKState.FinallyRejected ->
Log.d(Tag, "Applicant has been finally rejected ")
KYCSDKState.TemporarilyDeclined ->
Log.d(Tag, "Applicant has been declined temporarily ")
KYCSDKState.Approved -> Log.d(
Tag,
"Applicant has been approved"
)
}
}
override fun onKYCEventHandler(kycEvent: KYCEvent) {
when (kycEvent) {
KYCEvent.SNSEventStepCompleted -> {
Log.d(Tag, "onEvent: step completed")
}
KYCEvent.SNSEventStepInitiated -> {
Log.d(Tag, "onEvent: step initiated")
}
}
}
}