NTP-24902 | Divyesh | arc handling for payment failed (#14778)
Co-authored-by: Shivam Goyal <shivam.goyal@navi.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import com.navi.base.utils.ResourceProvider
|
||||
import com.navi.common.R as CommonR
|
||||
import com.navi.pay.R
|
||||
import com.navi.pay.tstore.details.model.view.ArcStatusWidgetProperties
|
||||
import com.navi.pay.tstore.details.model.view.OrderPaymentStatus
|
||||
import com.navi.pay.tstore.details.model.view.OrderProductType
|
||||
import com.navi.pay.tstore.details.ui.bbps.OrderBbpsUtils.isRechargeCategory
|
||||
import com.navi.pay.tstore.list.model.view.OrderStatusOfView
|
||||
@@ -31,6 +32,7 @@ object ArcStatusWidgetUtils {
|
||||
arcThresholdInDays: String,
|
||||
orderTimestamp: DateTime,
|
||||
orderTerminalTimestampFormatted: String,
|
||||
paymentStatus: OrderPaymentStatus,
|
||||
): ArcStatusWidgetProperties? {
|
||||
|
||||
if (!isArcProtected) {
|
||||
@@ -74,6 +76,14 @@ object ArcStatusWidgetUtils {
|
||||
}
|
||||
// ArcProtected but notDelayed
|
||||
|
||||
if (paymentStatus == OrderPaymentStatus.FAILED) {
|
||||
return getArcStatusWidgetPropertiesForFailedStatusOfView(
|
||||
resourceProvider = resourceProvider,
|
||||
categoryId = categoryId,
|
||||
orderProductType = productType,
|
||||
)
|
||||
}
|
||||
|
||||
return when (orderStatusOfView) {
|
||||
OrderStatusOfView.Pending -> {
|
||||
getArcStatusWidgetPropertiesForPendingOrderStatusOfView(
|
||||
|
||||
@@ -1024,6 +1024,7 @@ constructor(
|
||||
arcThresholdInDays = arcNudgeCoinDaysPair.value.second,
|
||||
orderTerminalTimestampFormatted =
|
||||
orderEntity.orderTerminalTimestampFormatted,
|
||||
paymentStatus = orderEntity.paymentStatus,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1033,6 +1034,10 @@ constructor(
|
||||
return
|
||||
}
|
||||
|
||||
if (orderEntity.value?.paymentStatus == OrderPaymentStatus.FAILED) {
|
||||
return
|
||||
}
|
||||
|
||||
if (orderEntity.value?.orderStatusOfView == OrderStatusOfView.Pending) {
|
||||
|
||||
if (!orderEntity.value?.arcRewardCoins.isNullOrEmpty()) {
|
||||
@@ -1188,7 +1193,10 @@ constructor(
|
||||
liteAccountSyncUseCase.execute(screenName = screenName)
|
||||
}
|
||||
prepareArcStatusWidgetProperties()
|
||||
if (newOrderStatusOfView != OrderStatusOfView.Pending) {
|
||||
if (
|
||||
newOrderStatusOfView != OrderStatusOfView.Pending ||
|
||||
newPaymentStatus == OrderPaymentStatus.FAILED
|
||||
) {
|
||||
_showArcBottomSheetOnWidgetClick.update { false }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,15 @@ class BBPSOrderManager : IOrderManager {
|
||||
orderReferenceId = optString("orderReferenceId").orEmpty(),
|
||||
productType = OrderProductType.BBPS.name,
|
||||
productId = "", // Tstore order sync: will be synced from server
|
||||
orderStatusOfView = OrderStatusOfView.Pending,
|
||||
orderStatusOfView =
|
||||
if (
|
||||
OrderPaymentStatus.getStatusFromValue(value = optString("status")) ==
|
||||
OrderPaymentStatus.FAILED
|
||||
) {
|
||||
OrderStatusOfView.Failed
|
||||
} else {
|
||||
OrderStatusOfView.Pending
|
||||
},
|
||||
amount = optString("amount").orEmpty(),
|
||||
currency = "INR", // Tstore order sync: hardcoded
|
||||
orderTitle = optString("orderTitle").orEmpty(),
|
||||
|
||||
Reference in New Issue
Block a user