Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-16 10:38:00 +05:00
parent 0bd23be25f
commit 2c754243f5
16 changed files with 378 additions and 29 deletions

View file

@ -496,6 +496,7 @@ internal class TangemPayCardPageModel @Inject constructor(
when (val onramp = loaded.virtualAccount) {
null -> return
is VirtualAccountOnramp.BankCredentialsError -> showVaBankingDetailsError()
VirtualAccountOnramp.Processing -> showVaPreparing()
is VirtualAccountOnramp.Available,
VirtualAccountOnramp.Eligible,
-> openVirtualAccountDeposit(onramp, loaded)
@ -521,6 +522,11 @@ internal class TangemPayCardPageModel @Inject constructor(
)
}
private fun showVaPreparing() {
bottomSheetNavigation.dismiss()
uiMessageSender.send(message = TangemPayMessagesFactory.createVaPreparingMessage())
}
fun onVaBankingDetailsResolved(onramp: VirtualAccountOnramp) {
val loaded = currentStatus.value.ifLoadedOrNull { it } ?: return
openVirtualAccountDeposit(onramp, loaded)

View file

@ -316,6 +316,7 @@ internal class TangemPayDetailsModel @Inject constructor(
when (val onramp = loaded.virtualAccount) {
null -> return
is VirtualAccountOnramp.BankCredentialsError -> showVaBankingDetailsError()
VirtualAccountOnramp.Processing -> showVaPreparing()
is VirtualAccountOnramp.Available,
VirtualAccountOnramp.Eligible,
-> openVirtualAccountDeposit(onramp, loaded)
@ -341,6 +342,11 @@ internal class TangemPayDetailsModel @Inject constructor(
)
}
private fun showVaPreparing() {
bottomSheetNavigation.dismiss()
uiMessageSender.send(message = TangemPayMessagesFactory.createVaPreparingMessage())
}
fun onVaBankingDetailsResolved(onramp: VirtualAccountOnramp) {
val loaded = currentStatus.value.ifLoadedOrNull { it } ?: return
openVirtualAccountDeposit(onramp, loaded)

View file

@ -81,9 +81,11 @@ internal class TangemPayVirtualAccountDepositModel @Inject constructor(
analytics.send(TangemPayAnalyticsEvents.VaShowDetailsFirstTimeClicked())
createVirtualAccountOrder()
}
// Error onramp is intercepted before this sheet opens (a dedicated error sheet is shown instead);
// the branch only keeps the `when` exhaustive.
VirtualAccountOnramp.BankCredentialsError -> onDismiss()
// 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()
}
}

View file

@ -177,6 +177,23 @@ internal object TangemPayMessagesFactory {
)
}
fun createVaPreparingMessage(): BottomSheetMessage {
return bottomSheetMessage {
infoBlock {
icon(R.drawable.ic_clock_24) {
type = MessageBottomSheetUM.Icon.Type.Informative
backgroundType = MessageBottomSheetUM.Icon.BackgroundType.Informative
}
title = TextReference.Res(R.string.tangempay_bank_transfer_success_title)
body = TextReference.Res(R.string.tangempay_bank_transfer_success_subtitle)
}
secondaryButton {
text = resourceReference(R.string.common_got_it)
onClick { closeBs() }
}
}
}
fun createFutureFeature(onGotItClick: () -> Unit): BottomSheetMessage {
return bottomSheetMessage {
infoBlock {

View file

@ -25,7 +25,7 @@ internal fun BankCredentials.toRequisitesRows(): List<RequisitesRow> = listOf(
RequisitesRow(
title = resourceReference(R.string.virtual_account_requisites_beneficiary_address),
titleForShare = "Beneficiary address",
value = beneficiaryBankAddress,
value = beneficiaryAddress,
),
RequisitesRow(
title = resourceReference(R.string.virtual_account_requisites_bank_name),