Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-01 04:32:24 -07:00
parent b27ff31652
commit ad0b09deae
24 changed files with 397 additions and 40 deletions

View file

@ -13,6 +13,7 @@ import kotlinx.serialization.Serializable
* @property limit spending limit configuration for the card; `null` if not configured or not yet loaded.
* @property frozenState whether the card is currently frozen (blocked for payments).
* @property lastDigits The last four digits of the card number.
* @property state current lifecycle state of the card.
*/
@Serializable
data class TangemPayCard(
@ -22,7 +23,7 @@ data class TangemPayCard(
@SerialName("limit") val limit: TangemPayCardLimitData?,
@SerialName("frozen_state") val frozenState: TangemPayCardFrozenState,
@SerialName("last_digits") val lastDigits: String,
@SerialName("is_reissuing") val isReissuing: Boolean,
@SerialName("state") val state: TangemPayCardState,
)
val TangemPayCard.isFrozen

View file

@ -0,0 +1,38 @@
package com.tangem.domain.models.pay
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.util.Locale
/**
* Lifecycle state of a Tangem Pay card.
*/
@Serializable
enum class TangemPayCardState {
/** Card is operational and ready to use. */
@SerialName("Active")
Active,
/** A reissue order is in progress; the card is being replaced. */
@SerialName("Reissuing")
Reissuing,
/** A close order is in progress; the card is being closed. */
@SerialName("Closing")
Closing,
;
override fun toString() = when (this) {
Active -> "Active"
Reissuing -> "Reissuing"
Closing -> "Closing"
}
companion object {
fun fromString(value: String) = when (value.lowercase(Locale.US)) {
"reissuing" -> Reissuing
"closing" -> Closing
else -> Active
}
}
}