summaryrefslogtreecommitdiff
path: root/integration-merchant.rst
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-01-21 09:00:47 +0100
committerChristian Grothoff <christian@grothoff.org>2016-01-21 09:00:47 +0100
commitc4368446d4d2e30aba1a202adcc88f427036fb87 (patch)
treeb0c2687e973e6b1f18de39daaf06ae6ac8cb03e9 /integration-merchant.rst
parentade16c67bab3257b594051923431cc2b953aaa69 (diff)
parent38d91ef3494d97479d3d796ac54ae86c48b4be42 (diff)
downloaddocs-c4368446d4d2e30aba1a202adcc88f427036fb87.tar.gz
docs-c4368446d4d2e30aba1a202adcc88f427036fb87.tar.bz2
docs-c4368446d4d2e30aba1a202adcc88f427036fb87.zip
resolving merge
Diffstat (limited to 'integration-merchant.rst')
-rw-r--r--integration-merchant.rst46
1 files changed, 44 insertions, 2 deletions
diff --git a/integration-merchant.rst b/integration-merchant.rst
index 9357b809..577f4d5f 100644
--- a/integration-merchant.rst
+++ b/integration-merchant.rst
@@ -2,7 +2,49 @@
Interaction with merchant websites
==================================
-This section defines the protocol between the wallet
-and the merchant page.
+-------------
+Purchase Flow
+-------------
+The purchase flow consists of the following steps:
+1. UA visits merchant's checkout page
+2. The merchant's checkout page notifies the wallet
+ of the contract (``taler-deliver-contract``).
+3. The user reviews the contract inside the wallet
+4. The wallet directs the UA to the payment execution page
+5. The execution page must send the event ``taler-execute-payment`` with
+ the contract hash of the payment to be executed.
+6. The wallet executes the payment in the domain context of the
+ execution page and emits the ``taler-payment-result`` event
+ on the execution page.
+7. The execution page reacts to the payment result (which
+ is either successful or unsuccessful) by showing
+ an appropriate response to the user.
+
+----------------
+Event Reference
+----------------
+
+.. topic:: ``taler-deliver-contract``
+
+ The event takes an :ref:`offer <offer>` as event detail.
+
+.. topic:: ``taler-execute-payment``
+
+ The event takes `H_contract` of a :ref:`Contract <tsref-type-Contract>` as event detail.
+
+.. topic:: ``taler-payment-result``
+
+ The event takes the following object as event detail:
+
+ .. code-block:: tsref
+
+ {
+ // was the payment successful?
+ success: boolean;
+
+ // human-readable indication of what went wrong
+ hint: string;
+ }
+