summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2021-12-08 15:46:15 -0300
committerTorsten Grote <t@grobox.de>2021-12-08 15:46:15 -0300
commit5c525667c77d945abb85e5f0b2469fb5af376fce (patch)
tree4c73e785f64664e1b045be2ce6736dbb299cbc8d /wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
parent71be094780464c2b97a4cb6b33dd7f465647c082 (diff)
downloadtaler-android-5c525667c77d945abb85e5f0b2469fb5af376fce.tar.gz
taler-android-5c525667c77d945abb85e5f0b2469fb5af376fce.tar.bz2
taler-android-5c525667c77d945abb85e5f0b2469fb5af376fce.zip
Add a button to cancel manual withdrawal
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
index 6b5a79b..ea257a8 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
@@ -16,12 +16,14 @@
package net.taler.wallet.transactions
+import android.util.Log
import androidx.annotation.UiThread
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.switchMap
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
+import net.taler.wallet.TAG
import net.taler.wallet.backend.WalletBackendApi
import java.util.HashMap
import java.util.LinkedList
@@ -33,7 +35,7 @@ sealed class TransactionsResult {
class TransactionManager(
private val api: WalletBackendApi,
- private val scope: CoroutineScope
+ private val scope: CoroutineScope,
) {
private val mProgress = MutableLiveData<Boolean>()
@@ -88,4 +90,14 @@ class TransactionManager(
}
}
+ fun deleteTransaction(transactionId: String) = scope.launch {
+ api.request<Unit>("deleteTransaction") {
+ put("transactionId", transactionId)
+ }.onError {
+ Log.e(TAG, "Error deleteTransaction $it")
+ }.onSuccess {
+ // no op
+ }
+ }
+
}