NTP-44548 | Regression Bug Fix (#15949)
This commit is contained in:
committed by
GitHub
parent
5db54c6a28
commit
d9473c89ad
@@ -170,6 +170,7 @@ private fun VpaAddressRow(
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||
if (vpaIcon.isNotNullAndNotEmpty()) {
|
||||
VpaIconBadge(iconUrl = vpaIcon, isBankTransfer = isBankTransfer)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
}
|
||||
|
||||
if (vpaAddress.isNotNullAndNotEmpty()) {
|
||||
@@ -198,7 +199,7 @@ private fun VpaAddressText(text: String, color: Color) {
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = color,
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
modifier = Modifier,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
|
||||
@@ -610,7 +610,10 @@ fun EmptyLedgerScreen(
|
||||
@Composable
|
||||
fun LoaderState() {
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
repeat(2) { ShimmerRow(isStartAligned = it % 2 == 0) }
|
||||
repeat(4) {
|
||||
ShimmerRow(isStartAligned = it % 2 == 0)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ import com.navi.pay.utils.DEFAULT_BANK_UP_TIME_SUCCESS_RATE
|
||||
import com.navi.pay.utils.DEFAULT_CONFIG
|
||||
import com.navi.pay.utils.DEFAULT_UPI_PURPOSE
|
||||
import com.navi.pay.utils.DOT_PNG
|
||||
import com.navi.pay.utils.ERR_FAILED_TO_FETCH_EXTERNAL_CUSTOMER_ID
|
||||
import com.navi.pay.utils.INTENT_OR_SCAN_PAY_TRANSACTION_ERROR
|
||||
import com.navi.pay.utils.INVALID_VPA
|
||||
import com.navi.pay.utils.KEY_IS_FIRST_TRANSACTION_SUCCESSFUL
|
||||
@@ -876,6 +877,8 @@ constructor(
|
||||
}
|
||||
|
||||
private suspend fun checkIfTransactionLedgerIsAvailable(): Boolean {
|
||||
val isValidExternalId =
|
||||
payeeEntity.value.equals(ERR_FAILED_TO_FETCH_EXTERNAL_CUSTOMER_ID).not()
|
||||
val experimentResult =
|
||||
litmusExperimentsUseCase.execute(
|
||||
experimentName = LITMUS_EXPERIMENT_NAVIPAY_TRANSACTION_LEDGER
|
||||
@@ -891,7 +894,7 @@ constructor(
|
||||
PreferenceManager.getStringPreference(USER_EXTERNAL_ID).orEmpty()
|
||||
)
|
||||
|
||||
return isMccCompatible && isExperimentEnabled && isNotSelfTransaction
|
||||
return isMccCompatible && isExperimentEnabled && isNotSelfTransaction && isValidExternalId
|
||||
}
|
||||
|
||||
private fun handleLedgerAvailableState() {
|
||||
@@ -1387,8 +1390,11 @@ constructor(
|
||||
}
|
||||
|
||||
private fun updateScreenState(screenState: SendMoneyScreenState) {
|
||||
// Remove loader On Pay button for Main Screen State
|
||||
if (screenState is SendMoneyScreenState.MainScreen) {
|
||||
// Remove loader On Pay button for Main Screen State or Ledger screen state
|
||||
if (
|
||||
screenState is SendMoneyScreenState.MainScreen ||
|
||||
screenState is SendMoneyScreenState.TransactionLedgerScreen
|
||||
) {
|
||||
updateShowPayButtonLoader(false)
|
||||
}
|
||||
_screenState.update { screenState }
|
||||
@@ -2260,7 +2266,11 @@ constructor(
|
||||
if (pspEvaluationResult.isOnboardingTriggered) {
|
||||
updateTriggerDismissBottomSheet()
|
||||
}
|
||||
updateScreenState(screenState = SendMoneyScreenState.MainScreen)
|
||||
updateScreenState(
|
||||
screenState =
|
||||
if (transactionLedgerEnabled()) SendMoneyScreenState.TransactionLedgerScreen
|
||||
else SendMoneyScreenState.MainScreen
|
||||
)
|
||||
notifyError(getNoInternetErrorConfig())
|
||||
return
|
||||
}
|
||||
@@ -2887,7 +2897,11 @@ constructor(
|
||||
payeeVpa = payeeEntity.value.vpa,
|
||||
sendMoneyRegexValidationFailureType = sendMoneyRegexValidationFailureType,
|
||||
)
|
||||
updateScreenState(screenState = SendMoneyScreenState.MainScreen)
|
||||
updateScreenState(
|
||||
screenState =
|
||||
if (transactionLedgerEnabled()) SendMoneyScreenState.TransactionLedgerScreen
|
||||
else SendMoneyScreenState.MainScreen
|
||||
)
|
||||
when (sendMoneyRegexValidationFailureType) {
|
||||
SendMoneyRegexValidationFailureType.INVALID_UPI_REQUEST_ID -> {
|
||||
notifyError(
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.viewModelScope
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.utils.ResourceProvider
|
||||
import com.navi.base.utils.isNotNullAndNotEmpty
|
||||
import com.navi.common.constants.EMPTY
|
||||
import com.navi.common.extensions.or
|
||||
import com.navi.common.extensions.removeSpaces
|
||||
@@ -50,6 +51,7 @@ import com.navi.pay.utils.NAVI_PAY_SEARCH_QUERY_API_DELAY
|
||||
import com.navi.pay.utils.NAVI_PAY_WIDGET_CLICKED_KEY
|
||||
import com.navi.pay.utils.NOT_LINKED_TO_UPI
|
||||
import com.navi.pay.utils.PHONE_NUMBER_LENGTH
|
||||
import com.navi.pay.utils.REMOVE_WHITESPACE_REGEX
|
||||
import com.navi.pay.utils.isValidPhoneNumberLength
|
||||
import com.navi.pay.utils.isValidSearchQuery
|
||||
import com.ramcosta.composedestinations.spec.Direction
|
||||
@@ -444,9 +446,19 @@ constructor(
|
||||
screenName = screenName,
|
||||
)
|
||||
|
||||
// Temporary fix for mobile number
|
||||
val payeeVpaToDisplay =
|
||||
getNormalisedPhoneNumber(frequentOrderEntity.payeeInfo?.mobNo)
|
||||
.or(frequentOrderEntity.orderDescription)
|
||||
frequentOrderEntity.payeeInfo?.mobNo?.let { mobNo ->
|
||||
val mobNoWithoutSpaces = mobNo.replace(REMOVE_WHITESPACE_REGEX, EMPTY)
|
||||
if (
|
||||
mobNo.isNotNullAndNotEmpty() &&
|
||||
mobNoWithoutSpaces.count { it.isDigit() } >= PHONE_NUMBER_LENGTH
|
||||
) {
|
||||
getNormalisedPhoneNumber(mobNoWithoutSpaces)
|
||||
} else {
|
||||
frequentOrderEntity.orderDescription
|
||||
}
|
||||
} ?: frequentOrderEntity.orderDescription
|
||||
|
||||
if (response.isSuccessWithData()) {
|
||||
handleAPIResponseSuccessAndUpdateNextDestination(
|
||||
|
||||
@@ -85,6 +85,7 @@ import com.navi.pay.management.common.sendmoney.model.view.PayeeEntity
|
||||
import com.navi.pay.management.common.sendmoney.model.view.PayeeTransactionHistoryEntity
|
||||
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.common.sendmoney.model.view.UpiTransactionType.Companion.getUpiTransactionType
|
||||
import com.navi.pay.management.common.transaction.model.network.TransactionInstrumentType
|
||||
import com.navi.pay.management.common.transaction.model.view.TransactionCategoryTags
|
||||
import com.navi.pay.management.common.transaction.model.view.TransactionPaymentModeTags
|
||||
@@ -1085,6 +1086,8 @@ constructor(
|
||||
|
||||
naviPayActivityDataProvider.setSendMoneyScreenData(
|
||||
payeeEntity = payeeEntity,
|
||||
transactionType =
|
||||
getUpiTransactionType(naviPayTransactionDetailsMetadata?.txnType.orEmpty()),
|
||||
sendMoneyScreenSource = sendMoneyScreenSource,
|
||||
)
|
||||
updateNavigationToNextScreen(SendMoneyScreenDestination())
|
||||
|
||||
@@ -493,6 +493,7 @@ val UPI_ID_VALIDATION_REGEX = Regex(pattern = ".+@.{2,}")
|
||||
val SEARCH_QUERY_VALIDATION_REGEX = Regex("^\\+?\\d+\$")
|
||||
val PAYMENT_AMOUNT_VALIDATION_REGEX = Regex(pattern = "^[1-9]\\d*\\.\\d{2}\$")
|
||||
val UPI_REQUEST_ID_VALIDATION_REGEX = Regex(pattern = "^[a-zA-Z0-9]{35}\$")
|
||||
val REMOVE_WHITESPACE_REGEX = Regex(pattern = "\\s")
|
||||
|
||||
const val HEX_FORMAT = "%02x"
|
||||
const val SHA_256 = "SHA-256"
|
||||
@@ -559,3 +560,6 @@ const val OF = "of"
|
||||
const val PERCENTAGE = "%"
|
||||
const val MULTIPLY = "x"
|
||||
const val GOLD_ROUND_OFF_AMOUNT = "Round-off amount"
|
||||
|
||||
// External id error
|
||||
const val ERR_FAILED_TO_FETCH_EXTERNAL_CUSTOMER_ID = "ERR_FAILED_TO_FETCH_EXTERNAL_CUSTOMER_ID"
|
||||
|
||||
Reference in New Issue
Block a user