TP-12345 | Added Clickstream Event for Selfie Hyperverge (#10594)

This commit is contained in:
Sanjay P
2024-04-23 19:39:21 +05:30
committed by GitHub
parent 283e21fd9b
commit 6a369640a8
4 changed files with 25 additions and 5 deletions

View File

@@ -567,10 +567,18 @@ class NaviAnalytics private constructor() {
mapOf(Pair("error_message", error.orEmpty()))
)
fun onHypervergeSelfieSuccess(imageUri: String?) =
fun onHypervergeSelfieSuccess(
imageUri: String? = null,
requestId: String? = null,
uuid: String? = null
) =
NaviTrackEvent.trackEvent(
"hyperverge_selfie_success",
mapOf(Pair("imageUri", imageUri.orEmpty()))
mapOf(
Pair("imageUri", imageUri.orEmpty()),
Pair("requestId", requestId.orEmpty()),
Pair("uuid", uuid.orEmpty()),
)
)
fun onPopulateSelfieResponseError(message: String?) {

View File

@@ -124,7 +124,12 @@ class SelfieVerificationHelper {
}
}
result?.let { data ->
selfieAnalyticsTracker.onHypervergeSelfieSuccess(data.imageURI)
val requestId = data.apiHeaders?.optString(HYPERVERGE_REQUEST_ID)
selfieAnalyticsTracker.onHypervergeSelfieSuccess(
imageUri = data.imageURI,
requestId = requestId,
uuid = uuid
)
listener?.onSelfieSuccess(
populateSelfieResponse(
data.apiResult,
@@ -160,7 +165,6 @@ class SelfieVerificationHelper {
data = jsonData?.getJSONObject("result")
}
val rawResponse = strToByteArray(jsonHeader?.optString("X-HV-Raw-Response"))
return SelfieUploadRequestData(
live = if (data != null && data.has("live")) data.getString("live") else null,
toBeReviewed = if (data != null && data.has("to-be-reviewed")) data.getString("to-be-reviewed") else null,
@@ -193,5 +197,6 @@ class SelfieVerificationHelper {
companion object {
private const val MAX_NO_SELFIE_INTRO = 1
private const val HYPERVERGE_REQUEST_ID = "X-HV-Request-Id"
}
}

View File

@@ -89,6 +89,7 @@ abstract class IHypervergeSelfieCapture {
const val LIVENESS_SCORE = "liveness-score"
const val HYERVERGE_RESPONSE_SIGNATURE = "X-HV-Response-Signature"
const val HYERVERGE_RAW_RESPONSE = "X-HV-Raw-Response"
const val HYPERVERGE_REQUEST_ID = "X-HV-Request-Id"
const val HYPERVERGE_IS_LIVE_KEY = "live"
}
}

View File

@@ -77,7 +77,13 @@ class PLHyperVergeSelfieInitStrategy : IHypervergeSelfieCapture() {
uuid: String?,
listener: HyperVergeSelfieCaptureListener?
) {
logApEvent(Pair(IMAGE_URI, data.imageURI), eventName = HYPERVERGE_SELFIE_SUCCESS)
val requestId = data.apiHeaders?.optString(HYPERVERGE_REQUEST_ID)
logApEvent(
Pair(IMAGE_URI, data.imageURI.orEmpty()),
Pair(HYPERVERGE_REQUEST_ID, requestId.orEmpty()),
Pair(UUID, uuid.orEmpty()),
eventName = HYPERVERGE_SELFIE_SUCCESS
)
listener?.onSelfieSuccess(
hyperVergeSelfieUploadRequestData =
createSelfieUploadRequestData(