Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-03 15:43:15 +05:00
parent caf5b6fae7
commit f2dfe2f8bc
21 changed files with 326 additions and 6 deletions

View file

@ -2,6 +2,7 @@ package com.tangem.data.onramp.converters
import com.tangem.datasource.api.onramp.models.response.model.PaymentMethodDTO
import com.tangem.domain.onramp.model.OnrampPaymentMethod
import com.tangem.domain.onramp.model.PaymentMethodType
import com.tangem.utils.converter.TwoWayConverter
internal class PaymentMethodConverter : TwoWayConverter<PaymentMethodDTO, OnrampPaymentMethod> {
@ -9,6 +10,7 @@ internal class PaymentMethodConverter : TwoWayConverter<PaymentMethodDTO, Onramp
id = value.id,
name = value.name,
imageUrl = value.image,
type = PaymentMethodType.getType(value.id),
)
override fun convertBack(value: OnrampPaymentMethod): PaymentMethodDTO = PaymentMethodDTO(

View file

@ -17,6 +17,7 @@ import kotlinx.coroutines.withContext
import timber.log.Timber
import java.util.Locale
@Suppress("TooManyFunctions")
internal class DefaultSettingsRepository(
private val appPreferencesStore: AppPreferencesStore,
private val appLogsStore: AppLogsStore,
@ -147,4 +148,26 @@ internal class DefaultSettingsRepository(
userCountryFlow.value = code
}
}
override suspend fun setGoogleServicesAvailability(value: Boolean) {
appPreferencesStore.store(key = PreferencesKeys.IS_GOOGLE_SERVICES_AVAILABLE_KEY, value = value)
}
override suspend fun isGoogleServicesAvailability(): Boolean {
return appPreferencesStore.getSyncOrDefault(
key = PreferencesKeys.IS_GOOGLE_SERVICES_AVAILABLE_KEY,
default = false,
)
}
override suspend fun setGooglePayAvailability(value: Boolean) {
appPreferencesStore.store(key = PreferencesKeys.IS_GOOGLE_PAY_AVAILABLE_KEY, value = value)
}
override suspend fun isGooglePayAvailability(): Boolean {
return appPreferencesStore.getSyncOrDefault(
key = PreferencesKeys.IS_GOOGLE_PAY_AVAILABLE_KEY,
default = false,
)
}
}