diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_history.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_history.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c index 2ed9c8cc..25e3b036 100644 --- a/src/backend/taler-merchant-httpd_history.c +++ b/src/backend/taler-merchant-httpd_history.c @@ -63,17 +63,27 @@ pd_cb (void *cls, json_t *entry; json_t *amount; json_t *timestamp; + json_t *instance; - GNUNET_assert (NULL != (amount = json_copy (json_object_get (proposal_data, "amount")))); - GNUNET_assert (NULL != (timestamp = json_object_get (proposal_data, "timestamp"))); + GNUNET_assert (-1 != json_unpack (proposal_data, + "{s:o, s:o, s:{s:o}}", + "amount", &amount, + "timestamp", ×tamp, + "merchant", "instance", &instance)); if (current >= start && current < start + delta) { - GNUNET_break (NULL != (entry = json_pack ("{s:s, s:o, s:s}", + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Adding history element. Current: %d, start: %d, delta: %d\n", + current, + start, + delta); + GNUNET_break (NULL != (entry = json_pack ("{s:s, s:o, s:s, s:s}", "order_id", order_id, "amount", amount, - "timestamp", json_string_value (timestamp)))); + "timestamp", json_string_value (timestamp), + "instance", json_string_value (instance)))); GNUNET_break (0 == json_array_append_new (response, entry)); |