merchant

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

commit c39475097bcd8382cb04ad80115167c65a613d54
parent 2632993fa90336bcc7c071d171f11959a0a16517
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Wed,  1 Mar 2017 21:24:42 +0100

Including instance within history elements.

Diffstat:
Msrc/backend/taler-merchant-httpd_history.c | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git 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", &timestamp, + "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));