Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-05 12:27:44 +05:00
parent b750588ef9
commit f1797da7ed
6 changed files with 34 additions and 5 deletions

View file

@ -2,13 +2,25 @@ package com.tangem.core.deeplink.global
import com.tangem.core.deeplink.DeepLink
class BuyCurrencyDeepLink(val onReceive: (txId: String) -> Unit) : DeepLink {
class BuyCurrencyDeepLink(
isOnrampFeatureEnabled: Boolean,
val onReceive: (txId: String) -> Unit,
) : DeepLink {
override val uri: String = "tangem://redirect?action=dismissBrowser"
override val uri: String = if (isOnrampFeatureEnabled) {
ONRAMP_REDIRECT_DEEPLINK
} else {
BUY_REDIRECT_DEEPLINK
}
override fun onReceive(params: Map<String, String>) {
onReceive(
params["txId"] ?: return,
params["merchant_transaction_id"] ?: return,
)
}
companion object {
const val ONRAMP_REDIRECT_DEEPLINK = "tangem://onramp-success?"
private const val BUY_REDIRECT_DEEPLINK = "tangem://redirect?action=dismissBrowser"
}
}