summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-28 17:11:49 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-28 17:11:49 +0200
commit0de353ffc774cba2ba22b71d92aaab90dcaa3672 (patch)
tree6b01678f831d92cb8847a47e3b90d270a4085ce2 /php
parent24b217512cc1c059e5885a80e21d4d5a7dadf539 (diff)
downloadmerchant-frontend-examples-0de353ffc774cba2ba22b71d92aaab90dcaa3672.tar.gz
merchant-frontend-examples-0de353ffc774cba2ba22b71d92aaab90dcaa3672.tar.bz2
merchant-frontend-examples-0de353ffc774cba2ba22b71d92aaab90dcaa3672.zip
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..
Diffstat (limited to 'php')
-rw-r--r--php/doc/tutorial.texi147
-rw-r--r--php/inline.php2
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
-@node Inline contracts
-@section Inlining contracts in HTTP headers
+@node Inline proposals
+@section 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.
-@node Payments using JavaScript
-@section Triggering payments using JavaScript
-
-Please note that the following examples are purely instructional and NOT TESTED
-along with the tutorial code.
-
-@cindex JavaScript
-
-@subsection 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
-
-@smallexample
-// ../index-js.html
-@verbatiminclude ../index-js.html
-@end smallexample
-
-@code{donate-js.html} 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.
-
-@smallexample
-// ../donate-js.html
-@verbatiminclude ../donate-js.html
-@end smallexample
-
-Please make sure that @code{taler-wallet-lib.js} location is valid.
-
-@subsection Receiving payments
-@cindex 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
-@code{taler-wallet-lib.js} 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:
-
-@smallexample
-// ../fulfillment-js.php
-@verbatiminclude ../fulfillment-js.php
-@end 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:
-
-@smallexample
-@{
-... contract fields ..
-
-"fulfillment_url": "/fulfillment-js.php?transaction_id=<TRANSACTION_ID>& \
- timestamp=<CONTRACTTIMESTAMP>"
-...
-@}
-@end smallexample
-
-Additionally, you should also make sure that @code{taler-wallet-lib.js} location
-is valid.
+@c @node Payments using JavaScript
+@c @section Triggering payments using JavaScript
+@c
+@c Please note that the following examples are purely instructional and NOT TESTED
+@c along with the tutorial code.
+@c
+@c @cindex JavaScript
+@c
+@c @subsection Offering contracts
+@c
+@c Offering contracts the JavaScript way doesn't require us to set HTTP
+@c headers, and so -- in a minimalistic implementation -- the donation button
+@c should just hit a HTML page that invokes the @code{offerContractFrom} function,
+@c from the @code{taler-wallet-lib.js} library.
+@c
+@c Thus our homepage can now look as follows
+@c
+@c @smallexample
+@c // ../index-js.html
+@c @verbatiminclude ../index-js.html
+@c @end smallexample
+@c
+@c @code{donate-js.html} is now in charge of calling @code{offerContractFrom}
+@c passing the contract URL to it, which is @code{"/generate-order.php"} in
+@c our example. See below.
+@c
+@c @smallexample
+@c // ../donate-js.html
+@c @verbatiminclude ../donate-js.html
+@c @end smallexample
+@c
+@c Please make sure that @code{taler-wallet-lib.js} location is valid.
+@c
+@c @subsection Receiving payments
+@c @cindex payment
+@c
+@c In the example in section @ref{Initiating the payment process}, the fulfillment
+@c handler @code{/fulfillment.php} triggers the payment in the wallet by returing
+@c the three needed values (contract hashcode, pay URL, offer URL) via HTTP headers.
+@c
+@c The same action can be accomplished @emph{with} JavaScript, thanks to
+@c @code{taler-wallet-lib.js} of @emph{web-common} repository.
+@c The fulfillment handler needs just to call the function @code{executePayment}, feeding it
+@c with the three needed parameters. The wallet will then get triggered and proceed with the
+@c payment. See below a full example:
+@c
+@c @smallexample
+@c // ../fulfillment-js.php
+@c @verbatiminclude ../fulfillment-js.php
+@c @end smallexample
+@c
+@c Note that, in order to use this fulfillment handler for the tutorial, you need to
+@c specify it in the contract's ``fulfillment_url'' field:
+@c
+@c @smallexample
+@c @{
+@c ... contract fields ..
+@c
+@c "fulfillment_url": "/fulfillment-js.php?transaction_id=<TRANSACTION_ID>& \
+@c timestamp=<CONTRACTTIMESTAMP>"
+@c ...
+@c @}
+@c @end smallexample
+@c
+@c Additionally, you should also make sure that @code{taler-wallet-lib.js} location
+@c 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">