gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: C


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: Commenting out JS-based payments chapter as taler-wallet-lib doesn't contain anymore the functions needed to get a proposal and trigger a payment..
Date: Tue, 28 Mar 2017 17:12:23 +0200

This is an automated email from the git hooks/post-receive script.

marcello 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 0de353f  Commenting out JS-based payments chapter as taler-wallet-lib 
doesn't contain anymore the functions needed to get a proposal and trigger a 
payment..
0de353f is described below

commit 0de353ffc774cba2ba22b71d92aaab90dcaa3672
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 28 17:11:49 2017 +0200

    Commenting out JS-based payments chapter as taler-wallet-lib doesn't
    contain anymore the functions needed to get a proposal and trigger a
    payment..
---
 php/doc/tutorial.texi | 147 +++++++++++++++++++++++++-------------------------
 php/inline.php        |   2 +-
 2 files changed, 74 insertions(+), 75 deletions(-)

diff --git a/php/doc/tutorial.texi b/php/doc/tutorial.texi
index a53eefb..d394130 100644
--- a/php/doc/tutorial.texi
+++ b/php/doc/tutorial.texi
@@ -561,8 +561,7 @@ See below both parts:
 @menu
 * Presence detection::          Reacting to the presence of a Taler wallet
 * Taler contracts::             Building Taler contracts
-* Inline contracts::            Snding contracts with the HTTP header
-* Payments using JavaScript::   Triggering payments using JavaScript
+* Inline proposals::            Snding proposals with the HTTP header
 * The Fulfillment page::        The rationale behind the fulfillment page 
design
 @end menu
 
@@ -841,16 +840,16 @@ that they do not understand as a key-value list.
 
 @end table
 
address@hidden Inline contracts
address@hidden Inlining contracts in HTTP headers
address@hidden Inline proposals
address@hidden Inlining proposals in HTTP headers
 @cindex optimization
 @cindex contract
 
 In the example in @ref{Prompting for payment}, we told the wallet the URL
-from where it should fetch the contract.  Instead of specifying the contract
-via an URL, it is also possible to inline short contracts directly.
+from where it should fetch the proposal.  Instead of specifying the proposal
+via an URL, it is also possible to inline short proposals directly.
 
-That may be accomplished by the frontend including the @code{X-Taler-Contract}
+That may be accomplished by the frontend including the @code{X-Taler-Proposal}
 HTTP header, whenever the requested page is meant to trigger a payment.
 The example shown below may be an alternative version of @code{/donate.php},
 which implements inline contracts.
@@ -860,76 +859,76 @@ which implements inline contracts.
 @verbatiminclude ../inline.php
 @end smallexample
 
-The wallet will then look for the @code{X-Taler-Contract} header, and fetch the
+The wallet will then look for the @code{X-Taler-Proposal} header, and fetch the
 inlined contract if this header is found.  Please note that this feature is not
 yet implemented in the wallet.
 
address@hidden Payments using JavaScript
address@hidden Triggering payments using JavaScript
-
-Please note that the following examples are purely instructional and NOT TESTED
-along with the tutorial code.
-
address@hidden JavaScript
-
address@hidden Offering contracts
-
-Offering contracts the JavaScript way doesn't require us to set HTTP
-headers, and so -- in a minimalistic implementation -- the donation button
-should just hit a HTML page that invokes the @code{offerContractFrom} function,
-from the @code{taler-wallet-lib.js} library.
-
-Thus our homepage can now look as follows
-
address@hidden
-// ../index-js.html
address@hidden ../index-js.html
address@hidden smallexample
-
address@hidden is now in charge of calling @code{offerContractFrom} 
-passing the contract URL to it, which is @code{"/generate-order.php"} in
-our example.  See below.
-
address@hidden
-// ../donate-js.html
address@hidden ../donate-js.html
address@hidden smallexample
-
-Please make sure that @code{taler-wallet-lib.js} location is valid.
-
address@hidden Receiving payments
address@hidden payment
-
-In the example in section @ref{Initiating the payment process}, the fulfillment
-handler @code{/fulfillment.php} triggers the payment in the wallet by returing
-the three needed values (contract hashcode, pay URL, offer URL) via HTTP 
headers.
-
-The same action can be accomplished @emph{with} JavaScript, thanks to
address@hidden of @emph{web-common} repository.
-The fulfillment handler needs just to call the function @code{executePayment}, 
feeding it
-with the three needed parameters.  The wallet will then get triggered and 
proceed with the
-payment.  See below a full example:
-
address@hidden
-// ../fulfillment-js.php
address@hidden ../fulfillment-js.php
address@hidden smallexample
-
-Note that, in order to use this fulfillment handler for the tutorial, you need 
to
-specify it in the contract's ``fulfillment_url'' field:
-
address@hidden
address@hidden
-... contract fields ..
-
-"fulfillment_url": "/fulfillment-js.php?transaction_id=<TRANSACTION_ID>& \
-                   timestamp=<CONTRACTTIMESTAMP>"
-...
address@hidden
address@hidden smallexample
-
-Additionally, you should also make sure that @code{taler-wallet-lib.js} 
location
-is valid.
address@hidden @node Payments using JavaScript
address@hidden @section Triggering payments using JavaScript
address@hidden 
address@hidden Please note that the following examples are purely instructional 
and NOT TESTED
address@hidden along with the tutorial code.
address@hidden 
address@hidden @cindex JavaScript
address@hidden 
address@hidden @subsection Offering contracts
address@hidden 
address@hidden Offering contracts the JavaScript way doesn't require us to set 
HTTP
address@hidden headers, and so -- in a minimalistic implementation -- the 
donation button
address@hidden should just hit a HTML page that invokes the 
@code{offerContractFrom} function,
address@hidden from the @code{taler-wallet-lib.js} library.
address@hidden 
address@hidden Thus our homepage can now look as follows
address@hidden 
address@hidden @smallexample
address@hidden // ../index-js.html
address@hidden @verbatiminclude ../index-js.html
address@hidden @end smallexample
address@hidden 
address@hidden @code{donate-js.html} is now in charge of calling 
@code{offerContractFrom} 
address@hidden passing the contract URL to it, which is 
@code{"/generate-order.php"} in
address@hidden our example.  See below.
address@hidden 
address@hidden @smallexample
address@hidden // ../donate-js.html
address@hidden @verbatiminclude ../donate-js.html
address@hidden @end smallexample
address@hidden 
address@hidden Please make sure that @code{taler-wallet-lib.js} location is 
valid.
address@hidden 
address@hidden @subsection Receiving payments
address@hidden @cindex payment
address@hidden 
address@hidden In the example in section @ref{Initiating the payment process}, 
the fulfillment
address@hidden handler @code{/fulfillment.php} triggers the payment in the 
wallet by returing
address@hidden the three needed values (contract hashcode, pay URL, offer URL) 
via HTTP headers.
address@hidden 
address@hidden The same action can be accomplished @emph{with} JavaScript, 
thanks to
address@hidden @code{taler-wallet-lib.js} of @emph{web-common} repository.
address@hidden The fulfillment handler needs just to call the function 
@code{executePayment}, feeding it
address@hidden with the three needed parameters.  The wallet will then get 
triggered and proceed with the
address@hidden payment.  See below a full example:
address@hidden 
address@hidden @smallexample
address@hidden // ../fulfillment-js.php
address@hidden @verbatiminclude ../fulfillment-js.php
address@hidden @end smallexample
address@hidden 
address@hidden Note that, in order to use this fulfillment handler for the 
tutorial, you need to
address@hidden specify it in the contract's ``fulfillment_url'' field:
address@hidden 
address@hidden @smallexample
address@hidden @{
address@hidden ... contract fields ..
address@hidden 
address@hidden "fulfillment_url": 
"/fulfillment-js.php?transaction_id=<TRANSACTION_ID>& \
address@hidden                    timestamp=<CONTRACTTIMESTAMP>"
address@hidden ...
address@hidden @}
address@hidden @end smallexample
address@hidden 
address@hidden Additionally, you should also make sure that 
@code{taler-wallet-lib.js} location
address@hidden is valid.
 
 @node The fulfillment page
 @section Design considerations for the fulfillment page
diff --git a/php/inline.php b/php/inline.php
index ce73982..a6cf510 100644
--- a/php/inline.php
+++ b/php/inline.php
@@ -16,7 +16,7 @@
   }
 
   http_response_code(402); // Payment required
-  header ("X-Taler-Contract: $ret"); // Inline contract
+  header ("X-Taler-Proposal: $ret"); // Inline proposal
 ?>
 <!DOCTYPE html>
 <html lang="en">

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]