aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-03-23 11:34:24 +0100
committerChristian Grothoff <christian@grothoff.org>2016-03-23 11:34:24 +0100
commitac950fbe61defd6d451d4e5096a877e4af016590 (patch)
treedf38b200534e110e1d935916b34ea4152a56222d
parent7f7ac5d92c6e29b80ec2055f2023657d330ffd1c (diff)
switch to wid to comply with spec
-rw-r--r--src/bank-lib/Makefile.am3
-rw-r--r--src/bank-lib/bank_api_admin.c5
-rw-r--r--src/bank-lib/test_bank_api.c12
-rw-r--r--src/include/taler_bank_service.h5
4 files changed, 20 insertions, 5 deletions
diff --git a/src/bank-lib/Makefile.am b/src/bank-lib/Makefile.am
index 4cf3472ec..58b1c67d5 100644
--- a/src/bank-lib/Makefile.am
+++ b/src/bank-lib/Makefile.am
@@ -43,4 +43,5 @@ test_bank_api_SOURCES = \
test_bank_api_LDADD = \
libtalerbank.la \
$(top_builddir)/src/util/libtalerutil.la \
- -lgnunetutil
+ -lgnunetutil \
+ -ljansson
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index 443f24a8a..515181a80 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -135,7 +135,8 @@ handle_admin_add_incoming_finished (void *cls,
break;
}
aai->cb (aai->cb_cls,
- response_code);
+ response_code,
+ json);
json_decref (json);
TALER_BANK_admin_add_incoming_cancel (aai);
}
@@ -174,7 +175,7 @@ TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank,
admin_obj = json_pack ("{s:o, s:o,"
" s:I, s:I}",
- "wtid", GNUNET_JSON_from_data (wtid,
+ "wid", GNUNET_JSON_from_data (wtid,
sizeof (*wtid)),
"amount", TALER_JSON_from_amount (amount),
"debit_account", (json_int_t) debit_account_no,
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index 232900f20..127c271d5 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -246,10 +246,12 @@ interpreter_run (void *cls,
* @param cls closure with the interpreter state
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
* 0 if the bank's reply is bogus (fails to follow the protocol)
+ * @param json detailed response from the HTTPD, or NULL if reply was not in JSON
*/
static void
add_incoming_cb (void *cls,
- unsigned int http_status)
+ unsigned int http_status,
+ json_t *json)
{
struct InterpreterState *is = cls;
struct Command *cmd = &is->commands[is->ip];
@@ -258,6 +260,14 @@ add_incoming_cb (void *cls,
if (cmd->expected_response_code != http_status)
{
GNUNET_break (0);
+ if (NULL != json)
+ {
+ fprintf (stderr,
+ "Unexpected response code %u:\n",
+ http_status);
+ json_dumpf (json, stderr, 0);
+ fprintf (stderr, "\n");
+ }
fail (is);
return;
}
diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h
index 508ca714b..920ae47fd 100644
--- a/src/include/taler_bank_service.h
+++ b/src/include/taler_bank_service.h
@@ -22,6 +22,7 @@
#ifndef _TALER_BANK_SERVICE_H
#define _TALER_BANK_SERVICE_H
+#include <jansson.h>
#include "taler_util.h"
/* ********************* event loop *********************** */
@@ -117,10 +118,12 @@ struct TALER_BANK_AdminAddIncomingHandle;
* @param cls closure
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request
* 0 if the bank's reply is bogus (fails to follow the protocol)
+ * @param json detailed response from the HTTPD, or NULL if reply was not in JSON
*/
typedef void
(*TALER_BANK_AdminAddIncomingResultCallback) (void *cls,
- unsigned int http_status);
+ unsigned int http_status,
+ json_t *json);
/**