Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-27 03:04:49 -07:00
parent d84f383cf8
commit 357bee1107
9 changed files with 7 additions and 47 deletions

View file

@ -38,30 +38,6 @@ internal class PreviewEmptyExpressTransactionsComponent : ExpressTransactionsCom
fromSymbol = "USD",
iconState = ExpressTransactionStateIconUM.None,
),
sampleOnrampUM(
txId = "preview-onramp-2",
title = "Buying USDC",
activeStatusText = "Waiting for payment",
activeStatus = OnrampStatus.Status.WaitingForPayment,
timestampAgo = "1h ago",
toAmount = "250.00",
toSymbol = "USDC",
fromAmount = "250.00",
fromSymbol = "EUR",
iconState = ExpressTransactionStateIconUM.Warning,
),
sampleOnrampUM(
txId = "preview-onramp-3",
title = "Buying USDC",
activeStatusText = "Failed",
activeStatus = OnrampStatus.Status.Failed,
timestampAgo = "2d ago",
toAmount = "50.00",
toSymbol = "USDC",
fromAmount = "50.00",
fromSymbol = "USD",
iconState = ExpressTransactionStateIconUM.Error,
),
)
return ExpressTransactionsBlockState(
transactions = sample,

View file

@ -34,6 +34,7 @@ import com.tangem.domain.models.pay.TangemPayCard
import com.tangem.domain.models.pay.TangemPayCardLimitPeriod
import com.tangem.domain.models.pay.TangemPayCardState
import com.tangem.domain.models.pay.isFrozen
import com.tangem.domain.pay.TangemPayCurrencyFactory
import com.tangem.domain.pay.flow.PaymentAccountStatusFetcher
import com.tangem.domain.pay.flow.PaymentAccountStatusSupplier
import com.tangem.domain.pay.model.TangemPayTopUpData
@ -81,6 +82,7 @@ internal class TangemPayCardPageModel @Inject constructor(
private val changeCardFrozenStateUseCase: ChangeCardFrozenStateUseCase,
private val cardDetailsEventListener: CardDetailsEventListener,
private val cardDetailsControllerFactory: TangemPayCardDetailsController.Factory,
tangemPayCurrencyFactory: TangemPayCurrencyFactory,
) : Model(), ViewPinListener, ReissueCardListener, AddFundsListener, CloseCardListener {
private val params: TangemPayCardPageComponent.Params = paramsContainer.require()
@ -106,8 +108,7 @@ internal class TangemPayCardPageModel @Inject constructor(
MutableStateFlow(persistentListOf())
val cardControllersState: StateFlow<ImmutableList<TangemPayCardDetailsController>> = _cardControllersState
private val cryptoCurrency
get() = currentStatus.value.cryptoCurrency
private val cryptoCurrency = tangemPayCurrencyFactory.create(userWalletId)
val uiState: StateFlow<TangemPayCardPageUM>
field = MutableStateFlow(

View file

@ -26,6 +26,7 @@ import com.tangem.domain.feedback.models.WalletMetaInfo
import com.tangem.domain.models.TokenReceiveConfig
import com.tangem.domain.models.account.*
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.pay.TangemPayCurrencyFactory
import com.tangem.domain.pay.flow.PaymentAccountStatusFetcher
import com.tangem.domain.pay.flow.PaymentAccountStatusSupplier
import com.tangem.domain.pay.model.TangemPayTopUpData
@ -84,6 +85,7 @@ internal class TangemPayDetailsModel @Inject constructor(
private val getCashbackSummaryUseCase: GetCashbackSummaryUseCase,
private val getCashbackDeactivationDismissedUseCase: GetCashbackDeactivationDismissedUseCase,
private val setCashbackDeactivationDismissedUseCase: SetCashbackDeactivationDismissedUseCase,
tangemPayCurrencyFactory: TangemPayCurrencyFactory,
) : Model(),
TangemPayTxHistoryUiActions,
TangemPayDetailIntents,
@ -97,8 +99,7 @@ internal class TangemPayDetailsModel @Inject constructor(
private val userWalletId
get() = currentStatus.value.userWalletId
val cryptoCurrency
get() = currentStatus.value.cryptoCurrency
val cryptoCurrency: CryptoCurrency.Token = tangemPayCurrencyFactory.create(userWalletId)
private val stateFactory = TangemPayDetailsStateFactory(
onBack = router::pop,

View file

@ -3,21 +3,11 @@ package com.tangem.features.tangempay.utils
import com.tangem.domain.models.account.AccountStatus
import com.tangem.domain.models.account.PaymentAccountStatusValue
import com.tangem.domain.models.account.TangemPayCustomerTariffPlan
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.wallet.UserWalletId
internal val AccountStatus.Payment.userWalletId: UserWalletId
get() = account.userWalletId
internal val AccountStatus.Payment.cryptoCurrency: CryptoCurrency.Token
get() = when (val v = value) {
is PaymentAccountStatusValue.Loaded -> v.cryptoCurrency
is PaymentAccountStatusValue.Deactivated -> v.cryptoCurrency
is PaymentAccountStatusValue.Inactive -> v.cryptoCurrency
is PaymentAccountStatusValue.AwaitingPlanSelection -> v.cryptoCurrency
else -> error("TangemPayDetails opened with unsupported status: $v")
}
internal val AccountStatus.Payment.customerId: String?
get() = when (val v = value) {
is PaymentAccountStatusValue.Loaded -> v.customerId

View file

@ -148,6 +148,7 @@ internal class TangemPayDetailsModelTest {
getCashbackSummaryUseCase = mockk(relaxed = true),
getCashbackDeactivationDismissedUseCase = mockk(relaxed = true),
setCashbackDeactivationDismissedUseCase = mockk(relaxed = true),
tangemPayCurrencyFactory = mockk(relaxed = true),
)
}