commit 86be2dcc9e8e1a448ef9b7b87b4c75670a470d38
parent e4cefaa553fb5a892b9b3e8a26836bea01a56642
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 9 Sep 2024 17:50:04 +0200
use sandbox instance
Diffstat:
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/taler-merchant-api-tutorial.rst b/taler-merchant-api-tutorial.rst
@@ -123,14 +123,14 @@ Public Sandbox Backend and Authentication
How the frontend authenticates to the Taler backend depends on the
configuration. See :doc:`taler-merchant-manual`.
-The public sandbox backend https://backend.demo.taler.net/ uses an API
-key in the ``Authorization`` header. The value of this header must be
-``Bearer secret-token:sandbox`` for the public sandbox backend.
+The public sandbox backend https://backend.demo.taler.net/instances/sandbox/
+uses an API key in the ``Authorization`` header. The value of this header must
+be ``Bearer secret-token:sandbox`` for the public sandbox backend.
.. code-block:: python
>>> import requests
- >>> requests.get("https://backend.demo.taler.net/private/orders",
+ >>> requests.get("https://backend.demo.taler.net/instances/sandbox/private/orders",
... headers={"Authorization": "Bearer secret-token:sandbox"})
<Response [200]>
@@ -138,9 +138,9 @@ If an HTTP status code other than 200 is returned, something went wrong.
You should figure out what the problem is before continuing with this
tutorial.
-The sandbox backend https://backend.demo.taler.net/ uses ``KUDOS`` as an
-imaginary currency. Coins denominated in ``KUDOS`` can be withdrawn from
-https://bank.demo.taler.net/.
+The sandbox backend https://backend.demo.taler.net/instances/sandbox/ uses
+``KUDOS`` as an imaginary currency. Coins denominated in ``KUDOS`` can be
+withdrawn from https://bank.demo.taler.net/.
.. index:: instance
@@ -164,6 +164,8 @@ https://backend.demo.taler.net/:
- ``default`` (Kudos Inc.), reachable at https://backend.demo.taler.net/
+- ``sandbox`` (for testing.), reachable at https://backend.demo.taler.net/instances/sandbox/
+
.. Note:: These are fictional merchants used for our demonstrators and
not affiliated with or officially approved by the respective projects.
@@ -224,7 +226,7 @@ A minimal Python snippet for creating an order would look like this:
... summary="Donation",
... fulfillment_url="https://example.com/thanks.html"),
... create_token=False)
- >>> response = requests.post("https://backend.demo.taler.net/private/orders",
+ >>> response = requests.post("https://backend.demo.taler.net/instances/sandbox/private/orders",
... json=body,
... headers={"Authorization": "Bearer secret-token:sandbox"})
<Response [200]>
@@ -285,7 +287,7 @@ backend to do it is the safest method.
.. code-block:: python
>>> import requests
- >>> r = requests.get("https://backend.demo.taler.net/private/orders/" + order_id,
+ >>> r = requests.get("https://backend.demo.taler.net/instances/sandbox/private/orders/" + order_id,
... headers={"Authorization": "Bearer secret-token:sandbox"})
>>> print(r.json())
@@ -352,7 +354,7 @@ This code snipped illustrates giving a refund:
>>> import requests
>>> refund_req = dict(refund="KUDOS:10",
... reason="Customer did not like the product")
- >>> requests.post("https://backend.demo.taler.net/private/orders/"
+ >>> requests.post("https://backend.demo.taler.net/instances/sandbox/private/orders/"
... + order_id + "/refund", json=refund_req,
... headers={"Authorization": "Bearer secret-token:sandbox"})
<Response [200]>