summaryrefslogtreecommitdiff
path: root/php/doc/inline-proposals.texi
blob: 3613e9a8876c93c06899a55f6556774f3dfa53d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@node Inlining proposals in HTTP headers
@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 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-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.

@smallexample
// ../inline.php
@verbatiminclude ../inline.php
@end smallexample

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.