Updated on 2026-08-14
This commit is contained in:
parent
84af4950a1
commit
ff2559df3e
27 changed files with 904 additions and 20 deletions
|
|
@ -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]
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue