gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: dd 51 work


From: gnunet
Subject: [taler-merchant] branch master updated: dd 51 work
Date: Sun, 08 Oct 2023 22:51:55 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 116904c7 dd 51 work
116904c7 is described below

commit 116904c7ff6b7b9972c5c77080e0bf7cd9240217
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Oct 8 22:51:51 2023 +0200

    dd 51 work
---
 src/backend/taler-merchant-httpd.c        | 20 ++++++++++++++++++++
 src/backend/taler-merchant-httpd.h        | 10 ++++++++++
 src/backend/taler-merchant-httpd_config.c | 15 +++++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index 00d49b70..dd6e5a07 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -146,6 +146,16 @@ struct GNUNET_CONTAINER_MultiHashMap *TMH_by_id_map;
  */
 struct GNUNET_TIME_Relative TMH_legal_expiration;
 
+/**
+ * Length of the TMH_cspecs array.
+ */
+unsigned int TMH_num_cspecs;
+
+/**
+ * Rendering specs for currencies.
+ */ 
+struct TALER_CurrencySpecification *TMH_cspecs;
+
 /**
  * The port we are running on
  */
@@ -2161,6 +2171,16 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
+
+  if (GNUNET_OK !=
+      TALER_CONFIG_parse_currencies (cfg,
+                                     &TMH_num_cspecs,
+                                     &TMH_cspecs))
+  {
+    GNUNET_SCHEDULER_shutdown ();
+    return;
+  }
+  
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_time (cfg,
                                            "merchant",
diff --git a/src/backend/taler-merchant-httpd.h 
b/src/backend/taler-merchant-httpd.h
index eaeef55e..3f34557e 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -671,6 +671,16 @@ struct TMH_SuspendedConnection
  */
 extern char *TMH_currency;
 
+/**
+ * Length of the TMH_cspecs array.
+ */
+extern unsigned int TMH_num_cspecs;
+
+/**
+ * Rendering specs for currencies.
+ */ 
+extern struct TALER_CurrencySpecification *TMH_cspecs;
+
 /**
  * Inform the auditor for all deposit confirmations (global option)
  */
diff --git a/src/backend/taler-merchant-httpd_config.c 
b/src/backend/taler-merchant-httpd_config.c
index c398fc28..461aeb06 100644
--- a/src/backend/taler-merchant-httpd_config.c
+++ b/src/backend/taler-merchant-httpd_config.c
@@ -56,9 +56,24 @@ MH_handler_config (struct TMH_RequestHandler *rh,
   (void) hc;
   if (NULL == response)
   {
+    json_t *specs = json_object ();
+
+    GNUNET_assert (NULL != specs);
+    for (unsigned int i=0;i<TMH_num_cspecs;i++)
+    {
+      const struct TALER_CurrencySpecification *cspec = &TMH_cspecs[i];
+
+      /* FIXME: filter by currencies with configured exchange? */
+      GNUNET_assert (0 ==
+                     json_object_set_new (specs,
+                                          cspec->currency,
+                                          TALER_CONFIG_currency_specs_to_json 
(cspec)));
+    }
     response = TALER_MHD_MAKE_JSON_PACK (
       GNUNET_JSON_pack_string ("currency",
                                TMH_currency),
+      GNUNET_JSON_pack_object_steal ("currencies",
+                                     specs),
       GNUNET_JSON_pack_string ("name",
                                "taler-merchant"),
       GNUNET_JSON_pack_string ("version",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]