NTP-41147 | Shiv natani | status check call before send money (#15084)

This commit is contained in:
Shiv Natani
2025-02-23 18:22:50 +05:30
committed by GitHub
parent 2007c23f70
commit 36fd97dc1d
8 changed files with 11 additions and 11 deletions

View File

@@ -18,12 +18,12 @@ data class TransactionStatusRequestEntity(
@ColumnInfo(name = "token") val token: String? = null,
@ColumnInfo(name = "event") val event: String? = null,
@ColumnInfo(name = "screenType") val screenType: String? = null,
@ColumnInfo(name = "status") val status: String = TransactionStatus.INITTIATED.name,
@ColumnInfo(name = "status") val status: String = TransactionStatus.INITIATED.name,
@ColumnInfo(name = "retryCount") val retryCount: Int = 0,
)
enum class TransactionStatus {
INITTIATED,
INITIATED,
SUCCESS,
ERROR,
USER_CANCELLED_TRANSACTION,

View File

@@ -538,8 +538,7 @@ constructor(
screenType = NaviPaymentScreenType.FULL_PAYMENT_SCREEN.name,
event = EMPTY,
status =
com.navi.payment.nativepayment.db.model.TransactionStatus.INITTIATED
.name,
com.navi.payment.nativepayment.db.model.TransactionStatus.INITIATED.name,
)
}
savePayNowResponse(response)

View File

@@ -481,7 +481,7 @@ constructor(
token = paymentSdkInitParams?.token.orEmpty(),
screenType = NaviPaymentScreenType.MINI_PAYMENT_SCREEN.name,
event = EMPTY,
status = TransactionStatus.INITTIATED.name,
status = TransactionStatus.INITIATED.name,
)
}
payNowResponse = response.data

View File

@@ -1105,8 +1105,7 @@ constructor(
screenType = NaviPaymentScreenType.FULL_PAYMENT_SCREEN.name,
event = EMPTY,
status =
com.navi.payment.nativepayment.db.model.TransactionStatus.INITTIATED
.name,
com.navi.payment.nativepayment.db.model.TransactionStatus.INITIATED.name,
)
}
when (val responseData = response.data) {

View File

@@ -310,7 +310,7 @@ constructor(
screenType = NaviPaymentScreenType.FULL_PAYMENT_SCREEN.name,
event = EMPTY,
status =
com.navi.payment.nativepayment.db.model.TransactionStatus.INITTIATED.name,
com.navi.payment.nativepayment.db.model.TransactionStatus.INITIATED.name,
)
}
when (val payNowResponseData = response.data) {

View File

@@ -146,6 +146,7 @@ constructor(
pmsSendMoneyUseCase.performChecksAndExecuteSendMoney(
naviUpiTransactionInfo = naviUpiTransactionInfo!!,
onInitialChecksFailure = { errorConfig ->
notifyNaviUpiExit()
processPaymentFailure(
errorConfig = errorConfig.toNaviPaymentErrorConfig(),
errorReason = PMSErrorReason.UPIError,
@@ -159,6 +160,7 @@ constructor(
tstoreOrderId = tstoreOrderReferenceId,
screenName = screenName,
onPaymentSuccess = { sendMoneyResponse ->
notifyNaviUpiExit()
val transactionStatus =
TransactionStatus.toTransactionStatus(status = sendMoneyResponse.status)
.name
@@ -179,6 +181,7 @@ constructor(
)
},
onPaymentFailure = { sendMoneyResponse ->
notifyNaviUpiExit()
val errorConfig =
sendMoneyResponse.toGenericErrorResponse().toPaymentNaviPaymentErrorConfig()
processPaymentFailure(
@@ -199,7 +202,6 @@ constructor(
paymentAmount = paymentAmount.toString(),
)
}
viewModelScope.safeLaunch(Dispatchers.IO) { notifyNaviUpiExit() }
}
private fun pollTransactionStatus(pollingCount: Int = 0) {

View File

@@ -357,7 +357,7 @@ constructor(
screenType = NaviPaymentScreenType.FULL_PAYMENT_SCREEN.name,
event = EMPTY,
status =
com.navi.payment.nativepayment.db.model.TransactionStatus.INITTIATED.name,
com.navi.payment.nativepayment.db.model.TransactionStatus.INITIATED.name,
)
}
when (val payNowResponseData = response.data) {

View File

@@ -172,7 +172,7 @@ constructor(
token = paymentsToken.orEmpty(),
screenType = NaviPaymentScreenType.FULL_PAYMENT_SCREEN.name,
event = EMPTY,
status = TransactionStatus.INITTIATED.name,
status = TransactionStatus.INITIATED.name,
)
val upiAction =
initiatePayAmountAction.upiAction?.apply {