summaryrefslogtreecommitdiff
path: root/taler-merchant-api-tutorial.rst
diff options
context:
space:
mode:
Diffstat (limited to 'taler-merchant-api-tutorial.rst')
-rw-r--r--taler-merchant-api-tutorial.rst75
1 files changed, 6 insertions, 69 deletions
diff --git a/taler-merchant-api-tutorial.rst b/taler-merchant-api-tutorial.rst
index 739cf07f..15e21e21 100644
--- a/taler-merchant-api-tutorial.rst
+++ b/taler-merchant-api-tutorial.rst
@@ -19,8 +19,12 @@
.. _merchant-api-tutorial:
-GNU Taler Merchant API Tutorial
-###############################
+Merchant API Tutorial
+#####################
+
+.. contents:: Table of Contents
+ :depth: 2
+ :local:
Introduction
============
@@ -63,10 +67,6 @@ If you want to look at some simple, running examples, check out these:
that accepts donations for software projects and gives donation
receipts.
-- The
- `survey <https://git.taler.net/taler-merchant-demos.git/tree/talermerchantdemos/survey>`__
- that gives users who answer a question a small reward.
-
- The `WooCommerce plugin <https://git.taler.net/gnu-taler-payment-for-woocommerce.git/>`__
which is a comprehensive integration into a Web shop including the refund business
process.
@@ -413,69 +413,6 @@ considered to identify a resource you can pay for and thus do not have to be
unique.
-.. _Giving-Customers-Rewards:
-.. index:: rewards
-
-Giving Customers Rewards
-========================
-
-GNU Taler allows Web sites to grant digital cash directly to a visitor. The
-idea is that some sites may want incentivize actions such as filling out a
-survey or trying a new feature. It is important to note that receiving rewards is
-not enforceable for the visitor, as there is no contract. It is simply a
-voluntary gesture of appreciation of the site to its visitor. However, once a
-reward has been granted, the visitor obtains full control over the funds provided
-by the site.
-
-The merchant backend of the site must be properly configured for rewards, and
-sufficient funds must be made available for rewards. See the :ref:`Taler User
-Guide <Rewarding-visitors>` for details.
-
-To check if rewards are configured properly and if there are sufficient
-funds available for granting rewards, query the ``/private/reserves`` endpoint:
-
-.. code-block:: python
-
- >>> import requests
- >>> requests.get("https://backend.demo.taler.net/private/reserves",
- ... headers={"Authorization": "Bearer secret-token:sandbox"})
- <Response [200]>
-
-Check that a reserve exists where the ``merchant_initial_amount`` is below the
-``committed_amount`` and that the reserve is ``active``.
-
-.. _authorize-reward:
-
-To authorize a reward, ``POST`` to ``/private/rewards``. The following fields
-are recognized in the JSON request object:
-
-- ``amount``: Amount that should be given to the visitor as a reward.
-
-- ``justification``: Description of why the reward was granted. Human-readable
- text not exposed to the customer, but used by the Back Office.
-
-- ``next_url``: The URL that the user’s browser should be redirected to by
- the wallet, once the reward has been processed.
-
-The response from the backend contains a ``taler_reward_url``. The
-customer’s browser must be redirected to this URL for the wallet to pick
-up the reward.
-
-.. _pick-up-reward:
-
-This code snipped illustrates giving a reward:
-
-.. code-block:: python
-
- >>> import requests
- >>> reward_req = dict(amount="KUDOS:0.5",
- ... justification="User filled out survey",
- ... next_url="https://merchant.com/thanks.html")
- >>> requests.post("https://backend.demo.taler.net/private/rewards", json=reward_req,
- ... headers={"Authorization": "Bearer secret-token:sandbox"})
- <Response [200]>
-
-
.. _Advanced-topics:
Advanced topics