diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-17 04:55:02 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-17 04:55:02 +0100 |
commit | 793c30b6e2457877c47f4bacbcfdf0c061fba6d4 (patch) | |
tree | 58e0e769583c72b1ea8033859a04eead9c22ece3 | |
parent | 632e8a36eec408935e965c528196e28bff1f394a (diff) | |
download | docs-793c30b6e2457877c47f4bacbcfdf0c061fba6d4.tar.gz docs-793c30b6e2457877c47f4bacbcfdf0c061fba6d4.tar.bz2 docs-793c30b6e2457877c47f4bacbcfdf0c061fba6d4.zip |
improve essay steps
-rw-r--r-- | example-essay-store.rst | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/example-essay-store.rst b/example-essay-store.rst index 4b1eeeae..3629bc21 100644 --- 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, |