Updated on 2026-08-14
This commit is contained in:
parent
b750588ef9
commit
f1797da7ed
6 changed files with 34 additions and 5 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue