[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: d
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: documentation for interfacing with the wallet |
Date: |
Fri, 02 Jun 2017 19:20:52 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository merchant-frontend-examples.
The following commit(s) were added to refs/heads/master by this push:
new bcd517d documentation for interfacing with the wallet
bcd517d is described below
commit bcd517d30e6095b9329e3dbcada4d100adcedc6c
Author: Florian Dold <address@hidden>
AuthorDate: Fri Jun 2 19:20:49 2017 +0200
documentation for interfacing with the wallet
---
python/doc/tutorial.texi | 87 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 83 insertions(+), 4 deletions(-)
diff --git a/python/doc/tutorial.texi b/python/doc/tutorial.texi
index bf25d1a..6c0a60c 100644
--- a/python/doc/tutorial.texi
+++ b/python/doc/tutorial.texi
@@ -38,6 +38,7 @@ Texts. A copy of the license is included in the section
entitled
@subtitle @value{UPDATED}
@author Christian Grothoff (@email{christian@@grothoff.org})
@author Marcello Stanisci (@email{marcello.stanisci@@inria.fr})
address@hidden Florian Dold (@email{florian.dold@@inria.fr})
@page
@vskip 0pt plus 1filll
@insertcopying
@@ -55,7 +56,8 @@ Texts. A copy of the license is included in the section
entitled
@menu
* Introduction:: What this tutorial is about
* Setting up a simple donation page:: How to set up a donation page
-* Advanced topics Detailed solutions to
specific issues
+* Advanced topics:: Detailed solutions to
specific issues
+* Reference:: Merchant integration reference
Appendices
@@ -369,9 +371,6 @@ def fulfillment():
# At this URL, the wallet may request a regeneration of the proposal.
response.headers["X-Taler-Contract-Url"] = make_url("/generate-proposal")
- response.headers["X-Taler-Contract-Query"] = "fulfillment_url"
- # This is the URL which receives the payment.
- response.headers["X-Taler-Pay-Url"] = make_url("/pay")
# This URL will be visited in case the user has opened
# on someone else's fulfillment URL. As a result, the
# user will be offered a fresh proposal.
@@ -499,6 +498,86 @@ Rationale: Joining non-canonical URLs with relative URLs
(e.g. "exchange.exampl
results in different and slightly unexpected behavior in some URL handling
libraries.
Canonical URLs give more predictable results with standard URL joining.
address@hidden Reference
address@hidden Reference
+
address@hidden
+* Headers for HTTP 402:: Headers for the 402 status code and
their effect on the user agent's operation
+* JavaScript API:: JavaScript API to communicate with
the wallet
+* Stylesheet-based presence detection:: Presence detection using CSS style
sheets and no JavaScript
address@hidden menu
+
address@hidden Headers for HTTP 402
address@hidden Headers for HTTP 402
+The HTTP status code @code{402 Payment Required} can be used by the merchant
+frontend to trigger operations related to payments in the user agent. The user
+agent associates at most one proposal with every URL via the proposal's
address@hidden field. The associated proposal is either missing (in
+case it doesn't exist), paid (in case the payment for it was successfully sent
+to the merchant) or unpaid. If the associated proposal is unpaid, @code{402
+Payment Required} will cause the user agent to pay for the associated proposal.
+
+The following headers for @code{402 Payment Required} are recognized by Taler
and further influence the processing:
address@hidden @code
address@hidden X-Taler-Refund
+If this header present, the value of this header must be a URL that the user
agent can use to request and process refunds.
+
address@hidden X-Taler-Contract-Url
+If there is no associated proposal, the user agent will fetch a proposal from
+this URL and process it. This typically prompts the user to agree to pay.
+
address@hidden X-Taler-Offer-Url
+If there is no associated proposal and @code{X-Taler-Contract-Url} is not
+specified, the browser will navigate to this URL.
+
address@hidden table
+
address@hidden JavaScript API
address@hidden JavaScript API
+
+The following functions are defined in the @code{taler} namespace of the
@code{taler-wallet-lib} helper library
+available at
@url{https://git.taler.net/web-common.git/tree/taler-wallet-lib.js}.
+
address@hidden @code
address@hidden onPresent(callback: () => void)
+Add a callback to be called when support for Taler payments is detected.
+
address@hidden onAbsent(callback: () => void)
+Add a callback to be called when support for Taler payments is disabled.
+
address@hidden pay(@{contract_url: string, offer_url: address@hidden)
+Results in the same action as a @code{402 Payment Required} with
@code{contract_url} in
+the @code{X-Taler-Contract-Url} header and @code{offer_url} in the
@code{X-Taler-Payment-Url} header.
+
address@hidden refund(refund_url: string)
+Results in the same action as a @code{402 Payment Required} with
@code{refund_url} in
+the @code{X-Taler-Refund-Url} header.
+
address@hidden table
+
address@hidden Stylesheet-based presence detection
address@hidden Stylesheet-based presence detection
+
+Stylesheet-based presence detection will be applied on all pages that have the
address@hidden attribute of the @code{html} element set @code{true}.
+The default/fallback stylesheet, that will be taken over by the wallet once
+installed, must be included with the id @code{taler-presence-stylesheet}, like
+this:
+
+The following CSS classes can be used:
address@hidden @code
address@hidden taler-installed-hide
+A CSS rule will set the @code{display} property for this class to @code{none}
once the Taler wallet is installed and enabled.
+If the wallet is not installed, @code{display} will be @code{inherit}.
+
address@hidden taler-installed-show
+A CSS rule will set the @code{display} property for this class to
@code{inherit} once the Taler wallet is installed and enabled.
+If the wallet is not installed, @code{display} will be @code{none}.
+
address@hidden table
+
+
+
@c **********************************************************
@c ******************* Appendices *************************
@c **********************************************************
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: documentation for interfacing with the wallet,
gnunet <=