NTP-41147 | Shiv natani | status check call before send money (#15084)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user