TP-57671 | Added logs for cred block params (#9834)

Co-authored-by: shaurya-rehan <shaurya.rehan@navi.com>
This commit is contained in:
Ujjwal Kumar
2024-02-20 14:57:55 +05:30
committed by GitHub
parent 97d10f0481
commit 6ff87416e6
3 changed files with 88 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ object FirebaseRemoteConfigHelper {
"UPI_LITE_NUDGE_ENABLED_ON_PAYMENT_SUMMARY_SCREEN"
const val ENABLE_UI_TRON_MODIFIER_BUILDER = "ENABLE_UI_TRON_MODIFIER_BUILDER"
const val ENABLE_NAVI_PAY_KILL_SWITCH_MECHANISM = "ENABLE_NAVI_PAY_KILL_SWITCH_MECHANISM"
const val NAVI_PAY_ENABLE_CRED_BLOCK_LOGS = "NAVI_PAY_ENABLE_CRED_BLOCK_LOGS"
// BBPS
const val NAVI_BBPS_CATEGORIES_CACHE_MILLIS = "NAVI_BBPS_CATEGORIES_CACHE_MILLIS"

View File

@@ -2284,6 +2284,59 @@ class NaviPayAnalytics private constructor() {
)
}
fun onRegisterUserDataLogs(
hmac: String,
token: String,
random: String,
challenge: String,
tokenRequestType: String,
mobileNumber: String,
deviceData: String
) {
NaviTrackEvent.trackEventOnClickStream(
"Dev_NaviPay_NpciCl_RegisterUserDataLogs",
mapOf(
"hmac" to hmac,
"token" to token,
"random" to random,
"challenge" to challenge,
"tokenRequestType" to tokenRequestType,
"mobileNumber" to mobileNumber,
"deviceData" to deviceData
)
)
}
fun onFetchCredentialDataLogs(
xmlPayload: String,
trustMapJson: String,
payInfoJson: String,
configurationJson: String,
credAllowedJson: String,
parentSalt: String,
random: String
) {
NaviTrackEvent.trackEventOnClickStream(
"Dev_NaviPay_NpciCl_FetchCredentialDataLogs",
mapOf(
"xmlPayload" to xmlPayload,
"trustMapJson" to trustMapJson,
"payInfoJson" to payInfoJson,
"configurationJson" to configurationJson,
"credAllowedJson" to credAllowedJson,
"parentSalt" to parentSalt,
"random" to random
)
)
}
fun onSaltForCredTypeTxnIdMap(entry: String, salt: String) {
NaviTrackEvent.trackEventOnClickStream(
"Dev_NaviPay_NpciCl_SaltForCredTypeTxnIdMap",
mapOf("entry" to entry, "salt" to salt)
)
}
fun onRegisterUserCalled(
deviceData: DeviceData,
mobileNumber: String,

View File

@@ -13,6 +13,8 @@ import android.os.Looper
import android.os.ResultReceiver
import android.util.Base64
import com.google.gson.Gson
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.NAVI_PAY_ENABLE_CRED_BLOCK_LOGS
import com.navi.common.network.models.RepoResult
import com.navi.common.network.models.isError
import com.navi.common.network.models.isSuccessWithData
@@ -165,6 +167,19 @@ constructor(
deviceId = deviceData.deviceId,
random = random
)
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_PAY_ENABLE_CRED_BLOCK_LOGS)) {
naviPayAnalytics.onRegisterUserDataLogs(
hmac = hmac,
random = random,
token = token,
challenge = challenge,
tokenRequestType = tokenRequestType,
mobileNumber = mobileNumber,
deviceData = deviceData.toString(),
)
}
val isRegistered =
npciClService.instance.registerApp(
deviceData.packageName,
@@ -277,6 +292,13 @@ constructor(
)
.toJson(gson = gson)
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_PAY_ENABLE_CRED_BLOCK_LOGS)) {
naviPayAnalytics.onSaltForCredTypeTxnIdMap(
salt = salt,
entry = entry.toString(),
)
}
trustMap[entry.key] = npciUtils.createTrust(salt = salt, token = npciToken) ?: ""
}
@@ -292,6 +314,18 @@ constructor(
isSaltAvailable = parentSalt.isNotBlank()
)
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_PAY_ENABLE_CRED_BLOCK_LOGS)) {
naviPayAnalytics.onFetchCredentialDataLogs(
credAllowedJson = credAllowedJson,
configurationJson = configurationJson,
payInfoJson = payInfoJson,
trustMapJson = trustMapJson,
xmlPayload = xmlPayload,
parentSalt = parentSalt,
random = random
)
}
npciClService.instance.getCredential(
npciCredData.keyCode,
xmlPayload,