NTP-17539 | corrected vpa in lite subsequent mandate execution (#14105)

This commit is contained in:
Shaurya Rehan
2024-12-12 14:39:21 +05:30
committed by GitHub
parent 8a4fd0b50c
commit 6438fe433b
3 changed files with 5 additions and 18 deletions

View File

@@ -37,7 +37,6 @@ import com.navi.pay.management.mandate.model.view.MandateResponseState
import com.navi.pay.management.mandate.model.view.MandateStatus
import com.navi.pay.management.mandate.repository.MandateRepository
import com.navi.pay.network.di.NaviPayGsonBuilder
import com.navi.pay.onboarding.account.detail.model.view.LinkedAccountEntity
import com.navi.pay.utils.DEFAULT_RETRY_COUNT
import com.navi.pay.utils.DEFAULT_UPI_CURRENCY
import com.navi.pay.utils.KEY_UPI_LITE_MANDATE_INFO
@@ -86,7 +85,7 @@ constructor(
)
}
suspend fun execute(linkedAccountEntity: LinkedAccountEntity? = null, screenName: String) {
suspend fun execute(screenName: String) {
this.screenName = screenName
val upiLiteMandateInfo = getCachedMandateInfo()
naviPayAnalytics.onDevGenericEvent(
@@ -94,10 +93,9 @@ constructor(
params =
mapOf(
"upiLiteMandateInfo" to upiLiteMandateInfo.toString(),
"linkedAccountEntity" to linkedAccountEntity.toString()
)
)
if (upiLiteMandateInfo == null || linkedAccountEntity == null) {
if (upiLiteMandateInfo == null) {
return
}
@@ -133,7 +131,6 @@ constructor(
// Proceed for mandate execution
initiateMandateExecution(
linkedAccountEntity = linkedAccountEntity,
upiLiteMandateInfo = upiLiteMandateInfo,
upiLiteBalance = upiLiteBalance
)
@@ -147,7 +144,6 @@ constructor(
}
private suspend fun initiateMandateExecution(
linkedAccountEntity: LinkedAccountEntity,
upiLiteMandateInfo: MandateItem,
upiLiteBalance: Double
) {
@@ -156,7 +152,7 @@ constructor(
liteMandateResponseInfo = upiLiteMandateInfo.liteMandateResponseInfo
)
val bankAccountUniqueId = linkedAccountEntity.accountId.substringBefore(UNDERSCORE)
val bankAccountUniqueId = upiLiteMandateInfo.bankAccountUniqueId.orEmpty()
val executeMandateRequest =
ExecuteMandateRequest(
@@ -172,7 +168,7 @@ constructor(
umn = upiLiteMandateInfo.umn.orEmpty(),
merchantCustomerId = deviceInfoProvider.getMerchantCustomerId(),
isFirstMandateExecution = false,
payerVpa = linkedAccountEntity.vpa,
payerVpa = upiLiteMandateInfo.payerVpa,
payeeVpa =
getFormattedPayeeVpaForLiteMandate(lrn = liteMandateMetaData.lrn.orEmpty()),
currency = DEFAULT_UPI_CURRENCY,

View File

@@ -2247,7 +2247,6 @@ constructor(
isLiteLowBalanceNotificationsEnabled =
isLiteLowBalanceNotificationsEnabled(),
isLiteAutoTopUpExperimentEnabled = isLiteAutoTopUpExperimentEnabled.value,
linkedAccountEntity = selectedBankAccount.value,
screenName = screenName
)
}
@@ -2302,7 +2301,6 @@ constructor(
isLiteLowBalanceNotificationsEnabled =
isLiteLowBalanceNotificationsEnabled(),
isLiteAutoTopUpExperimentEnabled = isLiteAutoTopUpExperimentEnabled.value,
linkedAccountEntity = selectedBankAccount.value,
screenName = screenName,
isPaymentThroughLiteAccount = isPaymentThroughLiteAccount
)

View File

@@ -9,7 +9,6 @@ package com.navi.pay.management.lite.util
import com.navi.pay.common.usecase.SubsequentLiteMandateExecutionUseCase
import com.navi.pay.common.usecase.UpiLiteLowBalanceNotificationUseCase
import com.navi.pay.onboarding.account.detail.model.view.LinkedAccountEntity
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -25,7 +24,6 @@ constructor(
fun handle(
isLiteLowBalanceNotificationsEnabled: Boolean,
isLiteAutoTopUpExperimentEnabled: Boolean,
linkedAccountEntity: LinkedAccountEntity?,
screenName: String,
isPaymentThroughLiteAccount: Boolean = true
) {
@@ -37,12 +35,7 @@ constructor(
// Trigger mandate execution for any payment that is a success
if (isLiteAutoTopUpExperimentEnabled) {
launch {
subsequentLiteMandateExecutionUseCase.execute(
linkedAccountEntity = linkedAccountEntity,
screenName = screenName
)
}
launch { subsequentLiteMandateExecutionUseCase.execute(screenName = screenName) }
}
}
}