summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/refund
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-05-15 15:34:24 -0600
committerTorsten Grote <t@grobox.de>2023-07-11 10:31:26 -0300
commit58f5dc13d51eef09463e215af0ac526216531074 (patch)
treeb8685fc4f3fee8888d6e7923ac7c6f9c59574eea /wallet/src/main/java/net/taler/wallet/refund
parent255094c5432244ca214055cc9406a31d5b561b5f (diff)
downloadtaler-android-58f5dc13d51eef09463e215af0ac526216531074.tar.gz
taler-android-58f5dc13d51eef09463e215af0ac526216531074.tar.bz2
taler-android-58f5dc13d51eef09463e215af0ac526216531074.zip
[wallet] Implemented DD37 with the new txActions field
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/refund')
-rw-r--r--wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt16
1 files changed, 11 insertions, 5 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt b/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt
index 307e3e2..c160dec 100644
--- a/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt
+++ b/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt
@@ -40,19 +40,24 @@ import net.taler.wallet.backend.TalerErrorInfo
import net.taler.wallet.compose.TalerSurface
import net.taler.wallet.payment.PurchaseDetails
import net.taler.wallet.transactions.AmountType
-import net.taler.wallet.transactions.DeleteTransactionComposable
import net.taler.wallet.transactions.ErrorTransactionButton
-import net.taler.wallet.transactions.ExtendedStatus
+import net.taler.wallet.transactions.TransactionAction
+import net.taler.wallet.transactions.TransactionAction.Abort
+import net.taler.wallet.transactions.TransactionAction.Retry
+import net.taler.wallet.transactions.TransactionAction.Suspend
import net.taler.wallet.transactions.TransactionAmountComposable
import net.taler.wallet.transactions.TransactionInfo
+import net.taler.wallet.transactions.TransactionMajorState.Pending
import net.taler.wallet.transactions.TransactionRefund
+import net.taler.wallet.transactions.TransactionState
+import net.taler.wallet.transactions.TransitionsComposable
@Composable
fun TransactionRefundComposable(
t: TransactionRefund,
devMode: Boolean,
onFulfill: (url: String) -> Unit,
- onDelete: () -> Unit,
+ onTransition: (t: TransactionAction) -> Unit,
) {
val scrollState = rememberScrollState()
Column(
@@ -85,7 +90,7 @@ fun TransactionRefundComposable(
PurchaseDetails(info = t.info) {
onFulfill(t.info.fulfillmentUrl ?: "")
}
- DeleteTransactionComposable(onDelete)
+ TransitionsComposable(t, onTransition)
if (devMode && t.error != null) {
ErrorTransactionButton(error = t.error)
}
@@ -98,7 +103,8 @@ fun TransactionRefundComposablePreview() {
val t = TransactionRefund(
transactionId = "transactionId",
timestamp = Timestamp.fromMillis(System.currentTimeMillis() - 360 * 60 * 1000),
- extendedStatus = ExtendedStatus.Pending,
+ txState = TransactionState(Pending),
+ txActions = listOf(Retry, Suspend, Abort),
info = TransactionInfo(
orderId = "123",
merchant = ContractMerchant(name = "Taler"),