Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-23 18:54:08 +05:00
parent cea4ba817a
commit 737bb507d9
19 changed files with 221 additions and 75 deletions

View file

@ -53,6 +53,12 @@ internal class DefaultTangemPayStorage @Inject constructor(
}
}
override suspend fun clearCustomerWalletAddress(userWalletId: UserWalletId) {
withContext(dispatcherProvider.io) {
appPreferencesStore.store(PreferencesKeys.getTangemPayCustomerWalletAddressKey(userWalletId), "")
}
}
override suspend fun storeAuthTokens(customerWalletAddress: String, tokens: TangemPayAuthTokens) =
withContext(dispatcherProvider.io) {
val json = tokensAdapter.toJson(tokens)
@ -70,6 +76,10 @@ internal class DefaultTangemPayStorage @Inject constructor(
?.let(tokensAdapter::fromJson)
}
override suspend fun clearAuthTokens(customerWalletAddress: String) {
secureStorage.delete(createAuthTokensKey(customerWalletAddress))
}
override suspend fun storeOrderId(customerWalletAddress: String, orderId: String) {
withContext(dispatcherProvider.io) {
appPreferencesStore.store(PreferencesKeys.getTangemPayOrderIdKey(customerWalletAddress), orderId)
@ -112,6 +122,7 @@ internal class DefaultTangemPayStorage @Inject constructor(
override suspend fun clearAll(userWalletId: UserWalletId, customerWalletAddress: String) =
withContext(dispatcherProvider.io) {
secureStorage.delete(createAuthTokensKey(customerWalletAddress))
appPreferencesStore.store(PreferencesKeys.getTangemPayCheckCustomerByWalletId(userWalletId), false)
appPreferencesStore.store(PreferencesKeys.getTangemPayCustomerWalletAddressKey(userWalletId), "")
appPreferencesStore.store(PreferencesKeys.getTangemPayOrderIdKey(customerWalletAddress), "")
appPreferencesStore.store(PreferencesKeys.getTangemPayAddToWalletKey(customerWalletAddress), false)