gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] tag demo-2019-08-31-00 updated (4b47e46 ->


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] tag demo-2019-08-31-00 updated (4b47e46 -> 7a1a7b5)
Date: Sun, 01 Sep 2019 22:47:09 +0200

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

dold pushed a change to tag demo-2019-08-31-00
in repository merchant.

*** WARNING: tag demo-2019-08-31-00 was modified! ***

    from 4b47e46  (commit)
      to 7a1a7b5  (commit)
    from 4b47e46  subtract refund after checking for fee coverage
     add c908949  gitignore
     add 50583b7  wrap array in JSON object
     add 7a1a7b5  teach config about instances

No new revisions were added by this update.

Summary of changes:
 .gitignore                                 |  1 +
 src/backend/taler-merchant-httpd_config.c  | 17 ++++++++++++++++-
 src/backend/taler-merchant-httpd_history.c |  7 ++++---
 src/lib/testing_api_cmd_history.c          |  7 ++++---
 4 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 936fed3..3662173 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@ INSTALL
 GPATH
 GRTAGS
 GTAGS
+tags
 *.swp
 src/backend/taler-merchant-httpd
 src/merchant-tools/taler-merchant-dbinit
diff --git a/src/backend/taler-merchant-httpd_config.c 
b/src/backend/taler-merchant-httpd_config.c
index 931270f..51d4472 100644
--- a/src/backend/taler-merchant-httpd_config.c
+++ b/src/backend/taler-merchant-httpd_config.c
@@ -49,12 +49,27 @@ MH_handler_config (struct TMH_RequestHandler *rh,
                    size_t *upload_data_size)
 {
   int ret;
+  const char *instance_str;
+  struct MerchantInstance *mi;
+
+  instance_str = MHD_lookup_connection_value (connection,
+                                              MHD_GET_ARGUMENT_KIND,
+                                              "instance");
+  if (NULL == instance_str)
+    instance_str = "default";
+
+  mi = TMH_lookup_instance (instance_str);
+
+  if (NULL == mi)
+    return TMH_RESPONSE_reply_bad_request (connection,
+                                           
TALER_EC_CHECK_PAYMENT_INSTANCE_UNKNOWN,
+                                           "merchant instance unknown");
+
   ret = TMH_RESPONSE_reply_json_pack (connection,
                                       MHD_HTTP_OK,
                                       "{s:s}",
                                       "currency", TMH_currency);
 
-
   return ret;
 }
 
diff --git a/src/backend/taler-merchant-httpd_history.c 
b/src/backend/taler-merchant-httpd_history.c
index 73236cb..c9674e8 100644
--- a/src/backend/taler-merchant-httpd_history.c
+++ b/src/backend/taler-merchant-httpd_history.c
@@ -291,9 +291,10 @@ MH_handler_history (struct TMH_RequestHandler *rh,
                                              TALER_EC_HISTORY_DB_FETCH_ERROR,
                                              "db error to get history");
   }
-  ret = TMH_RESPONSE_reply_json (connection,
-                                 response,
-                                 MHD_HTTP_OK);
+  ret = TMH_RESPONSE_reply_json_pack (connection, MHD_HTTP_OK,
+                                      "{ s:o }",
+                                      "history",
+                                      response);
   LOG_INFO ("/history, http code: %d\n",
             MHD_HTTP_OK);
   json_decref (response);
diff --git a/src/lib/testing_api_cmd_history.c 
b/src/lib/testing_api_cmd_history.c
index 68c1e25..c979268 100644
--- a/src/lib/testing_api_cmd_history.c
+++ b/src/lib/testing_api_cmd_history.c
@@ -164,10 +164,10 @@ history_cb (void *cls,
   unsigned int nresult;
   struct GNUNET_TIME_Absolute last_timestamp;
   struct GNUNET_TIME_Absolute entry_timestamp;
+  json_t *arr;
 
   hs->ho = NULL;
 
-
   if (hs->http_status != http_status)
       TALER_TESTING_FAIL (hs->is);
 
@@ -179,7 +179,8 @@ history_cb (void *cls,
     return;
   }
 
-  nresult = json_array_size (json);
+  arr = json_object_get (json, "history");
+  nresult = json_array_size (arr);
   if (hs->nresult != nresult)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -196,7 +197,7 @@ history_cb (void *cls,
   {
     json_t *entry;
     size_t index;
-    json_array_foreach (json, index, entry)
+    json_array_foreach (arr, index, entry)
     {
       json_t *timestamp;
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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