From fddd06c15210557997e3ac468ca54677eacbf412 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Sun, 7 May 2023 17:52:46 +0200
Subject: proc doc

---
 doc/flows/int-pay.tex | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 doc/flows/int-pay.tex

(limited to 'doc/flows/int-pay.tex')

diff --git a/doc/flows/int-pay.tex b/doc/flows/int-pay.tex
new file mode 100644
index 00000000..d2f0fb58
--- /dev/null
+++ b/doc/flows/int-pay.tex
@@ -0,0 +1,58 @@
+\section{Pay}
+
+\begin{figure}[h!]
+  \begin{sequencediagram}
+    \newinst{wallet}{\shortstack{Customer wallet \\
+      \\ \begin{tikzpicture}
+        \node [fill=gray!20,draw=black,thick,align=center] { Unique \\ Wallet ID};
+      \end{tikzpicture}
+    }}
+    \newinst[1]{merchant}{\shortstack{Merchant \\
+       \\ \begin{tikzpicture}[shape aspect=.5]
+        \tikzset{every node/.style={cylinder,shape border rotate=90, draw,fill=gray!25}}
+        \node at (1.5,0) {\shortstack{{{\tiny Database}}}};
+       \end{tikzpicture}
+    }}
+    \newinst[1]{exchange}{\shortstack{Taler (exchange) \\
+       \\ \begin{tikzpicture}[shape aspect=.5]
+        \tikzset{every node/.style={cylinder,shape border rotate=90, draw,fill=gray!25}}
+        \node at (1.5,0) {\shortstack{{{\tiny Database}}}};
+       \end{tikzpicture}
+    }}
+    \newinst[1]{bank}{\shortstack{Merchant bank \\
+      \\ \begin{tikzpicture}
+        \node [fill=gray!20,draw=black,thick,align=center] {Commercial \\ Accounts};
+      \end{tikzpicture}
+    }}
+    \postlevel
+    \mess[0]{wallet}{Browse catalog}{merchant}
+    \mess[0]{merchant}{Commercial offer}{wallet}
+    \begin{callself}{wallet}{Review offer}{}
+    \end{callself}
+    \mess[0]{wallet}{Send payment {(Coins)}}{merchant}
+    \mess[0]{merchant}{Deposit {(Coins)}}{exchange}
+    \begin{sdblock}{Acceptable account?}{}
+    \mess[0]{exchange}{{Refuse deposit}}{merchant}
+    \mess[0]{merchant}{{Refund purchase}}{wallet}
+    \end{sdblock}
+    \mess[0]{exchange}{{Confirm deposit}}{merchant}
+    \mess[0]{merchant}{Fulfill order}{wallet}
+    \begin{callself}{exchange}{Aggregate transactions}{}
+    \end{callself}
+    \begin{sdblock}{KYC/AML required?}{}
+    \begin{callself}{exchange}{Figures~\ref{fig:proc:kyc}, \ref{fig:proc:aml}}{}
+    \end{callself}
+    \end{sdblock}
+    \mess[0]{exchange}{{Initiate transfer}}{bank}
+  \end{sequencediagram}
+  \caption{Deposit interactions between customer, merchant,
+    Taler exchange (payment service provider) and merchant bank.}
+  \label{fig:int:pay}
+\end{figure}
+
+{\bf Internal note:} The exchange refusing a deposit immediately based on
+unaccaptable merchant accounts may not be fully implemented (this is a very
+recent feature, after all); especially the merchant then automatically
+refunding the purchase to the customer is certainly missing.  However,
+the entire situation only arises when a merchant is incorrectly configured
+and in violation of the terms of service.
-- 
cgit v1.2.3

