Updated on 2026-08-14
This commit is contained in:
parent
97f3ed2dc4
commit
bedb9de62f
6 changed files with 38 additions and 55 deletions
|
|
@ -13,7 +13,6 @@ internal class VisaTxDetailsFactory {
|
|||
type = transaction.transactionType,
|
||||
status = transaction.transactionStatus,
|
||||
blockchainAmount = transaction.blockchainAmount,
|
||||
blockchainFee = transaction.blockchainFee,
|
||||
transactionAmount = transaction.transactionAmount,
|
||||
transactionCurrencyCode = transaction.transactionCurrencyCode,
|
||||
merchantName = transaction.merchantName,
|
||||
|
|
@ -33,7 +32,6 @@ internal class VisaTxDetailsFactory {
|
|||
billingAmount = request.billingAmount,
|
||||
billingCurrencyCode = request.billingCurrencyCode,
|
||||
blockchainAmount = request.blockchainAmount,
|
||||
blockchainFee = request.blockchainFee,
|
||||
errorCode = request.errorCode,
|
||||
requestDate = request.requestDt,
|
||||
requestStatus = request.requestStatus,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ data class VisaTxDetails(
|
|||
val type: String,
|
||||
val status: String,
|
||||
val blockchainAmount: BigDecimal,
|
||||
val blockchainFee: BigDecimal,
|
||||
val transactionAmount: BigDecimal,
|
||||
val transactionCurrencyCode: Int,
|
||||
val merchantName: String?,
|
||||
|
|
@ -25,7 +24,6 @@ data class VisaTxDetails(
|
|||
val billingAmount: BigDecimal,
|
||||
val billingCurrencyCode: Int,
|
||||
val blockchainAmount: BigDecimal,
|
||||
val blockchainFee: BigDecimal,
|
||||
val errorCode: Int,
|
||||
val requestDate: DateTime,
|
||||
val requestStatus: String,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ internal data class VisaTxDetailsBottomSheetConfig(
|
|||
val type: String,
|
||||
val status: String,
|
||||
val blockchainAmount: String,
|
||||
val blockchainFee: String,
|
||||
val transactionAmount: String,
|
||||
val transactionCurrencyCode: String,
|
||||
val merchantName: String,
|
||||
|
|
@ -27,7 +26,6 @@ internal data class VisaTxDetailsBottomSheetConfig(
|
|||
val type: String,
|
||||
val status: String,
|
||||
val blockchainAmount: String,
|
||||
val blockchainFee: String,
|
||||
val transactionAmount: String,
|
||||
val currencyCode: String,
|
||||
val errorCode: Int,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ internal class VisaTxDetailsBottomSheetConverter(
|
|||
type = details.type.capitalize(),
|
||||
status = details.status.capitalize(),
|
||||
blockchainAmount = formatNetworkAmount(details.blockchainAmount),
|
||||
blockchainFee = formatNetworkAmount(details.blockchainFee),
|
||||
transactionAmount = formatFiatAmount(details.transactionAmount, details.fiatCurrency),
|
||||
transactionCurrencyCode = details.transactionCurrencyCode.toString(),
|
||||
merchantName = details.merchantName?.capitalize() ?: UNKNOWN,
|
||||
|
|
@ -52,7 +51,6 @@ internal class VisaTxDetailsBottomSheetConverter(
|
|||
type = request.requestType.capitalize(),
|
||||
status = request.requestStatus.capitalize(),
|
||||
blockchainAmount = formatNetworkAmount(request.blockchainAmount),
|
||||
blockchainFee = formatNetworkAmount(request.blockchainFee),
|
||||
transactionAmount = formatFiatAmount(request.transactionAmount, request.fiatCurrency),
|
||||
currencyCode = request.billingCurrencyCode.toString(),
|
||||
errorCode = request.errorCode,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameter
|
|||
import com.tangem.core.ui.components.SpacerH16
|
||||
import com.tangem.core.ui.components.bottomsheets.sheet.TangemBottomSheet
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.feature.wallet.impl.R
|
||||
|
|
@ -38,7 +39,7 @@ private fun BalancesAndLimitsContent(config: BalancesAndLimitsBottomSheetConfig,
|
|||
modifier = modifier,
|
||||
title = {
|
||||
Text(
|
||||
text = "Balances & Limits",
|
||||
text = stringResourceSafe(R.string.visa_main_balances_and_limits),
|
||||
style = TangemTheme.typography.subtitle1,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
|
|
@ -56,26 +57,26 @@ private fun BalancesAndLimitsContent(config: BalancesAndLimitsBottomSheetConfig,
|
|||
private fun BalancesBlock(balances: BalancesAndLimitsBottomSheetConfig.Balance, modifier: Modifier = Modifier) {
|
||||
BlockContent(
|
||||
modifier = modifier,
|
||||
title = stringReference("Balance"),
|
||||
title = resourceReference(R.string.common_balance),
|
||||
content = {
|
||||
BlockItem(
|
||||
title = stringReference("Total"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_total),
|
||||
value = balances.totalBalance,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("AML Verified"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_aml_verified),
|
||||
value = balances.amlVerified,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("Available"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_available),
|
||||
value = balances.availableBalance,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("Blocked"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_blocked),
|
||||
value = balances.blockedBalance,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("Debit"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_debt),
|
||||
value = balances.debit,
|
||||
)
|
||||
},
|
||||
|
|
@ -89,24 +90,24 @@ private fun BalancesBlock(balances: BalancesAndLimitsBottomSheetConfig.Balance,
|
|||
private fun LimitsBlock(limits: BalancesAndLimitsBottomSheetConfig.Limit, modifier: Modifier = Modifier) {
|
||||
BlockContent(
|
||||
modifier = modifier,
|
||||
title = stringReference("Limits"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_limits),
|
||||
content = {
|
||||
BlockItem(
|
||||
title = stringReference("Total"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_total),
|
||||
value = limits.total,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("Other (no-otp)"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_no_otp_limit),
|
||||
value = limits.other,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference("Single transaction"),
|
||||
title = resourceReference(R.string.visa_balance_limits_details_single_transaction),
|
||||
value = limits.singleTransaction,
|
||||
)
|
||||
},
|
||||
description = {
|
||||
Text(
|
||||
text = "Available till ${limits.availableBy}",
|
||||
text = stringResourceSafe(R.string.visa_main_available_till_date, limits.availableBy),
|
||||
style = TangemTheme.typography.body2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameter
|
|||
import com.tangem.core.ui.components.SpacerW12
|
||||
import com.tangem.core.ui.components.bottomsheets.sheet.TangemBottomSheet
|
||||
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.feature.wallet.impl.R
|
||||
|
|
@ -42,7 +43,7 @@ private fun VisaTxDetailsBottomSheetContent(config: VisaTxDetailsBottomSheetConf
|
|||
blocksCount = config.requests.size.inc(),
|
||||
title = {
|
||||
Text(
|
||||
text = "Transaction Details",
|
||||
text = stringResourceSafe(R.string.visa_transaction_details_header),
|
||||
style = TangemTheme.typography.subtitle1,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
|
|
@ -61,46 +62,42 @@ private fun VisaTxDetailsBottomSheetContent(config: VisaTxDetailsBottomSheetConf
|
|||
private fun TransactionBlock(transaction: VisaTxDetailsBottomSheetConfig.Transaction, modifier: Modifier = Modifier) {
|
||||
BlockContent(
|
||||
modifier = modifier,
|
||||
title = stringReference(value = "Transaction"),
|
||||
title = resourceReference(R.string.visa_transaction_details_title),
|
||||
content = {
|
||||
BlockItem(
|
||||
title = stringReference(value = "Type"),
|
||||
title = resourceReference(R.string.visa_transaction_details_type),
|
||||
value = transaction.type,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Status"),
|
||||
title = resourceReference(R.string.visa_transaction_details_status),
|
||||
value = transaction.status,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Blockchain Amount"),
|
||||
title = resourceReference(R.string.visa_transaction_details_blockchain_amount),
|
||||
value = transaction.blockchainAmount,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Blockchain Fee"),
|
||||
value = transaction.blockchainFee,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Transaction Amount"),
|
||||
title = resourceReference(R.string.visa_transaction_details_transaction_amount),
|
||||
value = transaction.transactionAmount,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Currency Code"),
|
||||
title = resourceReference(R.string.visa_transaction_details_currency_code),
|
||||
value = transaction.transactionCurrencyCode,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Merchant Name"),
|
||||
title = resourceReference(R.string.visa_transaction_details_merchant_name),
|
||||
value = transaction.merchantName,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Merchant City"),
|
||||
title = resourceReference(R.string.visa_transaction_details_merchant_city),
|
||||
value = transaction.merchantCity,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Merchant Country Code"),
|
||||
title = resourceReference(R.string.visa_transaction_details_merchant_country_code),
|
||||
value = transaction.merchantCountryCode,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Merchant Category Code"),
|
||||
title = resourceReference(R.string.visa_transaction_details_merchant_category_code),
|
||||
value = transaction.merchantCategoryCode,
|
||||
)
|
||||
},
|
||||
|
|
@ -112,7 +109,7 @@ private fun TransactionBlock(transaction: VisaTxDetailsBottomSheetConfig.Transac
|
|||
private fun BlockchainRequestBlock(request: VisaTxDetailsBottomSheetConfig.Request, modifier: Modifier = Modifier) {
|
||||
BlockContent(
|
||||
modifier = modifier,
|
||||
title = stringReference(value = "Blockchain request"),
|
||||
title = resourceReference(R.string.visa_transaction_details_transaction_request),
|
||||
description = {
|
||||
if (request.onExploreClick != null) {
|
||||
Row(
|
||||
|
|
@ -127,7 +124,7 @@ private fun BlockchainRequestBlock(request: VisaTxDetailsBottomSheetConfig.Reque
|
|||
tint = TangemTheme.colors.icon.informative,
|
||||
)
|
||||
Text(
|
||||
text = "Explore",
|
||||
text = stringResourceSafe(R.string.common_explore),
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
style = TangemTheme.typography.caption1,
|
||||
)
|
||||
|
|
@ -137,43 +134,39 @@ private fun BlockchainRequestBlock(request: VisaTxDetailsBottomSheetConfig.Reque
|
|||
},
|
||||
content = {
|
||||
BlockItem(
|
||||
title = stringReference(value = "Type"),
|
||||
title = resourceReference(R.string.visa_transaction_details_type),
|
||||
value = request.type,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Status"),
|
||||
title = resourceReference(R.string.visa_transaction_details_status),
|
||||
value = request.status,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Blockchain Amount"),
|
||||
title = resourceReference(R.string.visa_transaction_details_blockchain_amount),
|
||||
value = request.blockchainAmount,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Blockchain Fee"),
|
||||
value = request.blockchainFee,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Transaction Amount"),
|
||||
title = resourceReference(R.string.visa_transaction_details_transaction_amount),
|
||||
value = request.transactionAmount,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Currency Code"),
|
||||
title = resourceReference(R.string.visa_transaction_details_currency_code),
|
||||
value = request.currencyCode,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Error Code"),
|
||||
title = resourceReference(R.string.visa_transaction_details_error_code),
|
||||
value = request.errorCode.toString(),
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Date"),
|
||||
title = resourceReference(R.string.visa_transaction_details_date),
|
||||
value = request.date,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Tx Hash"),
|
||||
title = resourceReference(R.string.visa_transaction_details_transaction_hash),
|
||||
value = request.txHash,
|
||||
)
|
||||
BlockItem(
|
||||
title = stringReference(value = "Tx Status"),
|
||||
title = resourceReference(R.string.visa_transaction_details_transaction_status),
|
||||
value = request.txStatus,
|
||||
)
|
||||
},
|
||||
|
|
@ -235,7 +228,6 @@ private class VisaTxDetailsBottomSheetParameterProvider :
|
|||
type = "payment",
|
||||
status = "authorized",
|
||||
blockchainAmount = "1.0614 USDT",
|
||||
blockchainFee = "0.12",
|
||||
transactionAmount = "0.99 €",
|
||||
transactionCurrencyCode = "978",
|
||||
merchantName = "SQ *FORMATIVE",
|
||||
|
|
@ -249,7 +241,6 @@ private class VisaTxDetailsBottomSheetParameterProvider :
|
|||
type = "authorize_payment",
|
||||
status = "accepted",
|
||||
blockchainAmount = "1.0593 USDT",
|
||||
blockchainFee = "0.10",
|
||||
transactionAmount = "0.99 €",
|
||||
currencyCode = "978",
|
||||
errorCode = 0,
|
||||
|
|
@ -263,7 +254,6 @@ private class VisaTxDetailsBottomSheetParameterProvider :
|
|||
type = "settlement",
|
||||
status = "accepted",
|
||||
blockchainAmount = "1.0614 USDT",
|
||||
blockchainFee = "0.12",
|
||||
transactionAmount = "0.99 €",
|
||||
currencyCode = "978",
|
||||
errorCode = 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue