Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-24 12:01:22 +05:00
parent bbc732b01f
commit 1037d2ff10
9 changed files with 79 additions and 22 deletions

View file

@ -45,6 +45,10 @@ internal class DefaultTangemPayEligibilityManager @Inject constructor(
}
}
override suspend fun getTangemPayAvailability(): Boolean {
return onboardingRepository.checkCustomerEligibility()
}
private suspend fun getUserWalletsData(): List<UserWalletData> {
cachedEligibleWallets?.let { return it }
@ -69,7 +73,7 @@ internal class DefaultTangemPayEligibilityManager @Inject constructor(
}
private suspend fun getPossibleWalletsForTangemPay(): List<UserWallet> {
if (!onboardingRepository.checkCustomerEligibility()) {
if (!checkTangemPayEligibility()) {
return emptyList()
}
@ -125,6 +129,10 @@ internal class DefaultTangemPayEligibilityManager @Inject constructor(
eligibleWalletsDeferred = null
}
private suspend fun checkTangemPayEligibility(): Boolean {
return onboardingRepository.getCustomerEligibility() || onboardingRepository.checkCustomerEligibility()
}
private data class UserWalletData(
val userWallet: UserWallet,
val isPaeraCustomer: Boolean,

View file

@ -197,7 +197,15 @@ internal class DefaultOnboardingRepository @Inject constructor(
val response = requestHelper.performWithoutToken {
tangemPayApi.checkCustomerEligibility()
}.getOrNull()
return response?.result?.isTangemPayAvailable == true
val isAvailable = response?.result?.isTangemPayAvailable == true
tangemPayStorage.storeTangemPayEligibility(eligibility = isAvailable)
return isAvailable
}
override suspend fun getCustomerEligibility(): Boolean {
return tangemPayStorage.getTangemPayEligibility()
}
override suspend fun getHideMainOnboardingBanner(userWalletId: UserWalletId): Boolean {