Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-29 18:24:12 +05:00
parent 4faf6e9cb0
commit e06dc1297d
16 changed files with 287 additions and 8 deletions

View file

@ -0,0 +1,20 @@
package com.tangem.domain.models.account
import kotlinx.serialization.Serializable
/**
* Bank (fiat) credentials for a Virtual Account on-ramp the wire/ACH requisites a user transfers funds to.
*
* Returned by `bff-v2/v1/account/bank-credentials/{product_instance_id}`. Sensitive data kept transient
* (never persisted in the local payment-account cache).
*/
@Serializable
data class BankCredentials(
val type: String,
val beneficiaryName: String,
val beneficiaryAddress: String,
val beneficiaryBankName: String,
val beneficiaryBankAddress: String,
val accountNumber: String,
val routingNumber: String,
)

View file

@ -149,6 +149,8 @@ sealed class PaymentAccountStatusValue {
* [totalFiatBalance] resolves to [TotalFiatBalance.Failed].
* @property error Transient error overlaid on top of cached data when a refresh fails
* (see [copySealed]), or `null` when the status is up to date. Not persisted.
* @property virtualAccount Virtual Account (Visa on-ramp) availability VA MVP0 (TWI-1638).
* Transient: not persisted in the local cache.
*/
@Serializable
data class Loaded(
@ -160,6 +162,7 @@ sealed class PaymentAccountStatusValue {
val cards: List<TangemPayCard>,
val fiatRate: SerializedBigDecimal?,
val error: Error?,
val virtualAccount: VirtualAccountOnramp,
) : PaymentAccountStatusValue() {
val cryptoCurrencyStatus: CryptoCurrencyStatus = CryptoCurrencyStatus(
currency = cryptoCurrency,

View file

@ -0,0 +1,28 @@
package com.tangem.domain.models.account
import kotlinx.serialization.Serializable
/**
* Virtual Account (Visa on-ramp) availability for a payment account VA MVP0 (TWI-1638).
*
* Computed in the payment-account fetcher and surfaced on [PaymentAccountStatusValue.Loaded].
* Transient: [Available.bankCredentials] is never persisted in the local cache.
*/
@Serializable
sealed interface VirtualAccountOnramp {
/** On-ramp not applicable: feature toggle off, or wallet not eligible. */
@Serializable
data object None : VirtualAccountOnramp
/** No VA product instance yet, but the wallet is eligible to add funds (channel `VISA_VIRTUAL_ACCOUNT`). */
@Serializable
data object Eligible : VirtualAccountOnramp
/** VA product instance exists; [bankCredentials] are the fiat requisites for the bank-transfer top-up. */
@Serializable
data class Available(
val productInstanceId: String,
val bankCredentials: BankCredentials,
) : VirtualAccountOnramp
}

View file

@ -10,6 +10,8 @@ enum class TangemPayEligibilityType {
DETAILS_VIRTUAL_ACCOUNT,
DEEPLINK_VIRTUAL_ACCOUNT,
VISA_VIRTUAL_ACCOUNT,
UNKNOWN,
;
@ -21,6 +23,7 @@ enum class TangemPayEligibilityType {
"BANNER_VIRTUAL_ACCOUNT" -> BANNER_VIRTUAL_ACCOUNT
"DETAILS_VIRTUAL_ACCOUNT" -> DETAILS_VIRTUAL_ACCOUNT
"DEEPLINK_VIRTUAL_ACCOUNT" -> DEEPLINK_VIRTUAL_ACCOUNT
"VISA_VIRTUAL_ACCOUNT" -> VISA_VIRTUAL_ACCOUNT
else -> UNKNOWN
}
}