Skip to content

Commit

Permalink
fix(dashspend): fix getting discount info and displaying addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jun 26, 2024
1 parent 22eddf6 commit 696a985
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import com.google.gson.annotations.SerializedName
data class GetMerchantResponse(
val id: String,
val denominations: List<String>,
val denominationType: String,
val denominationsType: String,
val savingsPercentage: Int = 0,
val redeemType: String = ""
) {
Expand All @@ -38,7 +38,7 @@ data class GetMerchantResponse(
}
val maximumCardPurchase: Double
get() {
return when (denominationType) {
return when (denominationsType) {
"min-max" -> {
require(denominations.size == 2)
denominations[1].toDouble()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package org.dash.wallet.features.exploredash.data.explore.model
import androidx.room.ColumnInfo
import androidx.room.Ignore
import androidx.room.PrimaryKey
import org.dash.wallet.common.data.ServiceName
import org.dash.wallet.features.exploredash.ui.extensions.Const

open class SearchResult(
Expand Down Expand Up @@ -60,6 +61,15 @@ open class SearchResult(
addressBuilder.append("${separator}$address4")
}

// CTX records do not use address2, address3, address4
if (source?.lowercase() == ServiceName.CTXSpend.lowercase()) {
addressBuilder.append("${separator}$city")
territory?.let {
addressBuilder.append(", ")
addressBuilder.append(territory)
}
}

return addressBuilder.toString()
}

Expand Down

0 comments on commit 696a985

Please sign in to comment.