Updated on 2026-08-14
This commit is contained in:
parent
2070f1d21c
commit
8ca7bc0ca7
15 changed files with 132 additions and 53 deletions
|
|
@ -20,6 +20,7 @@ import com.tangem.domain.feedback.models.WalletMetaInfo
|
|||
import com.tangem.domain.feedback.repository.FeedbackFeatureToggles
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.pay.TangemPayEligibilityManager
|
||||
import com.tangem.domain.pay.model.TangemPayEntryPoint
|
||||
import com.tangem.domain.redux.LegacyAction
|
||||
import com.tangem.domain.redux.ReduxStateHolder
|
||||
import com.tangem.domain.tangempay.GetTangemPayCustomerIdUseCase
|
||||
|
|
@ -255,7 +256,10 @@ internal class DetailsModel @Inject constructor(
|
|||
private fun addTangemPayItemIfEligible() {
|
||||
modelScope.launch {
|
||||
val isEligible = tangemPayEligibilityManager
|
||||
.getEligibleWallets(shouldExcludePaeraCustomers = true)
|
||||
.getEligibleWallets(
|
||||
shouldExcludePaeraCustomers = true,
|
||||
entryPoint = TangemPayEntryPoint.DETAILS,
|
||||
)
|
||||
.isNotEmpty()
|
||||
if (isEligible) {
|
||||
items.update { itemsBuilder.addTangemPayItem(items = it, onClick = ::onTangemPayItemClicked) }
|
||||
|
|
@ -266,7 +270,7 @@ internal class DetailsModel @Inject constructor(
|
|||
private fun onTangemPayItemClicked() {
|
||||
modelScope.launch {
|
||||
analyticsEventHandler.send(TangemPayAnalyticsEvents.DetailsVisaPermanentButtonClicked())
|
||||
val isEligible = tangemPayEligibilityManager.getTangemPayAvailability()
|
||||
val isEligible = tangemPayEligibilityManager.getTangemPayAvailability(TangemPayEntryPoint.DETAILS)
|
||||
if (isEligible) {
|
||||
router.push(AppRoute.TangemPayOnboarding(AppRoute.TangemPayOnboarding.Mode.FromBannerInSettings))
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.tangem.core.navigation.url.UrlOpener
|
|||
import com.tangem.domain.models.kyc.KycStatus
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.pay.TangemPayEligibilityManager
|
||||
import com.tangem.domain.pay.model.TangemPayEntryPoint
|
||||
import com.tangem.domain.pay.repository.OnboardingRepository
|
||||
import com.tangem.domain.pay.usecase.ProduceTangemPayInitialDataUseCase
|
||||
import com.tangem.domain.tangempay.TangemPayAnalyticsEvents
|
||||
|
|
@ -127,7 +128,10 @@ internal class TangemPayOnboardingModel @Inject constructor(
|
|||
val shouldExcludePaeraCustomers = params is TangemPayOnboardingComponent.Params.FromBannerInSettings
|
||||
modelScope.launch {
|
||||
val eligibleWalletsIds = eligibilityManager
|
||||
.getEligibleWallets(shouldExcludePaeraCustomers = shouldExcludePaeraCustomers)
|
||||
.getEligibleWallets(
|
||||
shouldExcludePaeraCustomers = shouldExcludePaeraCustomers,
|
||||
entryPoint = params.toEntryPointOrNull(),
|
||||
)
|
||||
.map { it.walletId }
|
||||
if (eligibleWalletsIds.isEmpty()) {
|
||||
back()
|
||||
|
|
@ -204,4 +208,13 @@ internal class TangemPayOnboardingModel @Inject constructor(
|
|||
override fun onWalletSelectorDismiss() {
|
||||
bottomSheetNavigation.dismiss()
|
||||
}
|
||||
|
||||
private fun TangemPayOnboardingComponent.Params.toEntryPointOrNull() = when (this) {
|
||||
is TangemPayOnboardingComponent.Params.FromBannerInSettings -> TangemPayEntryPoint.DETAILS
|
||||
is TangemPayOnboardingComponent.Params.FromBannerOnMain -> TangemPayEntryPoint.BANNER
|
||||
|
||||
is TangemPayOnboardingComponent.Params.Deeplink,
|
||||
is TangemPayOnboardingComponent.Params.ContinueOnboarding,
|
||||
-> null
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ import com.tangem.domain.models.wallet.UserWallet
|
|||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.pay.TangemPayDetailsConfig
|
||||
import com.tangem.domain.pay.TangemPayEligibilityManager
|
||||
import com.tangem.domain.pay.model.TangemPayEntryPoint
|
||||
import com.tangem.domain.pay.repository.OnboardingRepository
|
||||
import com.tangem.domain.pay.usecase.ProduceTangemPayInitialDataUseCase
|
||||
import com.tangem.domain.pay.usecase.TangemPayMainScreenCustomerInfoUseCase
|
||||
|
|
@ -246,7 +247,7 @@ internal class TangemPayClickIntentsImplementor @Inject constructor(
|
|||
override fun onOnboardingBannerClick(userWalletId: UserWalletId) {
|
||||
modelScope.launch {
|
||||
analyticsEventHandler.send(TangemPayAnalyticsEvents.MainVisaPermanentBannerClicked())
|
||||
val isEligible = tangemPayEligibilityManager.getTangemPayAvailability()
|
||||
val isEligible = tangemPayEligibilityManager.getTangemPayAvailability(TangemPayEntryPoint.BANNER)
|
||||
if (isEligible) {
|
||||
router.openTangemPayOnboarding(mode = AppRoute.TangemPayOnboarding.Mode.FromBannerOnMain)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue