NTP-71120 | Crash fix in RSMS flow and NaviPayActivityDataProvider in release 499 (#16596)
This commit is contained in:
committed by
GitHub
parent
3d00f705f5
commit
37780e010a
@@ -51,6 +51,7 @@ import com.navi.pay.destinations.UpiGlobalScreenDestination
|
||||
import com.navi.pay.destinations.UpiNumberScreenDestination
|
||||
import com.navi.pay.entry.NaviPayActivity
|
||||
import com.navi.pay.entry.NaviPayActivityDataProvider
|
||||
import com.navi.pay.management.common.sendmoney.model.view.SendMoneyScreenSource
|
||||
import com.navi.pay.management.common.sendmoney.model.view.UpiTransactionType
|
||||
import com.navi.pay.management.moneytransfer.scanpay.util.getPayeeEntity
|
||||
import com.navi.pay.onboarding.account.linked.model.view.LinkedAccountsScreenSource
|
||||
@@ -149,7 +150,9 @@ object NaviPayRouter {
|
||||
type = bundle.getString(TRANSACTION_TYPE).orEmpty(),
|
||||
defaultType = UpiTransactionType.INTENT_PAY,
|
||||
),
|
||||
sendMoneyScreenSource = bundle.getParcelable(SEND_MONEY_SCREEN_SOURCE),
|
||||
sendMoneyScreenSource =
|
||||
bundle.getParcelable(SEND_MONEY_SCREEN_SOURCE)
|
||||
?: SendMoneyScreenSource.Default,
|
||||
)
|
||||
SendMoneyScreenDestination()
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class NaviPayActivityDataProvider @Inject constructor() {
|
||||
fun setSendMoneyScreenData(
|
||||
payeeEntity: PayeeEntity?,
|
||||
transactionType: UpiTransactionType = UpiTransactionType.P2P_PAY,
|
||||
sendMoneyScreenSource: SendMoneyScreenSource? = SendMoneyScreenSource.Default,
|
||||
sendMoneyScreenSource: SendMoneyScreenSource = SendMoneyScreenSource.Default,
|
||||
) {
|
||||
putValue(TRANSACTION_TYPE, transactionType.name)
|
||||
putValue(PAYEE_ENTITY, payeeEntity)
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.navi.pay.entry.NaviPayActivityDataProvider
|
||||
import com.navi.pay.management.common.sendmoney.model.view.PayeeEntity
|
||||
import com.navi.pay.management.common.sendmoney.model.view.SendMoneyRegexValidationFailureType
|
||||
import com.navi.pay.management.common.sendmoney.model.view.SendMoneyRegexValidationRule
|
||||
import com.navi.pay.management.common.sendmoney.model.view.SendMoneyScreenSource
|
||||
import com.navi.pay.management.common.sendmoney.model.view.UpiTransactionType
|
||||
import com.navi.pay.utils.isAsciiDigit
|
||||
import com.navi.rr.common.models.OfferData
|
||||
@@ -88,7 +89,8 @@ object SendMoneyUtils {
|
||||
type = bundle.getString(TRANSACTION_TYPE).orEmpty(),
|
||||
defaultType = UpiTransactionType.INTENT_PAY,
|
||||
),
|
||||
sendMoneyScreenSource = bundle.getParcelable(SEND_MONEY_SCREEN_SOURCE),
|
||||
sendMoneyScreenSource =
|
||||
bundle.getParcelable(SEND_MONEY_SCREEN_SOURCE) ?: SendMoneyScreenSource.Default,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,9 +359,7 @@ constructor(
|
||||
|
||||
private var generatedOtpToken: String = EMPTY
|
||||
|
||||
private var isBindingEligibleForSmv = false
|
||||
|
||||
private var isBindingEligibleForRsms = false
|
||||
private var bindingType: BindingType = BindingType.SMS
|
||||
|
||||
private val locationPermissionRequestResult = Channel<Unit>(capacity = 1)
|
||||
|
||||
@@ -696,9 +694,9 @@ constructor(
|
||||
viewModelScope.safeLaunch(coroutineDispatcherProvider.io) {
|
||||
handleDropOffFunnel(funnelStep = FunnelStep.BINDING_STARTED)
|
||||
updateShowButtonLoader(true)
|
||||
isBindingEligibleForRsms = getRsmsEligibilityStatus()
|
||||
|
||||
val isBindingEligibleForRsms = getRsmsEligibilityStatus()
|
||||
if (isBindingEligibleForRsms) {
|
||||
bindingType = BindingType.RSMS()
|
||||
startSimBinding()
|
||||
return@safeLaunch
|
||||
}
|
||||
@@ -710,7 +708,7 @@ constructor(
|
||||
return@safeLaunch
|
||||
}
|
||||
|
||||
isBindingEligibleForSmv = true
|
||||
bindingType = BindingType.SMV
|
||||
|
||||
// SMV is eligible cases
|
||||
if (!smvEligibilityStatus.isSmsPermissionEnabled) {
|
||||
@@ -931,7 +929,7 @@ constructor(
|
||||
onBindingError(bindDeviceAPIResponse)
|
||||
}
|
||||
|
||||
if (isBindingEligibleForRsms) {
|
||||
if (bindingType is BindingType.RSMS) {
|
||||
markRsmsTriggeredAndFailed()
|
||||
}
|
||||
|
||||
@@ -961,9 +959,9 @@ constructor(
|
||||
merchantCustomerId = merchantCustomerId,
|
||||
)
|
||||
|
||||
if (isBindingEligibleForRsms) {
|
||||
if (bindingType is BindingType.RSMS) {
|
||||
processBindDeviceResponseForRsms()
|
||||
} else if (isBindingEligibleForSmv) {
|
||||
} else if (bindingType is BindingType.SMV) {
|
||||
processBindDeviceResponseForSmv()
|
||||
} else {
|
||||
processBindDeviceResponseForSms(provider = provider)
|
||||
@@ -984,15 +982,11 @@ constructor(
|
||||
version = Build.VERSION.SDK_INT.toString(),
|
||||
)
|
||||
|
||||
val bindingType =
|
||||
if (isBindingEligibleForRsms) BindingType.RSMS().name()
|
||||
else if (isBindingEligibleForSmv) BindingType.SMV.name() else BindingType.SMS.name()
|
||||
|
||||
naviPayAnalytics.onBindDeviceCallForBinding(
|
||||
deviceAttributes = deviceAttributes,
|
||||
onboardingSource = onboardingSource.value,
|
||||
naviPaySessionAttributes = getNaviPaySessionAttributes(),
|
||||
bindingType = bindingType,
|
||||
bindingType = bindingType.name(),
|
||||
)
|
||||
|
||||
return BindDeviceRequest(
|
||||
@@ -1007,9 +1001,9 @@ constructor(
|
||||
.getCustomerOnboardingEntity(onboardingPsp)
|
||||
?.merchantCustomerId
|
||||
.takeIf { it?.isNotBlank() == true },
|
||||
bindingType = bindingType,
|
||||
bindingType = bindingType.name(),
|
||||
rsmsBindingRequestData =
|
||||
if (bindingType != BindingType.RSMS().name()) null
|
||||
if (bindingType !is BindingType.RSMS) null
|
||||
else
|
||||
RsmsBindingRequestData(
|
||||
integrityToken =
|
||||
@@ -1022,7 +1016,7 @@ constructor(
|
||||
)
|
||||
),
|
||||
isAutoOtpPermitted =
|
||||
if (bindingType == BindingType.RSMS().name()) true else isConsentGivenForOtpAutoRead,
|
||||
if (bindingType is BindingType.RSMS) true else isConsentGivenForOtpAutoRead,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2086,6 +2080,9 @@ constructor(
|
||||
|
||||
fun onRsmsAutoReadOtpReceived(otp: String, senderAddress: String?) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
if (bindingType !is BindingType.RSMS) {
|
||||
return@launch
|
||||
}
|
||||
updateGeneratedOtp(otp = otp)
|
||||
updateAutoReadOtpVerificationState(AutoReadOtpVerificationState.VERIFYING)
|
||||
otpTimerJob?.cancel()
|
||||
|
||||
Reference in New Issue
Block a user