commit 54320733c78966c3c3e6231253c2e1ca429f0d38
parent 920ae73206495e7e79f37dd6ab44ea7c1932a5e6
Author: Florian Dold <florian@dold.me>
Date: Fri, 17 Feb 2023 00:33:08 +0100
DD37 wip
Diffstat:
1 file changed, 36 insertions(+), 6 deletions(-)
diff --git a/design-documents/037-wallet-transactions-lifecycle.rst b/design-documents/037-wallet-transactions-lifecycle.rst
@@ -89,14 +89,20 @@ Transaction Type: Withdrawal
* ``pending(bank-register-reserve)``
- Initial state for bank-integrated withdrawals.
+ Initial state for bank-integrated withdrawals. The wallet submits the reserve public key
+ and selected exchange to the bank (via the bank integration API).
* ``[processing-success] => pending(bank-confirming)``
* ``[processing-error(bank-aborted)] => aborted(bank)``
* ``pending(bank-confirming)``
+ The wallet waits until the bank has confirmed the withdrawal operation; usually
+ the user has to complete a 2FA step to confirm that the money is wired to the chosen
+ exchange.
+
* ``[poll-success] => pending(exchange-wait-reserve)``
+ * ``[action:abort] => aborting(wallet-to-bank)
* ``pending(exchange-wait-reserve)``
@@ -113,24 +119,45 @@ Transaction Type: Withdrawal
* ``[poll-success] => pending(withdrawing-coins)``
-* ``aborted(bank)``: The bank notified the wallet that the withdrawal
+* ``aborting(wallet-to-bank)``
+
+ * ``[processing-success] => aborted(wallet-to-bank)``
+ * ``[processing-error(already-confirmed)] => aborted(after-wired)``
+
+* ``aborted(bank-to-wallet)``: The bank notified the wallet that the withdrawal
was aborted on the side of the bank and won't proceed.
+* ``aborted(wallet-to-bank)``: The wallet notified the bank that the withdrawal
+ should be aborted, before any money was wired.
+
+* ``aborted(after-wired)``:
+
+ In this state, the wallet should show to the user that the money from the withdrawal
+ reserve will be sent back to the originating bank account after `$closing_delay`.
+
* ``done``
Transaction Type: Payment to Merchant
-------------------------------------
-* ``pending(claim)``
+* ``pending(download-proposal)``
+
+ Initial state. Download (claim) the proposal from the merchant.
+
+ XXX: Also consider repurchase detection here?
* ``pending(proposed)``
+ Let the user accept (or refuse) the payment.
+
* ``[action:pay-accept] => pending(submit-payment)``
* ``pending(submit-payment)``
* ``[action:abort] => aborting(refund)``
* ``[processing-success(auto-refund-enabled)] => pending(paid-auto-refund-check)``
+ * ``[processing-error(expired)] => aborting(refresh)`` XXX: If the order is expired but the payment
+ succeeded partially before, do we still try an abort-refund?
* ``pending(submit-payment-replay)``
@@ -147,15 +174,18 @@ Transaction Type: Payment to Merchant
* ``aborting(refund)``
- * ``[processing-success] => aborted``
+ * ``[processing-success] => aborted(refunded)``
* ``[processing-failure] => aborting(refresh)``
* ``aborting(refresh)``
-* ``aborted``
+* ``failed(invalid-proposal)``
- * ``[action:delete] => deleted``
+ The merchant provided a proposal that is invalid (e.g. malformed contract terms or bad signature).
+
+* ``aborted(refunded)``
+ * ``[action:delete] => deleted``
Transaction Type: Refund