Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-06 18:15:44 +04:00
parent 4407663b8b
commit 9cd92c0def
2 changed files with 3 additions and 2 deletions

View file

@ -48,7 +48,7 @@ data class TangemPayTxHistoryResponse(
@Json(name = "status") val status: String,
@Json(name = "declined_reason") val declinedReason: String? = null,
@Json(name = "authorized_at") val authorizedAt: DateTime,
@Json(name = "posted_at") val postedAt: DateTime,
@Json(name = "posted_at") val postedAt: DateTime?,
)
@JsonClass(generateAdapter = true)

View file

@ -22,7 +22,8 @@ internal object TangemPayTxHistoryItemConverter :
private fun convertSpend(id: String, spend: TangemPayTxHistoryResponse.Spend): TangemPayTxHistoryItem.Spend {
return TangemPayTxHistoryItem.Spend(
id = id,
date = spend.postedAt,
// If postedAt is null, it means transaction wasn't posted and was likely declined. Use authorizedAt
date = spend.postedAt ?: spend.authorizedAt,
amount = spend.amount,
currency = Currency.getInstance(spend.currency),
enrichedMerchantName = spend.enrichedMerchantName,