aboutsummaryrefslogtreecommitdiff
path: root/articles/ui/ui.tex
diff options
context:
space:
mode:
Diffstat (limited to 'articles/ui/ui.tex')
-rw-r--r--articles/ui/ui.tex100
1 files changed, 48 insertions, 52 deletions
diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index 1743937e3..63f7ddb0f 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -697,7 +697,7 @@ customers, and may help create a competitive market.
\subsection{Spending coins}
% \tinyskip
-\begin{figure}[t!]
+\begin{figure}[p!]
\subfloat[Select article][Select article. \\ Generated by Web shop.]{
\includegraphics[width=0.30\textwidth]{figs/cart.png}
\label{subfig:cart}} \hfill
@@ -743,7 +743,7 @@ merchant, the customer may choose to cover them.
morestring=[b]"
}
-\begin{figure*}[t!]
+\begin{figure*}[p!]
\lstset{language=HTML5}
\lstinputlisting{figs/taler-presence-js.html}
\caption{Sample code to detect the Taler wallet. Allowing the
@@ -754,10 +754,27 @@ merchant, the customer may choose to cover them.
\end{figure*}
-\begin{figure*}[t!]
+\begin{figure*}[p!]
+ \lstset{language={}}
+\begin{lstlisting}
+HTTP/1.1 402 Payment Required
+Content-Type: text/html; charset=UTF-8
+X-Taler-Contract-Url: https://shop/generate-contract/42
+
+<!DOCTYPE html>
+<html>
+ <!-- fallback for browsers without the Taler extension -->
+ You do not seem to have Taler installed, here are other payment options ...
+</html>
+\end{lstlisting}
+ \caption{Sample HTTP response to prompt the wallet to show an offer.}
+ \label{listing:http-contract}
+\end{figure*}
+
+\begin{figure*}[p!]
\lstset{language=HTML5}
\lstinputlisting{figs/taler-contract.html}
- \caption{Sample code to pass a contract to the Taler wallet.
+ \caption{Sample JavaScript code to prompt the wallet to show an offer.
Here, the contract is fetched on-demand from the server.
The {\tt taler\_pay()} function needs to be invoked
when the user triggers the checkout.}
@@ -804,27 +821,6 @@ a Taler wallet is installed (as it is in Figure~\ref{fig:shopping}).
\label{listing:json-contract}
\end{figure*}
-\begin{figure*}[t!]
- \lstset{language={}}
-\begin{lstlisting}
-HTTP/1.1 402 Payment Required
-Content-Type: text/html; charset=UTF-8
-X-Taler-Contract-Url: https://shop/generate-contract/42
-...
-
-<!DOCTYPE html>
-<html>
- ...
- <!-- fallback for browsers without the Taler extension -->
- You do not seem to have Taler installed, here are
- other payment options:
- ...
-</html>
-\end{lstlisting}
- \caption{Sample HTTP response for a Web resource that requires a payment.}
- \label{listing:http-contract}
-\end{figure*}
-
\subsubsection{Offer}
The offer URL of the Web shop can then initiate payments by sending a
@@ -859,6 +855,33 @@ the {\em fulfillment} URL provided by the merchant in the contract
\subsubsection{Fulfillment}
+\begin{figure*}[t!]
+ \lstset{language={}}
+\begin{lstlisting}
+HTTP/1.1 402 Payment Required
+Content-Type: text/html; charset=UTF-8
+X-Taler-Contract-Hash: 2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG
+X-Taler-Offer-Url: https://shop/article/42
+X-Taler-Pay-Url: https://shop/pay
+...
+
+<!DOCTYPE html>
+<html>
+ ...
+ <!-- fallback for browsers without the Taler extension -->
+ You do not seem to have Taler installed, here are
+ other payment options:
+ ...
+</html>
+\end{lstlisting}
+\caption{Sample HTTP response when the user agent navigates to a fulfillment
+ URL without the session state that indicates they have paid for the resource.
+ Note that unlike in Listing~\ref{listing:http-contract}, the response
+ references a contract that typically is already known to the wallet via its
+ hash code.}
+ \label{listing:http-execute}
+\end{figure*}
+
The fulfillment URL uniquely identifies a purchase by some customer,
while the offer URL identifies a generic offer that is not specific to
a customer. The purchase identified by a fulfillment URL may have
@@ -907,33 +930,6 @@ already approved, for example because the user obtained the link
from another user, the wallet navigates to the offer URL included
in the header.
-\begin{figure*}[t!]
- \lstset{language={}}
-\begin{lstlisting}
-HTTP/1.1 402 Payment Required
-Content-Type: text/html; charset=UTF-8
-X-Taler-Contract-Hash: 2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG
-X-Taler-Offer-Url: https://shop/article/42
-X-Taler-Pay-Url: https://shop/pay
-...
-
-<!DOCTYPE html>
-<html>
- ...
- <!-- fallback for browsers without the Taler extension -->
- You do not seem to have Taler installed, here are
- other payment options:
- ...
-</html>
-\end{lstlisting}
-\caption{Sample HTTP response when the user agent navigates to a fulfillment
- URL without the session state that indicates they have paid for the resource.
- Note that unlike in Listing~\ref{listing:http-contract}, the response
- references a contract that typically is already known to the wallet via its
- hash code.}
- \label{listing:http-execute}
-\end{figure*}
-
\subsubsection{Discussion}
Various failure modes are considered in this design: