summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-09-05 00:57:20 +0200
committerChristian Grothoff <christian@grothoff.org>2020-09-05 00:57:20 +0200
commit3e6e6feb9e17f8511f3422ce79917bb2f1677d59 (patch)
tree2e42e4d8b09369b65b33b7ff63f64b3e9ac05efe /src
parent015420396dcad3d015668e055725f22e7f968f54 (diff)
downloadmerchant-3e6e6feb9e17f8511f3422ce79917bb2f1677d59.tar.gz
merchant-3e6e6feb9e17f8511f3422ce79917bb2f1677d59.tar.bz2
merchant-3e6e6feb9e17f8511f3422ce79917bb2f1677d59.zip
inline locations as per#6566
Diffstat (limited to 'src')
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c38
1 files changed, 7 insertions, 31 deletions
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",