taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 814c7c5d6aaffd25b6fd54c34d1fd10fd23a1ab4
parent a54d7e20309042ddd7c247cb4c2f0255bb1b3baa
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Thu, 15 Dec 2016 22:35:55 +0100

10% blog example fulfillment

Diffstat:
Mexample-essay-store.rst | 32++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/example-essay-store.rst b/example-essay-store.rst @@ -222,12 +222,40 @@ is required to create the proposition. Both ``make_contract`` and ``sign_contract`` are defined in ``talerfrontends/blog/helpers.py``. +At this point, the user can accept the contract, which triggers the wallet +to visit the fulfillment page. The main logic for a fulfillment page handler +is to (1) return the claimed product, if it has been paid, or (2) instruct the +wallet to send the payment. + +.. + - TODO Document fulfillment URL layout. + - Mention handler function's name. + - Mention filename where the handler is located. + - Say 'somehow' that this handler is the same from + the offer URL. + +The state accounts for a product being paid or not, so the fulfillment handler +will firstly check that: + +.. sourcecode:: python + + +def article(name, data=None): + # Get list of payed articles from the state + payed_articles = session.get("payed_articles", []) + + if name in payed_articles: + ... + return send_file(get_article_file(article)) + + + + + .. Fundamental steps: - - How 402 HTTP headers are set in each step. - - How OTOH JavaScript accomplishes the same. - How the handler detects offer vs fulfillment. To mention: