Updated on 2026-08-14
This commit is contained in:
parent
f87629742b
commit
991368242b
7 changed files with 3 additions and 27 deletions
|
|
@ -47,10 +47,6 @@
|
|||
"name": "TANGEM_PAY_ENABLED",
|
||||
"version": "5.31.0"
|
||||
},
|
||||
{
|
||||
"name": "TANGEM_PAY_ENTRYPOINT_ENABLED",
|
||||
"version": "undefined"
|
||||
},
|
||||
{
|
||||
"name": "NEW_TOKEN_RECEIVE_ENABLED",
|
||||
"version": "5.28.0"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.tangem.domain.pay.TangemPayEligibilityManager
|
|||
import com.tangem.domain.pay.repository.OnboardingRepository
|
||||
import com.tangem.domain.wallets.legacy.UserWalletsListManager
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.tangempay.TangemPayFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.*
|
||||
|
|
@ -23,7 +22,6 @@ internal class DefaultTangemPayEligibilityManager @Inject constructor(
|
|||
private val userWalletsListManager: UserWalletsListManager,
|
||||
private val userWalletsListRepository: UserWalletsListRepository,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val tangemPayFeatureToggles: TangemPayFeatureToggles,
|
||||
private val onboardingRepository: OnboardingRepository,
|
||||
) : TangemPayEligibilityManager {
|
||||
|
||||
|
|
@ -128,8 +126,6 @@ internal class DefaultTangemPayEligibilityManager @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun checkTangemPayEligibility(): Boolean {
|
||||
if (!tangemPayFeatureToggles.isEntryPointsEnabled) return true
|
||||
|
||||
return onboardingRepository.getCustomerEligibility() || onboardingRepository.checkCustomerEligibility()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import com.tangem.domain.pay.usecase.TangemPayMainScreenCustomerInfoUseCase
|
|||
import com.tangem.domain.tangempay.GetTangemPayCurrencyStatusUseCase
|
||||
import com.tangem.domain.tangempay.TangemPayWithdrawUseCase
|
||||
import com.tangem.domain.tangempay.repository.TangemPayTxHistoryRepository
|
||||
import com.tangem.features.tangempay.TangemPayFeatureToggles
|
||||
import com.tangem.security.DeviceSecurityInfoProvider
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
|
|
@ -78,14 +77,12 @@ internal interface TangemPayDataModule {
|
|||
customerOrderRepository: CustomerOrderRepository,
|
||||
tangemPayOnboardingRepository: OnboardingRepository,
|
||||
eligibilityManager: TangemPayEligibilityManager,
|
||||
tangemPayFeatureToggles: TangemPayFeatureToggles,
|
||||
deviceSecurity: DeviceSecurityInfoProvider,
|
||||
): TangemPayMainScreenCustomerInfoUseCase {
|
||||
return TangemPayMainScreenCustomerInfoUseCase(
|
||||
onboardingRepository = repository,
|
||||
customerOrderRepository = customerOrderRepository,
|
||||
eligibilityManager = eligibilityManager,
|
||||
tangemPayFeatureToggles = tangemPayFeatureToggles,
|
||||
deviceSecurity = deviceSecurity,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.tangem.domain.pay.model.*
|
|||
import com.tangem.domain.pay.repository.CustomerOrderRepository
|
||||
import com.tangem.domain.pay.repository.OnboardingRepository
|
||||
import com.tangem.domain.visa.error.VisaApiError
|
||||
import com.tangem.features.tangempay.TangemPayFeatureToggles
|
||||
import com.tangem.security.DeviceSecurityInfoProvider
|
||||
import com.tangem.security.isSecurityExposed
|
||||
import kotlinx.coroutines.flow.*
|
||||
|
|
@ -21,7 +20,6 @@ class TangemPayMainScreenCustomerInfoUseCase(
|
|||
private val onboardingRepository: OnboardingRepository,
|
||||
private val customerOrderRepository: CustomerOrderRepository,
|
||||
private val eligibilityManager: TangemPayEligibilityManager,
|
||||
private val tangemPayFeatureToggles: TangemPayFeatureToggles,
|
||||
private val deviceSecurity: DeviceSecurityInfoProvider,
|
||||
) {
|
||||
|
||||
|
|
@ -44,7 +42,7 @@ class TangemPayMainScreenCustomerInfoUseCase(
|
|||
.fold(
|
||||
ifLeft = { error ->
|
||||
Timber.tag(TAG).e("Failed checkCustomerWallet for $userWalletId: ${error.javaClass.simpleName}")
|
||||
if (error is VisaApiError.NotPaeraCustomer && tangemPayFeatureToggles.isEntryPointsEnabled) {
|
||||
if (error is VisaApiError.NotPaeraCustomer) {
|
||||
showOnboardingBannerIfEligible(userWalletId)
|
||||
} else {
|
||||
updateState(userWalletId, TangemPayCustomerInfoError.UnknownError.left())
|
||||
|
|
@ -62,13 +60,8 @@ class TangemPayMainScreenCustomerInfoUseCase(
|
|||
.map(MainCustomerInfoContentState::Content)
|
||||
updateState(userWalletId, result)
|
||||
} else {
|
||||
if (tangemPayFeatureToggles.isEntryPointsEnabled) {
|
||||
// if there's no tangem pay, check eligibility and show onboarding banner
|
||||
showOnboardingBannerIfEligible(userWalletId)
|
||||
} else {
|
||||
// ignore if there's no TangemPay
|
||||
updateState(userWalletId, TangemPayCustomerInfoError.UnknownError.left())
|
||||
}
|
||||
// if there's no tangem pay, check eligibility and show onboarding banner
|
||||
showOnboardingBannerIfEligible(userWalletId)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import com.tangem.features.details.entity.SelectEmailFeedbackTypeBS
|
|||
import com.tangem.features.details.utils.ItemsBuilder
|
||||
import com.tangem.features.details.utils.SocialsBuilder
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.tangempay.TangemPayFeatureToggles
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.version.AppVersionProvider
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
|
@ -71,7 +70,6 @@ internal class DetailsModel @Inject constructor(
|
|||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val tangemPayEligibilityManager: TangemPayEligibilityManager,
|
||||
private val tangemPayFeatureToggles: TangemPayFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
private val params: DetailsComponent.Params = paramsContainer.require()
|
||||
|
|
@ -249,7 +247,6 @@ internal class DetailsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun addTangemPayItemIfEligible() {
|
||||
if (!tangemPayFeatureToggles.isEntryPointsEnabled) return
|
||||
modelScope.launch {
|
||||
val isEligible = tangemPayEligibilityManager
|
||||
.getEligibleWallets(shouldExcludePaeraCustomers = true)
|
||||
|
|
|
|||
|
|
@ -2,5 +2,4 @@ package com.tangem.features.tangempay
|
|||
|
||||
interface TangemPayFeatureToggles {
|
||||
val isTangemPayEnabled: Boolean
|
||||
val isEntryPointsEnabled: Boolean
|
||||
}
|
||||
|
|
@ -7,6 +7,4 @@ internal class DefaultTangemPayFeatureToggles(
|
|||
) : TangemPayFeatureToggles {
|
||||
override val isTangemPayEnabled
|
||||
get() = featureTogglesManager.isFeatureEnabled("TANGEM_PAY_ENABLED")
|
||||
override val isEntryPointsEnabled: Boolean
|
||||
get() = featureTogglesManager.isFeatureEnabled("TANGEM_PAY_ENTRYPOINT_ENABLED")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue