NTP-14642 | retry logic fix for lite sync and execute mandate (#14461)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -11,7 +11,6 @@ import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navi.base.cache.model.NaviCacheEntity
|
||||
import com.navi.base.cache.repository.NaviCacheRepository
|
||||
import com.navi.base.utils.retry
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.network.models.isSuccessWithData
|
||||
import com.navi.common.utils.Constants.UNDERSCORE
|
||||
@@ -37,10 +36,8 @@ 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.utils.DEFAULT_RETRY_COUNT
|
||||
import com.navi.pay.utils.DEFAULT_UPI_CURRENCY
|
||||
import com.navi.pay.utils.KEY_UPI_LITE_MANDATE_INFO
|
||||
import com.navi.pay.utils.RETRY_INTERVAL_IN_SECONDS
|
||||
import com.navi.pay.utils.UPI_LITE_CONFIG
|
||||
import com.navi.pay.utils.UPI_LITE_TOPUP
|
||||
import com.navi.pay.utils.getFormattedAmountWithDecimal
|
||||
@@ -178,16 +175,9 @@ constructor(
|
||||
)
|
||||
|
||||
val executeMandateApiResponse =
|
||||
retry(
|
||||
retryCount = DEFAULT_RETRY_COUNT,
|
||||
retryIntervalInSeconds = RETRY_INTERVAL_IN_SECONDS,
|
||||
execute = {
|
||||
performMandateExecution(
|
||||
upiLiteMandateInfo = upiLiteMandateInfo,
|
||||
executeMandateRequest = executeMandateRequest
|
||||
)
|
||||
},
|
||||
shouldRetry = { !it.isSuccessWithData() }
|
||||
performMandateExecution(
|
||||
upiLiteMandateInfo = upiLiteMandateInfo,
|
||||
executeMandateRequest = executeMandateRequest
|
||||
)
|
||||
|
||||
naviPayAnalytics.onDevGenericEvent(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -67,21 +67,19 @@ constructor(
|
||||
params = mapOf("lrn" to lrn, "accountId" to accountId, "screenName" to screenName)
|
||||
)
|
||||
|
||||
val liteSyncRequest =
|
||||
LiteSyncRequest(
|
||||
deviceData = deviceData,
|
||||
lrn = lrn,
|
||||
merchantCustomerId = deviceInfoProvider.getMerchantCustomerId(),
|
||||
upiRequestId = upiRequestIdUseCase.execute()
|
||||
)
|
||||
|
||||
val liteSyncResponse =
|
||||
retry(
|
||||
retryCount = DEFAULT_RETRY_COUNT,
|
||||
retryIntervalInSeconds = RETRY_INTERVAL_IN_SECONDS,
|
||||
execute = {
|
||||
upiLiteRepository.liteSync(
|
||||
liteSyncRequest = liteSyncRequest,
|
||||
liteSyncRequest =
|
||||
LiteSyncRequest(
|
||||
deviceData = deviceData,
|
||||
lrn = lrn,
|
||||
merchantCustomerId = deviceInfoProvider.getMerchantCustomerId(),
|
||||
upiRequestId = upiRequestIdUseCase.execute()
|
||||
),
|
||||
metricInfo = getMetricInfo(screenName = screenName, isNae = { false })
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user