gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 03/03: include locations and proper labels


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 03/03: include locations and proper labels in proposal
Date: Wed, 17 Jan 2018 23:07:49 +0100

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

dold pushed a commit to branch master
in repository merchant.

commit 4d6a5918bb0ee07068ddf2510d4fcaa89ddc9bd5
Author: Florian Dold <address@hidden>
AuthorDate: Wed Jan 17 23:07:39 2018 +0100

    include locations and proper labels in proposal
---
 src/backend/taler-merchant-httpd_proposal.c | 39 +++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_proposal.c 
b/src/backend/taler-merchant-httpd_proposal.c
index 61da3b3..f7be8b0 100644
--- a/src/backend/taler-merchant-httpd_proposal.c
+++ b/src/backend/taler-merchant-httpd_proposal.c
@@ -311,6 +311,9 @@ proposal_put (struct MHD_Connection *connection,
     // the backend the "instance" name and lets it fill out.
     struct MerchantInstance *mi = TMH_lookup_instance (instance);
     json_t *merchant;
+    json_t *locations;
+    json_t *loc;
+    char *label;
 
     if (NULL == mi)
     {
@@ -329,15 +332,47 @@ proposal_put (struct MHD_Connection *connection,
                          json_string (mi->name));
     json_object_set_new (merchant,
                          "jurisdiction",
-                         json_string ("none"));
+                         json_string ("_mj"));
     json_object_set_new (merchant,
                          "address",
-                         json_string ("none"));
+                         json_string ("_ma"));
     json_object_set_new (order,
                          "merchant",
                          merchant);
     json_object_del (order,
                      "instance");
+
+    locations = json_object_get (order,
+                                 "locations");
+    if (NULL == locations)
+    {
+      locations = json_object ();
+      json_object_set_new (order,
+                           "locations",
+                           locations);
+    }
+
+    GNUNET_assert (0 < GNUNET_asprintf (&label,
+                                        "merchant-location-%s-address",
+                                        mi->id));
+    loc = json_object_get (default_locations, label);
+    if (NULL == loc)
+      loc = json_object ();
+    else
+      loc = json_deep_copy (loc);
+    json_object_set_new (locations, "_ma", loc);
+    GNUNET_free (label);
+
+    GNUNET_assert (0 < GNUNET_asprintf (&label,
+                                        "merchant-location-%s-jurisdiction",
+                                        mi->id));
+    loc = json_object_get (default_locations, label);
+    if (NULL == loc)
+      loc = json_object ();
+    else
+      loc = json_deep_copy (loc);
+    json_object_set_new (locations, "_mj", loc);
+    GNUNET_free (label);
   }
 
   /* extract fields we need to sign separately */

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



reply via email to

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