Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-25 22:45:58 +04:00
parent 84af4950a1
commit ff2559df3e
27 changed files with 904 additions and 20 deletions

View file

@ -0,0 +1,17 @@
package com.tangem.domain.visa.model
enum class TangemPayPushNotificationType(val value: String) {
CARD_READY("card_ready"),
TRANSACTION_SPEND("transaction_spend"),
TOP_UP("declined_top_up"),
COLLATERAL("collateral"),
;
companion object {
private val map = entries.associateBy { it.value }
val all: Set<String> = entries.map { it.value }.toSet()
fun fromValue(value: String): TangemPayPushNotificationType? = map[value]
}
}

View file

@ -0,0 +1,17 @@
package com.tangem.domain.pay.utils
import com.tangem.domain.visa.model.TangemPayTxHistoryItem
import com.tangem.utils.converter.Converter
object TangemPayTxHistoryItemStatusConverter : Converter<String, TangemPayTxHistoryItem.Status> {
override fun convert(value: String): TangemPayTxHistoryItem.Status {
return when (value.uppercase()) {
"PENDING" -> TangemPayTxHistoryItem.Status.PENDING
"RESERVED" -> TangemPayTxHistoryItem.Status.RESERVED
"COMPLETED" -> TangemPayTxHistoryItem.Status.COMPLETED
"DECLINED" -> TangemPayTxHistoryItem.Status.DECLINED
"REVERSED" -> TangemPayTxHistoryItem.Status.REVERSED
else -> TangemPayTxHistoryItem.Status.UNKNOWN
}
}
}