[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: json_pack'ing data
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: json_pack'ing data returned by /history. |
Date: |
Sat, 25 Feb 2017 22:02:44 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 5b8db59 json_pack'ing data returned by /history.
5b8db59 is described below
commit 5b8db592ecf5409fe7682df7891703b95bfa3de9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Feb 25 22:01:55 2017 +0100
json_pack'ing data returned by /history.
---
src/backend/taler-merchant-httpd_history.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_history.c
b/src/backend/taler-merchant-httpd_history.c
index 7af8c55..79dd179 100644
--- a/src/backend/taler-merchant-httpd_history.c
+++ b/src/backend/taler-merchant-httpd_history.c
@@ -45,14 +45,23 @@ pd_cb (void *cls,
{
json_t *response = cls;
json_t *entry;
+ json_t *amount;
+ json_t *timestamp;
+ GNUNET_assert (NULL != (amount = json_object_get (proposal_data, "amount")));
+ GNUNET_assert (NULL != (timestamp = json_object_get (proposal_data,
"timestamp")));
- /*FIXME: more details to be returned*/
GNUNET_break (NULL !=
- (entry = json_pack ("{s:s}",
- "order_id", order_id)));
+ (entry = json_pack ("{s:s, s:o, s:s}",
+ "order_id", order_id,
+ "amount", amount,
+ "timestamp", json_string_value
(timestamp))));
- GNUNET_break (0 == json_array_append (response, entry));
+ GNUNET_break (0 == json_array_append_new (response, entry));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "growing history data: %s\nptr: %p\n",
+ json_dumps (response, JSON_INDENT (1)),
+ response);
}
/**
@@ -124,6 +133,10 @@ MH_handler_history (struct TMH_RequestHandler *rh,
TALER_EC_HISTORY_DB_FETCH_ERROR,
"db error to get history");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "history data: %s\n",
+ json_dumps (response, JSON_INDENT (1)));
+
return TMH_RESPONSE_reply_json (connection,
response,
MHD_HTTP_OK);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: json_pack'ing data returned by /history.,
gnunet <=