summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_order.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-28 00:15:18 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-28 00:15:18 +0100
commit4dde5aad410c2d44e3a52d319e309b3f4127e22f (patch)
tree0a70a2fc31864904110654234c2abc2041626f0f /src/backend/taler-merchant-httpd_order.c
parent39d9832e054849ed0ce36bd1d47411af4ea0b793 (diff)
downloadmerchant-4dde5aad410c2d44e3a52d319e309b3f4127e22f.tar.gz
merchant-4dde5aad410c2d44e3a52d319e309b3f4127e22f.tar.bz2
merchant-4dde5aad410c2d44e3a52d319e309b3f4127e22f.zip
handle description field no longer being a simple string
Diffstat (limited to 'src/backend/taler-merchant-httpd_order.c')
-rw-r--r--src/backend/taler-merchant-httpd_order.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/backend/taler-merchant-httpd_order.c b/src/backend/taler-merchant-httpd_order.c
index a862178e..0c4e5c82 100644
--- a/src/backend/taler-merchant-httpd_order.c
+++ b/src/backend/taler-merchant-httpd_order.c
@@ -68,34 +68,16 @@ check_products (json_t *products)
return GNUNET_SYSERR;
}
json_array_foreach (products, index, value) {
- const char *description;
- const char *error_name;
- unsigned int error_line;
- int res;
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_string ("description", &description),
- /* FIXME: there are other fields in the product specification
- that are currently not labeled as optional. Maybe check
- those as well, or make them truly optional. */
- GNUNET_JSON_spec_end ()
- };
-
- /* extract fields we need to sign separately */
- res = GNUNET_JSON_parse (value,
- spec,
- &error_name,
- &error_line);
- if (GNUNET_OK != res)
+
+ if (NULL == json_object_get (value,
+ "description"))
{
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Product description parsing failed at #%u: %s:%u\n",
- (unsigned int) index,
- error_name,
- error_line);
+ "Product description parsing failed at product #%u\n",
+ (unsigned int) index);
return GNUNET_SYSERR;
}
- GNUNET_JSON_parse_free (spec);
}
return GNUNET_OK;
}