Updated on 2026-08-14
This commit is contained in:
parent
ab6832b5e9
commit
d0c76d4fc4
2 changed files with 6 additions and 3 deletions
|
|
@ -94,8 +94,8 @@ internal class DefaultOnboardingRepository @Inject constructor(
|
||||||
val result = response.result
|
val result = response.result
|
||||||
val status = result?.productInstance?.status
|
val status = result?.productInstance?.status
|
||||||
val isDeactivated = status == CustomerMeResponse.ProductInstance.Status.DEACTIVATED
|
val isDeactivated = status == CustomerMeResponse.ProductInstance.Status.DEACTIVATED
|
||||||
val isBlocked = result?.state?.let { CustomerInfo.State.fromString(it) } == CustomerInfo.State.BLOCKED
|
val isFormer = result?.state?.let { CustomerInfo.State.fromString(it) } == CustomerInfo.State.FORMER
|
||||||
if (isDeactivated || isBlocked) {
|
if (isDeactivated || isFormer) {
|
||||||
tangemPayStorage.storeIsTangemPayDeactivated(userWalletId)
|
tangemPayStorage.storeIsTangemPayDeactivated(userWalletId)
|
||||||
VisaApiError.Deactivated.left()
|
VisaApiError.Deactivated.left()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.tangem.domain.models.account.PaymentAccountStatusValue
|
||||||
import com.tangem.domain.models.kyc.KycStatus
|
import com.tangem.domain.models.kyc.KycStatus
|
||||||
import com.tangem.domain.visa.model.TangemPayCardFrozenState
|
import com.tangem.domain.visa.model.TangemPayCardFrozenState
|
||||||
import java.math.BigDecimal
|
import java.math.BigDecimal
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
sealed class MainCustomerInfoContentState {
|
sealed class MainCustomerInfoContentState {
|
||||||
object Loading : MainCustomerInfoContentState()
|
object Loading : MainCustomerInfoContentState()
|
||||||
|
|
@ -27,15 +28,17 @@ data class CustomerInfo(
|
||||||
NEW,
|
NEW,
|
||||||
ACTIVE,
|
ACTIVE,
|
||||||
BLOCKED,
|
BLOCKED,
|
||||||
|
FORMER,
|
||||||
IN_PROGRESS,
|
IN_PROGRESS,
|
||||||
UNDEFINED,
|
UNDEFINED,
|
||||||
;
|
;
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun fromString(value: String) = when (value.uppercase()) {
|
fun fromString(value: String) = when (value.uppercase(Locale.US)) {
|
||||||
"NEW" -> NEW
|
"NEW" -> NEW
|
||||||
"ACTIVE" -> ACTIVE
|
"ACTIVE" -> ACTIVE
|
||||||
"BLOCKED" -> BLOCKED
|
"BLOCKED" -> BLOCKED
|
||||||
|
"FORMER" -> FORMER
|
||||||
"IN_PROGRESS" -> IN_PROGRESS
|
"IN_PROGRESS" -> IN_PROGRESS
|
||||||
else -> UNDEFINED
|
else -> UNDEFINED
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue