NTP-54315 | added error codes in payment failed bottom sheet touch points (#15819)

This commit is contained in:
Shaurya Rehan
2025-04-15 20:33:22 +05:30
committed by GitHub
parent bbc1377461
commit 335bdfa45f
4 changed files with 49 additions and 12 deletions

View File

@@ -3632,6 +3632,7 @@ class NaviPayAnalytics private constructor() {
}
fun onResetUpiPinClicked(
errorCode: String,
source: SendMoneyScreenSource,
transactionType: UpiTransactionType,
naviPaySessionAttributes: Map<String, String>,
@@ -3647,11 +3648,15 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryAddAccountClicked(naviPaySessionAttributes: Map<String, String>) {
fun onPaymentFailedRetryAddAccountClicked(
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_SendMoney_Payment_Failed_BottomSheet_AddAccount_Clicked",
eventValues =
@@ -3660,12 +3665,14 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryPayViaAnotherAccountClicked(
naviPaySessionAttributes: Map<String, String>
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName =
@@ -3676,11 +3683,15 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryOkayGotItClicked(naviPaySessionAttributes: Map<String, String>) {
fun onPaymentFailedRetryOkayGotItClicked(
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_SendMoney_Payment_Failed_BottomSheet_OkayGotIt_Clicked",
eventValues =
@@ -3689,11 +3700,15 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryCrossIconClicked(naviPaySessionAttributes: Map<String, String>) {
fun onPaymentFailedRetryCrossIconClicked(
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_SendMoney_Payment_Failed_BottomSheet_CrossIcon_Clicked",
eventValues =
@@ -3702,11 +3717,15 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryRetryClicked(naviPaySessionAttributes: Map<String, String>) {
fun onPaymentFailedRetryRetryClicked(
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_SendMoney_Payment_Failed_BottomSheet_Retry_Clicked",
eventValues =
@@ -3715,11 +3734,15 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}
fun onPaymentFailedRetryCheckBalanceClicked(naviPaySessionAttributes: Map<String, String>) {
fun onPaymentFailedRetryCheckBalanceClicked(
naviPaySessionAttributes: Map<String, String>,
errorCode: String,
) {
NaviTrackEvent.trackEventOnClickStream(
eventName = "NaviPay_SendMoney_Payment_Failed_BottomSheet_CheckBalance_Clicked",
eventValues =
@@ -3728,6 +3751,7 @@ class NaviPayAnalytics private constructor() {
naviPaySessionAttributes["naviPaySessionId"].orEmpty(),
"naviPayCustomerStatusMap" to
naviPaySessionAttributes["naviPayCustomerStatusMap"].orEmpty(),
"errorCode" to errorCode,
),
)
}

View File

@@ -242,17 +242,20 @@ fun SendMoneyBottomSheetContent(
when (ctaType) {
PaymentFailedErrorBottomSheetDismissCtaType.RETRY -> {
naviPayAnalytics.onPaymentFailedRetryRetryClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
}
PaymentFailedErrorBottomSheetDismissCtaType.OKAY_GOT_IT -> {
naviPayAnalytics.onPaymentFailedRetryOkayGotItClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
}
PaymentFailedErrorBottomSheetDismissCtaType.CROSS_BUTTON -> {
naviPayAnalytics.onPaymentFailedRetryCrossIconClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
}
}
@@ -263,13 +266,15 @@ fun SendMoneyBottomSheetContent(
sendMoneyScreenSource = sendMoneyScreenSource,
onAddAccountClicked = {
naviPayAnalytics.onPaymentFailedRetryAddAccountClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
onAddAccountClicked()
},
onPayViaAnotherAccountClicked = {
naviPayAnalytics.onPaymentFailedRetryPayViaAnotherAccountClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
onMoreAccountsClick(SEND_MONEY_PAYMENT_FAILED_MORE_ACCOUNTS)
},
@@ -277,7 +282,8 @@ fun SendMoneyBottomSheetContent(
selectedBankAccount = selectedBankAccount,
onCheckBalanceClicked = { accountId ->
naviPayAnalytics.onPaymentFailedRetryCheckBalanceClicked(
naviPaySessionAttributes = naviPaySessionAttributes
naviPaySessionAttributes = naviPaySessionAttributes,
errorCode = bottomSheetType.errorCode,
)
sendMoneyViewModel.onCheckBalanceClicked(accountId)
},

View File

@@ -174,6 +174,7 @@ sealed class SendMoneyBottomSheetType {
data object MerchantFeeInfoBottomSheet : SendMoneyBottomSheetType()
data class PaymentFailedRetryBottomSheet(
val errorCode: String,
val errorBucket: PaymentRetryErrorBucket,
val isPaymentThroughLite: Boolean,
) : SendMoneyBottomSheetType()

View File

@@ -459,6 +459,8 @@ constructor(
private var naviPayDefaultConfig = NaviPayDefaultConfig()
private var paymentFailedErrorCode: String = EMPTY
private val isQrFromUploadImage =
if (source is SendMoneyScreenSource.ScanAndPay) {
source.qrData.isQrFromUploadImage
@@ -1151,6 +1153,7 @@ constructor(
source = source,
naviPaySessionAttributes = getNaviPaySessionAttributes(),
transactionType = transactionType,
errorCode = paymentFailedErrorCode,
)
naviPayPspManager.evaluateAndOnboardPspForFlow(
@@ -2937,12 +2940,15 @@ constructor(
return
}
paymentFailedErrorCode = response.errors?.getOrNull(0)?.code.orEmpty()
/** is a valid error bucket, show payment failed retry bottom sheet */
updateBottomSheetUIState(
showBottomSheet = true,
bottomSheetStateChange = true,
bottomSheetUIState =
SendMoneyBottomSheetType.PaymentFailedRetryBottomSheet(
errorCode = paymentFailedErrorCode,
errorBucket = errorBucket,
isPaymentThroughLite = isPaymentThroughLite,
),