Updated on 2026-08-14
This commit is contained in:
parent
cea4ba817a
commit
737bb507d9
19 changed files with 221 additions and 75 deletions
|
|
@ -29,6 +29,12 @@ interface TangemPayApi {
|
|||
@Path("customer_wallet_id") customerWalletId: String,
|
||||
): ApiResponse<CheckCustomerWalletResponse>
|
||||
|
||||
@PATCH("v1/customer/pay-enabled")
|
||||
suspend fun setTangemPayEnabledStatus(
|
||||
@Header("Authorization") authHeader: String,
|
||||
@Body body: SetTangemPayEnabledRequest,
|
||||
): ApiResponse<Any>
|
||||
|
||||
@POST("v1/deeplink/validate")
|
||||
suspend fun validateDeeplink(@Body body: DeeplinkValidityRequest): ApiResponse<DeeplinkValidityResponse>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.tangem.datasource.api.pay.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SetTangemPayEnabledRequest(
|
||||
@Json(name = "is_tangem_pay_enabled") val isTangemPayEnabled: Boolean,
|
||||
)
|
||||
|
|
@ -9,5 +9,6 @@ data class CheckCustomerWalletResponse(
|
|||
) {
|
||||
data class Result(
|
||||
@Json(name = "id") val id: String?,
|
||||
@Json(name = "is_tangem_pay_enabled") val isTangemPayEnabled: Boolean?,
|
||||
)
|
||||
}
|
||||
|
|
@ -8,9 +8,12 @@ interface TangemPayStorage {
|
|||
suspend fun storeCustomerWalletAddress(userWalletId: UserWalletId, customerWalletAddress: String)
|
||||
suspend fun getCustomerWalletAddress(userWalletId: UserWalletId): String?
|
||||
|
||||
suspend fun clearCustomerWalletAddress(userWalletId: UserWalletId)
|
||||
|
||||
suspend fun storeAuthTokens(customerWalletAddress: String, tokens: TangemPayAuthTokens)
|
||||
|
||||
suspend fun getAuthTokens(customerWalletAddress: String): TangemPayAuthTokens?
|
||||
suspend fun clearAuthTokens(customerWalletAddress: String)
|
||||
|
||||
suspend fun storeOrderId(customerWalletAddress: String, orderId: String)
|
||||
|
||||
|
|
|
|||
|
|
@ -1072,6 +1072,8 @@
|
|||
<string name="reset_cards_dialog_next_device_description">Bitte setze das nächste Gerät zurück, um fortzufahren.</string>
|
||||
<string name="ring_promo_text">Ringbesitzer erhalten bis zum 15.11. 3 provisionsfreie Swaps auf Changelly!</string>
|
||||
<string name="ring_promo_title">Jetzt mit 0 % Gebühren tauschen!</string>
|
||||
<string name="root_detected_warning_description">Geräte mit Root-Zugriff gelten als weniger sicher. Deine Daten können zusätzlichen Risiken ausgesetzt sein.</string>
|
||||
<string name="root_detected_warning_title">Root-Zugriff erkannt</string>
|
||||
<string name="save_user_wallet_agreement_access_description">Melde dich bei der App an und überprüfe dein Guthaben, ohne die Karte oder Ring zu scannen</string>
|
||||
<string name="save_user_wallet_agreement_access_title">Zugriff auf die App</string>
|
||||
<string name="save_user_wallet_agreement_allow_biometrics">Nutzung biometrischer Daten zulassen</string>
|
||||
|
|
@ -1990,6 +1992,7 @@
|
|||
<string name="yield_module_fee_policy_sheet_title">Gebührenpolitik</string>
|
||||
<string name="yield_module_fee_policy_tangem_service_fee_title">Tangem erhebt außerdem eine Servicegebühr von 15% auf den erzielten Ertrag.</string>
|
||||
<string name="yield_module_high_fee_error">Deine Gelder werden automatisch an Aave überwiesen, sobald die Netzwerkgebühren niedriger sind oder Dein Guthaben den erforderlichen Mindestbetrag erreicht.</string>
|
||||
<string name="yield_module_high_network_fees_notification_description">Die Gebühren sind aufgrund der hohen Marktaktivität derzeit höher als üblich. Du kannst jetzt fortfahren oder später noch einmal vorbeischauen, wenn die Gebühren niedriger sind.</string>
|
||||
<string name="yield_module_high_network_fees_notification_title">Hohe Netzwerkgebühren</string>
|
||||
<string name="yield_module_historical_returns">Historische Renditen</string>
|
||||
<string name="yield_module_main_screen_promo_banner_message">Aktiviere %1$s%% Jahreszins auf Dein Guthaben</string>
|
||||
|
|
|
|||
|
|
@ -916,6 +916,8 @@
|
|||
<string name="reset_card_without_backup_to_factory_message">El reseteo a valores de fábrica eliminará completamente la billetera de la tarjeta/anillo seleccionado y lo eliminará de la app. No podrá restaurar la billetera actual.</string>
|
||||
<string name="ring_promo_text">Si tiene un Anillo Tangem, ¡3 swaps sin comisión en Changelly hasta el 15/11!</string>
|
||||
<string name="ring_promo_title">¡Intercambia con 0% de comisión!</string>
|
||||
<string name="root_detected_warning_description">Los dispositivos con jailbreak se consideran menos seguros. Sus datos podrían estar expuestos a riesgos adicionales.</string>
|
||||
<string name="root_detected_warning_title">Acceso root detectado</string>
|
||||
<string name="save_user_wallet_agreement_access_description">Inicie sesión en la app y comprueba su saldo sin escanear la tarjeta o el anillo</string>
|
||||
<string name="save_user_wallet_agreement_access_title">Acceder a la app</string>
|
||||
<string name="save_user_wallet_agreement_allow_biometrics">Permitir el uso de biometría</string>
|
||||
|
|
|
|||
|
|
@ -1617,7 +1617,7 @@
|
|||
<string name="visa_unlock_notification_button">ロック解除</string>
|
||||
<string name="visa_unlock_notification_subtitle">カードをスキャンしてアクセスロックを解除する</string>
|
||||
<string name="visa_unlock_notification_title">ロック解除が必要</string>
|
||||
<string name="wallet_add_common_title">ウォレットの追加方法を選択してください</string>
|
||||
<string name="wallet_add_common_title">ウォレットの種類を選択します</string>
|
||||
<string name="wallet_add_hardware_description">Tangemカードまたはリングをスキャンして復元するか、別のウォレットからインポートしてください。</string>
|
||||
<string name="wallet_add_hardware_info_create">ハードウェアウォレットを作成</string>
|
||||
<string name="wallet_add_hardware_purchase">Tangemウォレットを購入しますか?</string>
|
||||
|
|
|
|||
|
|
@ -1634,7 +1634,7 @@
|
|||
<string name="visa_onboarding_pin_not_accepted">ПИН не принят. Попробуйте ещё раз или введите другой код.</string>
|
||||
<string name="visa_onboarding_pin_validation_error_message">Слабый ПИН: не используйте повторы или последовательности.</string>
|
||||
<string name="visa_unlock_notification_button">Разблокировать</string>
|
||||
<string name="wallet_add_common_title">Выберите способ добавления кошелька</string>
|
||||
<string name="wallet_add_common_title">Выберите тип кошелька</string>
|
||||
<string name="wallet_add_hardware_description">Отсканируйте вашу карту или кольцо Tangem, чтобы восстановить её или импортировать из другого кошелька.</string>
|
||||
<string name="wallet_add_hardware_info_create">Создать аппаратный кошелёк</string>
|
||||
<string name="wallet_add_hardware_purchase">Хотите приобрести кошелек Tangem?</string>
|
||||
|
|
|
|||
|
|
@ -1501,6 +1501,8 @@
|
|||
<string name="tangempay_issuing_your_card">Issuing your card</string>
|
||||
<string name="tangempay_issuing_your_card_description">We’re getting your card ready. This may take a little time.</string>
|
||||
<string name="tangempay_kyc_card_ready_notification_title">Tangem Pay</string>
|
||||
<string name="tangempay_kyc_confirm_cancellation_alert_title">Confirm Cancellation</string>
|
||||
<string name="tangempay_kyc_confirm_cancellation_description">Are you sure you want to stop the KYC process? You can return to it anytime.</string>
|
||||
<string name="tangempay_kyc_failed_description">We could not verify your profile. If you have any questions, please contact support.</string>
|
||||
<string name="tangempay_kyc_failed_title">Unfortunately, we couldn\'t verify your identity </string>
|
||||
<string name="tangempay_kyc_in_progress">KYC in progress</string>
|
||||
|
|
@ -1686,7 +1688,7 @@
|
|||
<string name="visa_unlock_notification_button">Unlock</string>
|
||||
<string name="visa_unlock_notification_subtitle">Scan your card to unlock access</string>
|
||||
<string name="visa_unlock_notification_title">Needed unlock</string>
|
||||
<string name="wallet_add_common_title">Choose how to add your wallet</string>
|
||||
<string name="wallet_add_common_title">Choose your wallet type</string>
|
||||
<string name="wallet_add_hardware_description">Scan your Tangem card or ring to restore it or import from another wallet.</string>
|
||||
<string name="wallet_add_hardware_info_create">Create Hardware Wallet</string>
|
||||
<string name="wallet_add_hardware_purchase">Want to purchase a Tangem Wallet?</string>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ data class MessageBottomSheetUMV2(
|
|||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class IconImage(@DrawableRes internal var res: Int) : Element
|
||||
|
||||
@Immutable
|
||||
data class Chip(
|
||||
internal var text: TextReference,
|
||||
|
|
@ -54,6 +57,7 @@ data class MessageBottomSheetUMV2(
|
|||
@Immutable
|
||||
data class InfoBlock(
|
||||
internal var icon: Icon? = null,
|
||||
internal var iconImage: IconImage? = null,
|
||||
internal var chip: Chip? = null,
|
||||
var title: TextReference? = null,
|
||||
var body: TextReference? = null,
|
||||
|
|
@ -106,6 +110,10 @@ fun MessageBottomSheetUMV2.InfoBlock.icon(@DrawableRes res: Int, init: MessageBo
|
|||
icon = MessageBottomSheetUMV2.Icon(res).apply(init)
|
||||
}
|
||||
|
||||
fun MessageBottomSheetUMV2.InfoBlock.iconImage(@DrawableRes res: Int) = apply {
|
||||
iconImage = MessageBottomSheetUMV2.IconImage(res)
|
||||
}
|
||||
|
||||
fun MessageBottomSheetUMV2.InfoBlock.chip(text: TextReference, init: MessageBottomSheetUMV2.Chip.() -> Unit = {}) =
|
||||
apply {
|
||||
chip = MessageBottomSheetUMV2.Chip(text).apply(init)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
package com.tangem.core.ui.components.bottomsheets.message
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -88,9 +92,7 @@ fun MessageBottomSheetV2Content(state: MessageBottomSheetUMV2, modifier: Modifie
|
|||
@Composable
|
||||
private fun ContentContainer(state: MessageBottomSheetUMV2.InfoBlock, modifier: Modifier = Modifier) {
|
||||
Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
state.icon?.let {
|
||||
BottomSheetIcon(it)
|
||||
}
|
||||
BottomSheetIconContainer(state.icon, state.iconImage)
|
||||
state.title?.let { title ->
|
||||
Text(
|
||||
modifier = Modifier
|
||||
|
|
@ -122,6 +124,26 @@ private fun ContentContainer(state: MessageBottomSheetUMV2.InfoBlock, modifier:
|
|||
}
|
||||
}
|
||||
|
||||
@Suppress("CanBeNonNullable")
|
||||
@Composable
|
||||
private fun BottomSheetIconContainer(
|
||||
icon: MessageBottomSheetUMV2.Icon?,
|
||||
iconImage: MessageBottomSheetUMV2.IconImage?,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
if (icon != null) {
|
||||
BottomSheetIcon(icon, modifier)
|
||||
} else if (iconImage != null) {
|
||||
Image(
|
||||
modifier = modifier
|
||||
.size(TangemTheme.dimens.size56)
|
||||
.clip(CircleShape),
|
||||
painter = painterResource(id = iconImage.res),
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun BottomSheetIcon(icon: MessageBottomSheetUMV2.Icon, modifier: Modifier = Modifier) {
|
||||
val tint = when (icon.type) {
|
||||
|
|
@ -236,4 +258,33 @@ private fun Preview() {
|
|||
onDismissRequest = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun Preview2() {
|
||||
TangemThemePreview {
|
||||
MessageBottomSheetV2(
|
||||
messageBottomSheetUM {
|
||||
infoBlock {
|
||||
iconImage = MessageBottomSheetUMV2.IconImage(R.drawable.img_visa_notification)
|
||||
title = TextReference.Str("Title Title Title")
|
||||
body = TextReference.Str("Body")
|
||||
chip(text = TextReference.Str("Some chip information"))
|
||||
}
|
||||
primaryButton {
|
||||
text = TextReference.Str("Test")
|
||||
icon = R.drawable.ic_tangem_24
|
||||
}
|
||||
secondaryButton {
|
||||
icon = R.drawable.ic_tangem_24
|
||||
text = TextReference.Str("asdasd")
|
||||
onClick {
|
||||
closeBs()
|
||||
}
|
||||
}
|
||||
},
|
||||
onDismissRequest = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue