Updated on 2026-08-14
This commit is contained in:
parent
fc7b758aff
commit
c5d0ba8f58
25 changed files with 448 additions and 133 deletions
|
|
@ -11,4 +11,5 @@ data class TangemPayDetailsConfig(
|
|||
val cardFrozenState: TangemPayCardFrozenState,
|
||||
val cardNumberEnd: String,
|
||||
val chainId: Int,
|
||||
val isTangemPayDeactivated: Boolean,
|
||||
)
|
||||
|
|
@ -57,7 +57,6 @@ sealed class VisaApiError(
|
|||
data object CustomerIsBlocked : VisaApiError(104110210)
|
||||
data object UnknownWithoutCode : VisaApiError(104110999)
|
||||
data class Unknown(override val errorCode: Int) : VisaApiError(errorCode)
|
||||
data object Deactivated : VisaApiError(0)
|
||||
|
||||
fun isUnknown() = this is UnknownWithoutCode || this is Unknown
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ data class CustomerInfo(
|
|||
val productInstance: ProductInstance?,
|
||||
val kycStatus: KycStatus,
|
||||
val cardInfo: CardInfo?,
|
||||
val state: State,
|
||||
val fiatBalance: PaymentAccountStatusValue.FiatBalance?,
|
||||
) {
|
||||
enum class State {
|
||||
NEW,
|
||||
|
|
@ -49,7 +51,23 @@ data class CustomerInfo(
|
|||
val id: String,
|
||||
val cardId: String,
|
||||
val frozenState: TangemPayCardFrozenState,
|
||||
)
|
||||
val status: Status,
|
||||
) {
|
||||
enum class Status {
|
||||
NEW,
|
||||
READY_FOR_MANUFACTURING,
|
||||
MANUFACTURING,
|
||||
SENT_TO_DELIVERY,
|
||||
DELIVERED,
|
||||
ACTIVATING,
|
||||
ACTIVE,
|
||||
BLOCKED,
|
||||
DEACTIVATING,
|
||||
DEACTIVATED,
|
||||
CANCELED,
|
||||
UNKNOWN,
|
||||
}
|
||||
}
|
||||
|
||||
data class CardInfo(
|
||||
val lastFourDigits: String,
|
||||
|
|
|
|||
|
|
@ -6,5 +6,4 @@ sealed interface TangemPayCustomerInfoError {
|
|||
data object RefreshNeededError : TangemPayCustomerInfoError
|
||||
data object UnknownError : TangemPayCustomerInfoError
|
||||
data object ExposedDeviceError : TangemPayCustomerInfoError
|
||||
data object DeactivatedError : TangemPayCustomerInfoError
|
||||
}
|
||||
|
|
@ -62,10 +62,6 @@ class TangemPayMainScreenCustomerInfoUseCase(
|
|||
}
|
||||
|
||||
val result = proceedWithPaeraCustomerResult(userWalletId)
|
||||
if (result.leftOrNull() is TangemPayCustomerInfoError.DeactivatedError) {
|
||||
updateState(userWalletId, MainCustomerInfoContentState.Empty.right())
|
||||
return
|
||||
}
|
||||
updateState(userWalletId, result.map(MainCustomerInfoContentState::Content))
|
||||
} else {
|
||||
// if there's no tangem pay, check eligibility and show onboarding banner
|
||||
|
|
@ -172,7 +168,6 @@ class TangemPayMainScreenCustomerInfoUseCase(
|
|||
return when (this) {
|
||||
is VisaApiError.RefreshTokenExpired -> TangemPayCustomerInfoError.RefreshNeededError
|
||||
is VisaApiError.NotPaeraCustomer -> TangemPayCustomerInfoError.UnknownError
|
||||
is VisaApiError.Deactivated -> TangemPayCustomerInfoError.DeactivatedError
|
||||
else -> TangemPayCustomerInfoError.UnavailableError
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue