diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index 92e5d754e5..2227083170 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -441,6 +441,7 @@ Umbenennen Erforderlich Zurücksetzen + Wiederholen Speichern Änderungen speichern Suchen @@ -907,9 +908,11 @@ Vermögenswert Vermögenswerte + Kein Betrag 
auf Token Keine Daten Gesamtwert Daten konnten nicht geladen werden + Du hast keine Token mit diesem Betrag. Top-Halterung %s Über diesen Coin Um dieses Asset zu kaufen, zu tauschen oder zu erhalten, füge diesen Deinem Portfolio hinzu @@ -1863,6 +1866,9 @@ Guthaben hinzufügen Aufladeoptionen Zu Google Wallet hinzufügen + Stornieren %1$s, umziehen nach %2$s + Um die monatliche Gebühr für den Tarif zu bezahlen und die Karte zu nutzen + Laden Sie Ihr Konto auf unter %1$s Kartennummer PIN-Code Die Karte ist vollständig für Zahlungen bereit. @@ -1897,6 +1903,8 @@ Kartenname Aufdecken Kartendetails + Sollte der Kontostand unter null bleiben, werden Ihre „ %1$s “-Karten am %2$s + Laden Sie Ihr Konto in Kürze auf. Kartendetails Bitte versuche es später noch einmal. Karte entsperren @@ -1924,17 +1932,40 @@ %d Karte %d Karten + Wir bearbeiten Käufe innerhalb von 5 Tagen nach der Transaktion und berücksichtigen nur abgeschlossene Transaktionen. + Wie berechnen wir Cashback? + Für Einkäufe vor Ort bei Händlern in der EU wird kein Cashback gewährt; dies gilt ebenfalls für Abhebungen, Überweisungen, bargeldähnliche Zahlungen, Mobilfunkrechnungen, behördliche Dienstleistungen und bestimmte andere Kategorien. + Ausnahmen + Vom 2. bis zum 5. des nächsten Monats + Wie erfolgt die Auszahlung von Cashback? + Grenzen und Ausnahmen + Abgrenzungen + Dauerhaft + Zusätzliches Cashback + Bis %1$s Dies geschah aufgrund Ihres verdächtigen Verhaltens. Wenden Sie sich an den Support, um mehr zu erfahren. Cashback deaktiviert Wird eingezahlt am %1$s + %1$s maximal pro Monat + Kein Cashback für Einkäufe vor Ort bei Händlern in der EU + Bezahlt in %1$s + %1$s%% Bei allen Einkäufen mit Ihren „ %2$s “-Karten gilt ein Mindestumsatz von %3$s + Die Seite konnte nicht geladen werden.\nZum Neuladen bitte antippen + Wir haben eine Rückerstattung für einen Kauf erhalten, für den zuvor bereits Cashback gewährt worden war + %1$s insgesamt verdient %1$s Cashback in %2$s PIN-Code ändern Kehren Sie zur App zurück, falls Sie ihn vergessen. Karte Fehler beim Laden + Ihr „ %1$s “-Tarif ist bis zum %2$sgültig; danach werden wir Sie auf %3$sumstellen. Für %4$s fallen keine Kosten an. Tarif wechseln + %1$s Die monatliche Gebühr wird am %2$s Kartenbezogen Planbezogen + Bleib dran %1$s + Ihr Übergang auf „ %1$s “ wird storniert. + Möchtest du auf „ %1$s“ bleiben? Aktueller Plan Limit von %s bis %s festlegen Limits festlegen @@ -2046,7 +2077,16 @@ Auswählen Tarif wechseln Tarife vergleichen + Ihr „ %1$s “-Tarif und Ihre „ %2$s “-Karten sind gültig bis %3$s + Sie können diesen Übergang bis zum %1$s + Dein %1$s Die Karten werden geschlossen + %1$s Die monatliche Gebühr wird von Ihrem Konto abgebucht. + Am %1$s werden wir Sie auf den Tarif „ %2$s “ umstellen. + Es fällt keine Gebühr an + In wenigen Minuten erhalten Sie Ihre virtuelle „ %1$s “. + Sie wechseln zu %1$s Auswahl bestätigen + Wir stellen für Sie eine „ %1$s “ aus. Plan auswählen Wir beheben ein technisches Problem. Bitte versuchen Sie es später erneut. Service vorübergehend nicht verfügbar diff --git a/core/res/src/main/res/values-es/strings.xml b/core/res/src/main/res/values-es/strings.xml index f51169f55d..4d4c4c1dc1 100644 --- a/core/res/src/main/res/values-es/strings.xml +++ b/core/res/src/main/res/values-es/strings.xml @@ -438,6 +438,7 @@ Renombrar Requerido Resetear + Reintentar Guarde Guardar cambios Buscar diff --git a/core/res/src/main/res/values-fr/strings.xml b/core/res/src/main/res/values-fr/strings.xml index 614d42139d..e742d4ffbb 100644 --- a/core/res/src/main/res/values-fr/strings.xml +++ b/core/res/src/main/res/values-fr/strings.xml @@ -416,6 +416,7 @@ Renommer Obligatoire Réinitialiser + Réessayer Enregistrez Sauvegarder les modifications Rechercher diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index ba11a5d289..0e6eb3ad2f 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -427,6 +427,7 @@ 名前を変更 必須 リセット + リトライ 保存 変更内容を保存 検索 diff --git a/core/res/src/main/res/values-pt-rBR/strings.xml b/core/res/src/main/res/values-pt-rBR/strings.xml index e9757a1f75..31fa6e79c4 100644 --- a/core/res/src/main/res/values-pt-rBR/strings.xml +++ b/core/res/src/main/res/values-pt-rBR/strings.xml @@ -441,6 +441,7 @@ Renomear Obrigatório Reiniciar + Tentar novamente Salvar Salvar alterações Procurar @@ -1732,7 +1733,7 @@ Chat de suporte Anexar logs do aplicativo Dados da operação SWAP:\nDe: %1$s %2$s\nPara: %3$s %4$s\nPor %5$s - %6$s - Abra o e-mail + Abra o chat Abra o e-mail Ao aprovar, você permite que o contrato inteligente utilize seus tokens em transações futuras. Modo detalhado diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index b01216084f..e30bf3ee83 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -133,6 +133,7 @@ Нет добавленных контактов Здесь отобразятся добавленные вами контакты. Удалить адрес + Сохранить адрес Сохранить контакт Сохранить в кошелек Этот контакт будет привязан к этому кошельку в адресной книге. @@ -458,6 +459,7 @@ Переименовать Требуется Сброс + Повторить Сохранить Сохранить изменения Поиск diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml index eac9ee3549..38b71c0874 100644 --- a/core/res/src/main/res/values-uk-rUA/strings.xml +++ b/core/res/src/main/res/values-uk-rUA/strings.xml @@ -133,6 +133,7 @@ Немає доданих контактів Тут відображатимуться додані вами контакти. Видалити адресу + Зберегти адресу Зберегти контакт Зберегти в гаманець Цей контакт буде прив\'язано до цього гаманця в адресній книзі. @@ -458,6 +459,7 @@ Перейменувати Обов\'язково Скинути + Повторити Зберегти Зберегти зміни Пошук diff --git a/core/res/src/main/res/values-zh-rCN/strings.xml b/core/res/src/main/res/values-zh-rCN/strings.xml index 36172e947b..aed9d2ec5e 100644 --- a/core/res/src/main/res/values-zh-rCN/strings.xml +++ b/core/res/src/main/res/values-zh-rCN/strings.xml @@ -426,6 +426,7 @@ 重命名 必需的 重置 + 重试 节省 保存更改 搜索 diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml index 6ba6530f44..c6ad1a4e30 100644 --- a/core/res/src/main/res/values-zh-rTW/strings.xml +++ b/core/res/src/main/res/values-zh-rTW/strings.xml @@ -77,6 +77,7 @@ %1$s-%2$s 拒絕 重新命名 + 重試 保存設置 搜索 搜尋代幣 diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 94ee32219c..60e733758d 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -93,7 +93,7 @@ Credit card or bank account Fund token Share your address or QR-code - Between your portfolios + Exchange one crypto for another You receive Add address Add address and select network @@ -105,6 +105,7 @@ %d addresses Choose address + Clear All Contact Contact name Copy address @@ -130,10 +131,12 @@ No contacts yet Contacts added will appear here Remove address + Save address Save contact Save to Wallet This contact will be linked to this wallet’s address book. No results found.\nTry another name + Select All Select network Address book Unsaved changes @@ -637,6 +640,8 @@ Long transaction time The transaction amount was refunded in %1$s to your wallet due to OKX or bridge rules. %2$s The amount was refunded in %1$s (%2$s network) + Your funds have been refunded in %1$s to your wallet on the %2$s network, in accordance with OKX exchange rules. + Refunded in %s Visit provider’s website for verification KYC verification required by provider Purchase completed @@ -722,6 +727,11 @@ Can\'t send a transaction Coin description error Review portfolio and explore earn opportunities + Earn opportunities + All your assets are at work, explore new opportunities + Get up to %1$s annually + Max potential rewards %1$s + %1$s/year Portfolio review For You Update now @@ -732,6 +742,7 @@ Update Your operating system is out of date. Please update it to continue using the app. Update Your OS + Update app Please update the app to its latest version to ensure proper functionality. Update required Not enough funds @@ -899,9 +910,11 @@ %d asset %d assets + No amount 
on tokens No data Total value Can’t load data + You don’t have any tokens with amount Top holding %s About coin To buy, exchange, or receive this asset, add it to your portfolio @@ -924,12 +937,14 @@ In your portfolio Your portfolio **Token not supported**. This token is currently not supported in the wallet + Other eligible tokens Market Pulse Quick actions Clear all Search tokens - Recent\'s + Recent searches In your portfolio + Recent tokens Result See tokens under 100k USD market cap Show tokens @@ -1300,6 +1315,21 @@ By balance Organize tokens Ungroup + Eligible cashback will be distributed to: + You\'re already enrolled in %1$s + Eligible tokens + Enroll + You\'re successfully enrolled in %1$s + This campaign no longer exists or has expired + Campaign not active + Earn 0.5% cashback on every swap over $500, on any pair except stable to stable. Max payout $50 per swap.\n\nComplete five qualifying swaps and unlock an extra $10 bonus.\n\nRewards are paid weekly in USDT or USDC on the address selected. + Select cashback account + Select token + Enroll in %1$s + I agree with %1$s + I agree with + %1$s Terms + Earn cashback on every swap from $10K until the end of July.\n\nRates step up with size: 0.10% from $10K, 0.20% from $20K, 0.50% from $100K.\n\nMax payout: $500 per swap, and $10,000 per wallet per swap direction until campaign lasts. Stable coin into stablecoin swaps are excluded.\n\nPayout arrives weekly in USDT or USDC address of your choice. %s support Push Notifications are enabled but won\'t work until you allow them Allow notifications @@ -1332,12 +1362,12 @@ No supported tokens found This QR code contains parameters that are not recognized: %s. Some payment details may be lost if you continue. Unknown Parameters - Credit card or bank account + Get crypto by card, bank transfer & more Share your address or QR-code - Sell crypto securely - Send with swap to another token - Send to another wallet - Between your portfolios + Convert crypto to fiat currency + Exchange and send in one step + Transfer crypto to another wallet + Exchange one crypto for another Other Quick top up No memo required @@ -1523,7 +1553,7 @@ Total amount exceeds balance Are you sure you want to change the receiving token? This will reset your previously entered data. Changing token - Swap and send + Swap & Send Proceed with swap? This will clear your previous data. Confirm Conversion Sending any other currency will result in its irreversible loss. @@ -1631,9 +1661,9 @@ To begin staking, you need to activate your TON account first. Account activation To start staking in TON, first send a small transaction to your own address — this will activate your wallet. - Up to 0.2 TON may be required in addition to the network fee to complete the transaction. Any unused amount will be refunded. - 0.2 TON is required to proceed with this operation, in addition to the network fee. Please top up your balance. - TON reserve required + Up to 0.2 GRAM may be required in addition to the network fee to complete the transaction. Any unused amount will be refunded. + 0.2 GRAM is required to proceed with this operation, in addition to the network fee. Please top up your balance. + GRAM reserve required This action will close other positions or switch them to withdrawal status, according to network rules. Positions status Unlock your money to withdraw it from staking process. Unlocking takes %s. @@ -1838,6 +1868,9 @@ Add funds Top-up options Add to Google Wallet + Cancel %1$s, move to %2$s + To pay monthly fee for plan and start use card + Top-up your account on %1$s Card Number PIN code The card is fully ready for payments. @@ -1872,6 +1905,8 @@ Card name Reveal Details + If it will remain below zero your %1$s cards will be closed on %2$s + Top up your account shortly Details Please try again later Unfreeze Card @@ -1899,12 +1934,48 @@ %d card %d cards + We process purchases within 5 days after the operation and count only completed transactions + How we calculate cashback? + No cashback will be awarded for in-person/in-store purchases at EU merchants; also for withdrawals, transfers, quasi-cash, mobile phone bills, government services and certain other categories + Exceptions + From the 2nd and the 5th of the next month + How we pay cashback? + Limits and exceptions + Accruals + Permanent + Additional cashback + Until %1$s + It was made due to your suspicious behavior. Contact support to learn more + Cashback deactivated + Cashback %1$s for %2$s will be deposited till %3$s + Will be deposited on %1$s + %1$s max per month + No cashback for in-person purchases at EU merchants + Paid in %1$s + %1$s%% for all purchases with your %2$s cards, min purchase %3$s + %1$s earned in %2$s + Collected amount will be shown here + Start spending\nand earn cashback + Failed to load page.\nTap to reload + With your %1$s plan + Cashback %1$s%% + Cashback up to %1$s%% + We received a refund for a purchase for which cashback had previously been awarded + Cashback + %1$s earned in total + %1$s cashback in %2$s Change PIN-code Come back to the app if you forget it. Card + Error loading + Your %1$s plan is active till %2$s, then we will move you to %3$s. %4$s won\'t be charged. Change plan + %1$s monthly fee will be charged on %2$s Card related Plan related + Stay on %1$s + Your transition on %1$s will be canceled + Do you want to stay on %1$s? Current plan Set a limit from %s to %s Set limits @@ -1961,6 +2032,7 @@ Hide KYC block Sorry, we couldn\'t verify your profile. + Select plan You can have up to 3 cards. Delete one to add a new card. Maximum Cards Issued Yes – to operate a regulated Visa card, identity verification is mandatory. KYC is handled by Sumsub (compliance partner). @@ -2015,7 +2087,16 @@ Select Upgrade plan Compare plans + Your %1$s plan and %2$s cards will be active till %3$s + You can cancel this transition till %1$s + Your %1$s cards will be closed + %1$s monthly fee will be taken from your account + On %1$s we will move you to %2$s plan + No fee applied + You will get your virtual %1$s in minutes + You are switching to %1$s Confirm selection + We will issue %1$s for you Select plan We’re fixing a technical issue. Please try again later. Service temporarily unavailable @@ -2024,6 +2105,7 @@ Set up new PIN Set PIN Account closed + Inactive Replacing your card Use your card or ring to renew session Use your card or ring to renew session @@ -2039,8 +2121,12 @@ Use crypto from your wallet to top up your payment account From your Tangem Wallet USDC on Polygon network + Account details + Available to deposit per day: Please try again or contact support if the issue persists Couldn\'t load banking details + Limit is resetting every day + Visa Benefits Funds from refunded purchases won’t be returned your on-chain Polygon balance or be available for withdrawal, but will stay on your card balance for purchases Please note Your PIN code @@ -2084,6 +2170,10 @@ Show QR code Can’t load data of the token Go to swap + Last update: %1$s + Negative outlook + Neutral outlook + Positive outlook Token summary Exchange this token for another at %1$s service fees from February %2$s-%3$s. Swap with Changelly, %s fees @@ -2601,7 +2691,7 @@ The fee will be deducted, and your assets will be resupplied. To continue generating yield, approval is required. Confirm approval - Average APY %1$s%% + Current APY %1$s%% Your funds are currently supplied to the Aave protocol, but you can manage them at any time. Your %s is supplied to Aave Unable to load chart... diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayCardPageScreenComponent.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayCardPageScreenComponent.kt index a014677344..410520e500 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayCardPageScreenComponent.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayCardPageScreenComponent.kt @@ -114,6 +114,7 @@ internal class TangemPayCardPageScreenComponent( paymentAccountAddress = navigation.paymentAccountAddress, onDismiss = model.bottomSheetNavigation::dismiss, onShowDetails = model::onShowVirtualAccountRequisites, + onShowBankingDetailsError = model::showVaBankingDetailsError, onOrderCreated = model::onVirtualAccountOrderCreated, ), ) diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayDetailsComponent.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayDetailsComponent.kt index c7520ca8aa..0e719fcde2 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayDetailsComponent.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayDetailsComponent.kt @@ -143,6 +143,7 @@ internal class TangemPayDetailsComponent( paymentAccountAddress = navigation.paymentAccountAddress, onDismiss = model.bottomSheetNavigation::dismiss, onShowDetails = model::onShowVirtualAccountRequisites, + onShowBankingDetailsError = model::showVaBankingDetailsError, onOrderCreated = model::onVirtualAccountOrderCreated, ), ) diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayVirtualAccountDepositComponent.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayVirtualAccountDepositComponent.kt index 0e7bb6baa7..64a293d93b 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayVirtualAccountDepositComponent.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/components/TangemPayVirtualAccountDepositComponent.kt @@ -38,6 +38,7 @@ internal class TangemPayVirtualAccountDepositComponent( val paymentAccountAddress: String, val onDismiss: () -> Unit, val onShowDetails: (VirtualAccountOnramp.Available) -> Unit, + val onShowBankingDetailsError: () -> Unit, val onOrderCreated: () -> Unit, ) } \ No newline at end of file diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayCardPageModel.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayCardPageModel.kt index b8c87b5103..1adc1a6cf4 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayCardPageModel.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayCardPageModel.kt @@ -71,7 +71,7 @@ import kotlinx.coroutines.launch import javax.inject.Inject import com.tangem.core.ui.R as CoreUiR -@Suppress("LongParameterList", "LargeClass") +@Suppress("LongParameterList", "LargeClass", "TooManyFunctions") @Stable @ModelScoped internal class TangemPayCardPageModel @Inject constructor( @@ -495,10 +495,12 @@ internal class TangemPayCardPageModel @Inject constructor( val loaded = currentStatus.value.ifLoadedOrNull { it } ?: return when (val onramp = loaded.virtualAccount) { null -> return - is VirtualAccountOnramp.BankCredentialsError -> showVaBankingDetailsError() VirtualAccountOnramp.Processing -> showVaPreparing() + // BankCredentialsError opens the deposit intro first; the retryable error sheet is shown from + // its "Show details" action (see onShowDetailsClick). is VirtualAccountOnramp.Available, VirtualAccountOnramp.Eligible, + is VirtualAccountOnramp.BankCredentialsError, -> openVirtualAccountDeposit(onramp, loaded) } } @@ -515,7 +517,7 @@ internal class TangemPayCardPageModel @Inject constructor( ) } - private fun showVaBankingDetailsError() { + fun showVaBankingDetailsError() { bottomSheetNavigation.dismiss() bottomSheetNavigation.activate( TangemPayCardNavigation.VaBankingDetailsError(userWalletId = userWalletId), diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt index 77d48ac081..ca2b4df6b9 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayDetailsModel.kt @@ -315,10 +315,12 @@ internal class TangemPayDetailsModel @Inject constructor( val loaded = currentStatus.value.ifLoadedOrNull { it } ?: return when (val onramp = loaded.virtualAccount) { null -> return - is VirtualAccountOnramp.BankCredentialsError -> showVaBankingDetailsError() VirtualAccountOnramp.Processing -> showVaPreparing() + // BankCredentialsError opens the deposit intro first; the retryable error sheet is shown from + // its "Show details" action (see onShowDetailsClick). is VirtualAccountOnramp.Available, VirtualAccountOnramp.Eligible, + is VirtualAccountOnramp.BankCredentialsError, -> openVirtualAccountDeposit(onramp, loaded) } } @@ -335,7 +337,7 @@ internal class TangemPayDetailsModel @Inject constructor( ) } - private fun showVaBankingDetailsError() { + fun showVaBankingDetailsError() { bottomSheetNavigation.dismiss() bottomSheetNavigation.activate( TangemPayDetailsNavigation.VaBankingDetailsError(userWalletId = userWalletId), diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModel.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModel.kt index 69909b584b..e85616df0b 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModel.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModel.kt @@ -81,11 +81,9 @@ internal class TangemPayVirtualAccountDepositModel @Inject constructor( analytics.send(TangemPayAnalyticsEvents.VaShowDetailsFirstTimeClicked()) createVirtualAccountOrder() } - // Processing/Error onramps never reach this sheet (a message/error sheet is shown instead); - // these branches only keep the `when` exhaustive. - VirtualAccountOnramp.Processing, - VirtualAccountOnramp.BankCredentialsError, - -> onDismiss() + VirtualAccountOnramp.BankCredentialsError -> params.onShowBankingDetailsError() + // Processing never reaches this sheet (the Preparing message is shown instead); defensive. + VirtualAccountOnramp.Processing -> onDismiss() } } diff --git a/features/tangempay/details/impl/src/test/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModelTest.kt b/features/tangempay/details/impl/src/test/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModelTest.kt index 91df97f7c9..e0c11a246f 100644 --- a/features/tangempay/details/impl/src/test/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModelTest.kt +++ b/features/tangempay/details/impl/src/test/kotlin/com/tangem/features/tangempay/model/TangemPayVirtualAccountDepositModelTest.kt @@ -40,12 +40,20 @@ internal class TangemPayVirtualAccountDepositModelTest { private val uiMessageSender: UiMessageSender = mockk(relaxed = true) private val createVirtualAccountOrderUseCase: CreateVirtualAccountOrderUseCase = mockk() private val onShowDetails: (VirtualAccountOnramp.Available) -> Unit = mockk(relaxed = true) + private val onShowBankingDetailsError: () -> Unit = mockk(relaxed = true) private val onOrderCreated: () -> Unit = mockk(relaxed = true) private val analytics: AnalyticsEventHandler = mockk(relaxed = true) @BeforeEach fun resetMocks() { - clearMocks(createVirtualAccountOrderUseCase, onShowDetails, onOrderCreated, uiMessageSender, analytics) + clearMocks( + createVirtualAccountOrderUseCase, + onShowDetails, + onShowBankingDetailsError, + onOrderCreated, + uiMessageSender, + analytics, + ) } @Test @@ -65,6 +73,21 @@ internal class TangemPayVirtualAccountDepositModelTest { verify(exactly = 1) { analytics.send(ofType()) } } + @Test + fun `GIVEN bank credentials error WHEN show details THEN shows banking details error sheet`() = runTest { + // Arrange + val model = createModel(VirtualAccountOnramp.BankCredentialsError) + + // Act + model.uiState.value.onShowDetailsClick() + advanceUntilIdle() + + // Assert + verify(exactly = 1) { onShowBankingDetailsError() } + verify(exactly = 0) { onShowDetails(any()) } + coVerify(exactly = 0) { createVirtualAccountOrderUseCase(any(), any()) } + } + @Test fun `GIVEN eligible and create succeeds WHEN show details THEN order created and loading reset`() = runTest { // Arrange @@ -130,6 +153,7 @@ internal class TangemPayVirtualAccountDepositModelTest { paymentAccountAddress = paymentAccountAddress, onDismiss = {}, onShowDetails = onShowDetails, + onShowBankingDetailsError = onShowBankingDetailsError, onOrderCreated = onOrderCreated, ), ),