taler-docs

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

commit 793c30b6e2457877c47f4bacbcfdf0c061fba6d4
parent 632e8a36eec408935e965c528196e28bff1f394a
Author: Florian Dold <florian.dold@gmail.com>
Date:   Wed, 17 Feb 2016 04:55:02 +0100

improve essay steps

Diffstat:
Mexample-essay-store.rst | 17++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/example-essay-store.rst b/example-essay-store.rst @@ -2,16 +2,18 @@ Example: Essay Store ================================== -The main page of the essay store shows links to essays of the form `/essay?name=:essayname`. +The main page of the essay store shows links to essays of the form `/essay?name=:name`. The `/essay` URL takes the following query parameters: * `name`: mandatory, name of the essay * `tid`: optional, transaction ID generated by the merchant for the contract that was used to purchase an instance of the article + * `timestamp`, optional, timestamp for the contract that was used to purchase + the essay with the given `tid`. -These are the steps for showing `/essay`. Note that checks for wallet presence are omitted, -it the wallet is not present in steps 2 and 3, the user agent should be redirected -to a mock credit card payment page. +These are the steps for showing `/essay`. If the wallet is not present in +steps 2 and 3, the user agent is be redirected to a mock credit card +payment page. 1. The server checks the status of the the essay with the name `name` in the server-side session state @@ -19,10 +21,11 @@ to a mock credit card payment page. * If the essay is marked as payed for the client, display the essay. * Otherwise proceed with step 2 -2. The server checks if the `tid` parameter is present +2. The server checks if the `tid` query parameter is present - * If `tid` is present, restore the contract to pay for the essay and - emit the `taler-execute-contract` DOM event in the user agent. + * If `tid` and `timestamp` are present, restore the contract for the essay (using `tid` as + transaction id in the contract and `timestamp` as timestamp) and emit the `taler-execute-contract` DOM + event in the user agent. * Otherwise proceed with step 3 3. The server generates a new contract and emits the `taler-confirm-contract` DOM event in the user agent,