From 3e6e6feb9e17f8511f3422ce79917bb2f1677d59 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Sep 2020 00:57:20 +0200 Subject: inline locations as per#6566 --- .../taler-merchant-httpd_private-post-orders.c | 38 ++++------------------ 1 file changed, 7 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c index fd9c8ce3..05bbadec 100644 --- a/src/backend/taler-merchant-httpd_private-post-orders.c +++ b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -775,9 +775,6 @@ patch_order (struct MHD_Connection *connection, } else { - const char *mj = NULL; - const char *ma = NULL; - json_t *locations; json_t *jmerchant; jmerchant = json_object (); @@ -790,55 +787,34 @@ patch_order (struct MHD_Connection *connection, json_object_set_new (jmerchant, "instance", json_string (settings->id))); - locations = json_object_get (order, - "locations"); - if (NULL != locations) { json_t *loca; - json_t *locj; /* Handle merchant address */ loca = settings->address; if (NULL != loca) { loca = json_deep_copy (loca); - ma = STANDARD_LABEL_MERCHANT_ADDRESS; - GNUNET_assert (0 == - json_object_set_new (locations, - ma, - loca)); GNUNET_assert (0 == json_object_set_new (jmerchant, "address", - json_string (ma))); + loca)); } + } + { + json_t *locj; /* Handle merchant jurisdiction */ locj = settings->jurisdiction; if (NULL != locj) { - if ( (NULL != loca) && - (1 == json_equal (locj, - loca)) ) - { - /* addresses equal, re-use */ - mj = ma; - } - else - { - locj = json_deep_copy (locj); - mj = STANDARD_LABEL_MERCHANT_JURISDICTION; - GNUNET_assert (0 == - json_object_set_new (locations, - mj, - locj)); - } + locj = json_deep_copy (locj); GNUNET_assert (0 == json_object_set_new (jmerchant, "jurisdiction", - json_string (mj))); + locj)); } - } /* have locations */ + } GNUNET_assert (0 == json_object_set_new (order, "merchant", -- cgit v1.2.3