Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-26 15:54:17 +05:00
parent 258e950178
commit e52bb2777f
3 changed files with 5 additions and 3 deletions

View file

@ -224,13 +224,13 @@ internal class DefaultOnboardingRepository @Inject constructor(
tangemPayStorage.storeHideOnboardingBanner(userWalletId, hide = true)
}
override suspend fun disableTangemPay(userWalletId: UserWalletId): Either<VisaApiError, Any> {
override suspend fun disableTangemPay(userWalletId: UserWalletId): Either<VisaApiError, Unit> {
return requestHelper.performRequest(userWalletId) { authHeader ->
tangemPayApi.setTangemPayEnabledStatus(
authHeader = authHeader,
body = SetTangemPayEnabledRequest(isTangemPayEnabled = false),
)
}.onRight {
}.map {
val address = requestHelper.getCustomerWalletAddress(userWalletId)
tangemPayStorage.clearAll(userWalletId = userWalletId, customerWalletAddress = address)
setHideMainOnboardingBanner(userWalletId)

View file

@ -34,5 +34,5 @@ interface OnboardingRepository {
suspend fun setHideMainOnboardingBanner(userWalletId: UserWalletId)
suspend fun disableTangemPay(userWalletId: UserWalletId): Either<VisaApiError, Any>
suspend fun disableTangemPay(userWalletId: UserWalletId): Either<VisaApiError, Unit>
}

View file

@ -8,6 +8,7 @@ import com.tangem.core.ui.components.bottomsheets.message.*
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.message.DialogMessage
import com.tangem.core.ui.message.EventMessageAction
import com.tangem.core.ui.message.ToastMessage
import com.tangem.core.ui.message.bottomSheetMessage
import com.tangem.domain.feedback.GetWalletMetaInfoUseCase
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
@ -213,6 +214,7 @@ internal class TangemPayClickIntentsImplementor @Inject constructor(
modelScope.launch {
tangemPayOnboardingRepository.disableTangemPay(userWalletId)
.onRight { tangemPayMainScreenCustomerInfoUseCase.fetch(userWalletId) }
.onLeft { uiMessageSender.send(ToastMessage(resourceReference(R.string.common_something_went_wrong))) }
}
}
}