diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-reserves.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-reserves.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-reserves.c b/src/backend/taler-merchant-httpd_private-get-reserves.c index 8b12afbe..f231a292 100644 --- a/src/backend/taler-merchant-httpd_private-get-reserves.c +++ b/src/backend/taler-merchant-httpd_private-get-reserves.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2019, 2020 Taler Systems SA + (C) 2019-2021 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software @@ -58,26 +58,23 @@ add_reserve (void *cls, GNUNET_assert (0 == json_array_append_new ( pa, - json_pack ( - "{s:o,s:o,s:o," - " s:o,s:o,s:o,s:o," - " s:b}", - "reserve_pub", - GNUNET_JSON_from_data_auto (reserve_pub), - "creation_time", - GNUNET_JSON_from_time_abs (creation_time_round), - "expiration_time", - GNUNET_JSON_from_time_abs (expiration_time_round), - "merchant_initial_amount", - TALER_JSON_from_amount (merchant_initial_amount), - "exchange_initial_amount", - TALER_JSON_from_amount (exchange_initial_amount), - "pickup_amount", - TALER_JSON_from_amount (pickup_amount), - "committed_amount", - TALER_JSON_from_amount (committed_amount), - "active", - active))); + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_data_auto ("reserve_pub", + reserve_pub), + GNUNET_JSON_pack_time_abs ("creation_time", + creation_time_round), + GNUNET_JSON_pack_time_abs ("expiration_time", + expiration_time_round), + TALER_JSON_pack_amount ("merchant_initial_amount", + merchant_initial_amount), + TALER_JSON_pack_amount ("exchange_initial_amount", + exchange_initial_amount), + TALER_JSON_pack_amount ("pickup_amount", + pickup_amount), + TALER_JSON_pack_amount ("committed_amount", + committed_amount), + GNUNET_JSON_pack_bool ("active", + active)))); } @@ -140,10 +137,11 @@ TMH_private_get_reserves (const struct TMH_RequestHandler *rh, TALER_EC_GENERIC_DB_FETCH_FAILED, "reserves"); } - return TALER_MHD_reply_json_pack (connection, - MHD_HTTP_OK, - "{s:o}", - "reserves", ra); + return TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_array_steal ("reserves", + ra)); } |