diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-08-23 15:34:59 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-08-23 15:35:07 +0200 |
commit | 3ef07c6c9f11585b5826bbc3eac6fe90d2a9467a (patch) | |
tree | 6b9aa902fce14fc5fe20f06bee3c0239a84eca3a | |
parent | ea700ceb3287edc9220f37a43dec23a419f01eb5 (diff) |
http payment request - contract
-rw-r--r-- | articles/ui/ui.tex | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/articles/ui/ui.tex b/articles/ui/ui.tex index 57232c7fd..aaaf6e363 100644 --- a/articles/ui/ui.tex +++ b/articles/ui/ui.tex @@ -769,10 +769,29 @@ detect the presence of a Taler wallet (Figure~\ref{listing:presence}), so that the selection of alternative payment methods can be skipped if a Taler wallet is installed (as it is in Figure~\ref{fig:shopping}). -% FIXME: add figure for 402 payment! +\begin{figure*}[h!] + \lstset{language={}} +\begin{lstlisting} +HTTP/1.1 402 Payment Required +Content-Type: text/html; charset=UTF-8 +X-Taler-Contract-Url: https://myshop/generate-contract?product=42 +... + +<!DOCTYPE html> +<html> + ... + You don't 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*} + The offer URL of the Web shop can then initiate payments by sending a \emph{contract proposal} to the wallet, either via the HTTP status -code {\tt 402 Payment Required}, or via Taler's JavaScript API +code {\tt 402 Payment Required} (Figure~\ref{listing:http-contract}), or via Taler's JavaScript API (Figure~\ref{listing:contract}). The wallet then presents the contract to the user. The format of the contract is in an extensible JSON-based format defined by Taler and not HTML, as the rendering of @@ -841,6 +860,25 @@ URL in a browser will show the resource associated with the purchase. This resource can be a digital good such as a news article, or simply a confirmation for products that are delivered by other means. +\begin{figure*}[h!] + \lstset{language={}} +\begin{lstlisting} +HTTP/1.1 402 Payment Required +Content-Type: text/html; charset=UTF-8 +X-Taler-Contract-Url: https://myshop/generate-contract?product=42 +... + +<html> + ... + You don't 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*} + In order to ensure that only the paying customer has access to the Web resources behind the fulfillment URL, the Web store's server must check the browser's session state. If the merchant can confirm that |