TP-36163 | PS | fix no-order creation (#7735)

This commit is contained in:
Prakhar Saxena
2023-09-05 21:56:45 +05:30
committed by GitHub
parent d6e9f91892
commit 397b34cd48
4 changed files with 12 additions and 4 deletions

View File

@@ -217,8 +217,10 @@ class CheckerActivity : BasePaymentActivity() {
}
override fun onBackPressed() {
apiPollScheduler?.stopApiPoll()
super.onBackPressed()
if(isBackAllowed()) {
apiPollScheduler?.stopApiPoll()
super.onBackPressed()
}
}
private fun apiPollInit(
@@ -579,6 +581,10 @@ class CheckerActivity : BasePaymentActivity() {
return type == PENNY_DROP && actionData?.url.equals(REDIRECT_CTA)
}
private fun isBackAllowed(): Boolean {
return (type != PAYMENT_CALLBACK && type != PAYMENT_CALLBACK_SYNC)
}
override fun getPaymentProcessingEventName() =
if (type == PAYMENT_INIT
|| type == PAYMENT_CALLBACK

View File

@@ -276,6 +276,7 @@ class OtpFragment : AmcBaseFragment(), View.OnClickListener {
putString(PaymentAnalytics.SYNC, PaymentAnalytics.TRUE)
putString(PaymentAnalytics.PROVIDER, it.provider)
}
popThisFromBackStack()
fragmentInterchangeListener?.navigateToNextScreen(ActionData(url = url), bundle)
}
}

View File

@@ -8,6 +8,7 @@ package com.navi.amc.common.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.navi.common.utils.SingleLiveEvent
import com.navi.common.viewmodel.BaseVM
import com.navi.payment.model.PostPaymentData
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -16,7 +17,7 @@ import javax.inject.Inject
@HiltViewModel
class PaymentSharedVM @Inject constructor() : BaseVM() {
private val _postPaymentStatus = MutableLiveData<PostPaymentData?>()
private val _postPaymentStatus = SingleLiveEvent<PostPaymentData?>()
val postPaymentStatus: LiveData<PostPaymentData?>
get() = _postPaymentStatus

View File

@@ -134,7 +134,7 @@ class NewActionErrorFragment : BaseBottomSheet() {
error?.actions?.getOrNull(1)?.url?.let{
buttonListener?.invoke(it)
} ?: run {
openErrorCta(error?.actions?.firstOrNull())
openErrorCta(error?.actions?.getOrNull(1))
}
}
dismissDialog()