From 7d31c03da1dc3c4862c6d23c428aa0db12537560 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Fri, 26 Aug 2016 16:04:12 +0200
Subject: reorder figs

---
 articles/ui/ui.tex | 100 +++++++++++++++++++++++++----------------------------
 1 file changed, 48 insertions(+), 52 deletions(-)

(limited to 'articles/ui/ui.tex')

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:
-- 
cgit v1.2.3


From 9cbe7a498dfe35962bc76bcde8434c2d29eb14f1 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Fri, 26 Aug 2016 16:10:28 +0200
Subject: js payment execution

---
 articles/ui/ui.tex | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

(limited to 'articles/ui/ui.tex')

diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index 63f7ddb0f..bac62d80b 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -855,14 +855,29 @@ the {\em fulfillment} URL provided by the merchant in the contract
 
 \subsubsection{Fulfillment}
 
+\begin{figure*}[t!]
+  \lstset{language=HTML5}
+\begin{lstlisting}
+  taler.executePayment("2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG",
+    "https://shop/pay",
+    "https://shop/article/42",
+    (err) => {
+      alert("Sending payment failed");
+    });
+\end{lstlisting}
+\caption{Sample JavaScript code to trigger (re-)sending a payment to the merchant.}
+  \label{listing:javascript-execute}
+\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-Hash: 2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG
-X-Taler-Offer-Url: https://shop/article/42
 X-Taler-Pay-Url: https://shop/pay
+X-Taler-Offer-Url: https://shop/article/42
 ...
 
 <!DOCTYPE html>
@@ -910,7 +925,7 @@ lost,\footnote{This can happen when when privacy conscious users
   browser) do not support persistent (non-session) cookies.} the Web
 store responds by (again) triggering a payment process (either via
 JavaScript or using {\tt 402 Payment Required}, see
-Figure~\ref{listing:http-execute}).  However, unlike the response from
+Figures~\ref{listing:javascript-execute} and~\ref{listing:http-execute}).  However, unlike the response from
 the offer URL, the 402 response from the fulfillment page includes the
 headers {\tt X-Taler-Contract-Hash}, {\tt X-Taler-Pay-Url} and {\tt
   X-Taler-Offer-Url}.
-- 
cgit v1.2.3


From a40d42d618cbd5ea9a42f0a2ad90e0f54f914ccf Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Fri, 26 Aug 2016 16:10:48 +0200
Subject: cut

---
 articles/ui/ui.tex | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

(limited to 'articles/ui/ui.tex')

diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index 63f7ddb0f..e06240a57 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -860,18 +860,14 @@ the {\em fulfillment} URL provided by the merchant in the contract
 \begin{lstlisting}
 HTTP/1.1 402 Payment Required
 Content-Type: text/html; charset=UTF-8
-X-Taler-Contract-Hash: 2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG
+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:
-  ...
+  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
-- 
cgit v1.2.3


From 64373e23adb2094a02f8e0f20bfdf73939a6c01a Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Fri, 26 Aug 2016 16:16:48 +0200
Subject: put an actual fulfillment URL in the contract

---
 articles/ui/ui.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'articles/ui/ui.tex')

diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index c466331ec..9a0038755 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -804,7 +804,7 @@ a Taler wallet is installed (as it is in Figure~\ref{fig:shopping}).
   "exchanges":[{"master_pub":"1T5FA8VQHMMKBHDMYPRZA2ZFK2S63AKF0YTHJZWFKF45K2JGC8H0",
                 "url":"https://exchange/"}],
   "expiry":"/Date(1480119270)/",
-  "fulfillment_url": "https://shop/essay/42",
+  "fulfillment_url": "https://shop/article/42?tid=249960194066269?time=1471479270",
   "max_fee":{"currency":"EUR","fraction":01,"value":0},
   "merchant":{"address":"Mailbox 4242","jurisdiction":"Jersey","name":"Shop Inc."},
   "merchant_pub":"Y1ZAR5346J3ZTEXJCHQY9NJN78EZ2HSKZK8M0MYTNRJG5N0HD520",
-- 
cgit v1.2.3


From 2f4aaca8502a60cabdfec6d011141d2604f08a0b Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Fri, 26 Aug 2016 16:17:11 +0200
Subject: compress

---
 articles/ui/ui.tex | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'articles/ui/ui.tex')

diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index c466331ec..1ec74dbf9 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -859,13 +859,10 @@ the {\em fulfillment} URL provided by the merchant in the contract
   \lstset{language=HTML5}
 \begin{lstlisting}
   taler.executePayment("2BAH2AT4GSG5JRM2W4YWTSYGY66EK4X8CX2V69D5VF7XV703AJMG",
-    "https://shop/pay",
-    "https://shop/article/42",
-    (err) => {
-      alert("Sending payment failed");
-    });
+    "https://shop/pay", "https://shop/article/42",
+    (err) => { alert("Sending payment failed");  });
 \end{lstlisting}
-\caption{Sample JavaScript code to trigger (re-)sending a payment to the merchant.}
+\caption{Sample JavaScript code to trigger transmission of a payment to the merchant.}
   \label{listing:javascript-execute}
 \end{figure*}
 
-- 
cgit v1.2.3


From 8258db6b55d7672d8174b7da53be7e933eeb7fd8 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Fri, 26 Aug 2016 16:17:50 +0200
Subject: url syntax

---
 articles/ui/ui.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'articles/ui/ui.tex')

diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex
index edbd02149..5060de2ee 100644
--- a/articles/ui/ui.tex
+++ b/articles/ui/ui.tex
@@ -804,7 +804,7 @@ a Taler wallet is installed (as it is in Figure~\ref{fig:shopping}).
   "exchanges":[{"master_pub":"1T5FA8VQHMMKBHDMYPRZA2ZFK2S63AKF0YTHJZWFKF45K2JGC8H0",
                 "url":"https://exchange/"}],
   "expiry":"/Date(1480119270)/",
-  "fulfillment_url": "https://shop/article/42?tid=249960194066269?time=1471479270",
+  "fulfillment_url": "https://shop/article/42?tid=249960194066269&time=1471479270",
   "max_fee":{"currency":"EUR","fraction":01,"value":0},
   "merchant":{"address":"Mailbox 4242","jurisdiction":"Jersey","name":"Shop Inc."},
   "merchant_pub":"Y1ZAR5346J3ZTEXJCHQY9NJN78EZ2HSKZK8M0MYTNRJG5N0HD520",
-- 
cgit v1.2.3

