summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-25 15:48:05 +0200
committerFlorian Dold <florian@dold.me>2023-04-25 15:48:05 +0200
commit8fb0026bc2cda985d4400bb86be67ed956f3d07b (patch)
treec4e8db01764689a0f13124b462cbf4ffda3c1e07
parent66219dc6d7466730f6517361ce51e3678195cd85 (diff)
downloaddocs-8fb0026bc2cda985d4400bb86be67ed956f3d07b.tar.gz
docs-8fb0026bc2cda985d4400bb86be67ed956f3d07b.tar.bz2
docs-8fb0026bc2cda985d4400bb86be67ed956f3d07b.zip
simplify diagrams
-rw-r--r--design-documents/037-wallet-transactions-lifecycle.rst43
-rw-r--r--transaction-payment-states.dot6
-rw-r--r--transaction-refund-states.dot49
3 files changed, 27 insertions, 71 deletions
diff --git a/design-documents/037-wallet-transactions-lifecycle.rst b/design-documents/037-wallet-transactions-lifecycle.rst
index 90b39ee1..be39e076 100644
--- a/design-documents/037-wallet-transactions-lifecycle.rst
+++ b/design-documents/037-wallet-transactions-lifecycle.rst
@@ -429,13 +429,22 @@ Transaction Type: Payment to Merchant
completed. It is not relevant for auto-refunds or refunds for incomplete
payments.
- * ``[refunds-checked] => done`` --- Refunds were checked, this
- might create new refund transactions.
+ * ``[refunds-checked] => pending(user-new-refunds)`` --- New
+ refund(s) are available, user needs to confirm.
+ * ``[refunds-checked] => done`` --- Refunds were checked, but no
+ new refunds are available.
* ``[action:stop-refund-query] => done`` ---
This action would usually only be offered when the state is pending
with errors. It stops the refund query, but the payment of course
is left intact.
+* ``pending(user-new-refunds)``
+
+ * ``[action:accept] => done``: User accepts refunds,
+ new refund transactions will be created.
+ * ``[action:refuse] => done``: User refuses new refunds,
+ no new refund transactions will be created.
+
* ``pending(repurchase-session-reset)``
The wallet should reset the associated session for the already purchased
@@ -459,33 +468,13 @@ Transaction Type: Refund
A refund is a pseudo-transaction that is always associated with a merchant
payment transaction.
-* ``pending(lookup-refund)``
-
- We received a ``refund`` URI. Download refund details (like the amount) from
- the merchant. If the merchant responds with a permanent failure, we only
- show a transient warning and delete the transaction.
-
- * ``[success] => pending(user-accept)``
- * ``[action:suspend] => suspended(lookup-refund)``
- * ``[failure] => deleted``: A transient warning is shown to the user about the failure.
-
-* ``suspended(lookup-refund)``
-
- The user suspended while we were looking up the refund details. Allow resuming or permanent deletion.
-
- * ``[action:resume] => pending(lookup-refund)``
- * ``[action:force-delete] => deleted``: Refund funds will be lost to the user.
-
-* ``pending(user-accept)``
-
- The wallet has downloaded metadata for the refund from the merchant and stored it in the database. The user needs to accept/refuse it.
-
- * ``[action:accept] => pending(merchant)``: the refund is accepted
- * ``[action:delete] => deleted`` : the refund is not accepted
-
* ``pending(merchant)``
- A refund is pending in this state while we are waiting for the merchant to get a successful response from the exchange (and relaying that error response to the wallet).
+ Initial state for a refund.
+
+ A refund is pending in this state while we are waiting for the merchant to
+ get a successful response from the exchange (and relaying that error response
+ to the wallet).
* ``[action:suspend] => suspended(merchant)``
* ``[processed-success] => pending(refresh)``
diff --git a/transaction-payment-states.dot b/transaction-payment-states.dot
index 481869bf..d42582b8 100644
--- a/transaction-payment-states.dot
+++ b/transaction-payment-states.dot
@@ -5,8 +5,9 @@ digraph G {
pending_dp[label="pending(claim-proposal)"];
pending_sp[label="pending(submit-payment)"];
pending_ar[label="pending(auto-refund)"];
- pending_re[label="pending(repurchase-session-reset)"];
+ pending_re[label="pending\n(repurchase-session-reset)"];
pending_cr[label="pending(check-refunds)"];
+ pending_user_new_refunds[label="pending(user-new-refunds)"];
aborting_pi[label="aborting(payment-incomplete)"];
aborted_pi[label="aborted(payment-incomplete)", shape="box"];
aborted_refused[label="aborted(refused)", shape="box"];
@@ -37,6 +38,9 @@ digraph G {
done -> pending_re;
pending_cr -> done;
+ pending_cr -> pending_user_new_refunds;
+
+ pending_user_new_refunds -> done;
pending_re -> done;
}
diff --git a/transaction-refund-states.dot b/transaction-refund-states.dot
index 8bd9ce62..3d421126 100644
--- a/transaction-refund-states.dot
+++ b/transaction-refund-states.dot
@@ -1,52 +1,15 @@
digraph G {
- initial[label="", shape="circle"];
- pending_in[label="pending(lookup-refund)"];
- pending_ar[label="pending(user-accept)", shape="box"];
- pending_me[label="pending(merchant)"];
+ initial[label="", shape="circle", xlabel="refund"];
+ pending_merchant[label="pending(merchant)"];
pending_re[label="pending(refresh)"];
- suspended_in[label="suspended(lookup-refund)", shape="box"];
- suspended_me[label="suspended(merchant)", shape="box"];
- suspended_re[label="suspended(refresh)", shape="box"];
done[label="done", shape="box"];
- deleted[label="deleted", shape="box"];
failed[label="failed", shape="box"];
- subgraph {
- rank = same; pending_in; pending_ar; pending_me; pending_re;
- }
- subgraph {
- rank = same; suspended_in; suspended_me; suspended_re; done;
- }
+ initial->pending_merchant;
- initial->pending_in [color="blue", label="URI trigger"];
-
- pending_in->pending_ar;
- pending_in->suspended_in [color="blue", label="suspend"];
- pending_in->deleted [color="red", label="failure"];
-
- suspended_in->pending_in [color="blue", label="resume"];
- suspended_in->deleted [color="blue", label="force-delete"];
-
- pending_ar->pending_me [color="blue", label="accept"];
- pending_ar->deleted [color="blue", label="force-delete"];
-
- pending_me->pending_re;
- pending_me->suspended_me [color="blue", label="suspend"];
- pending_me->failed [color="red", label="failure"];
-
- suspended_me->pending_me [color="blue", label="resume"];
- suspended_me->deleted [color="blue", label="force-delete"];
-
- pending_re->suspended_re [color="blue", label="suspend"];
+ pending_merchant->pending_re;
+ pending_merchant->failed;
+
pending_re->done;
- pending_re->failed [color="red", label="failure"];
-
- suspended_re->pending_re [color="blue", label="resume"];
- suspended_re->deleted [color="blue", label="force-delete"];
-
- done->deleted [color="blue", label="delete"];
-
- failed->deleted [color="blue", label="delete"];
-
}