merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 4dde5aad410c2d44e3a52d319e309b3f4127e22f
parent 39d9832e054849ed0ce36bd1d47411af4ea0b793
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 28 Feb 2020 00:15:18 +0100

handle description field no longer being a simple string

Diffstat:
Msrc/backend/taler-merchant-httpd_order.c | 28+++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)

diff --git 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; }