summaryrefslogtreecommitdiff
path: root/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditor/taler-auditor-httpd_deposit-confirmation-get.c')
-rw-r--r--src/auditor/taler-auditor-httpd_deposit-confirmation-get.c64
1 files changed, 62 insertions, 2 deletions
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c
index 33e3c7db7..c51638b74 100644
--- a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c
+++ b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c
@@ -137,10 +137,70 @@ TAH_DEPOSIT_CONFIRMATION_handler_get (struct TAH_RequestHandler *rh,
}
ja = json_array ();
GNUNET_break (NULL != ja);
- // TODO correct below
+
+ uint64_t row_id = 0;
+
+ struct TALER_AUDITORDB_DepositConfirmation dc = {
+ .exchange_timestamp = GNUNET_TIME_UNIT_ZERO_TS,
+ .refund_deadline = GNUNET_TIME_UNIT_ZERO_TS,
+ .wire_deadline = GNUNET_TIME_UNIT_ZERO_TS
+ };
+
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_uint64 ("row_id",
+ &row_id),
+/*
+ GNUNET_JSON_spec_timestamp("exchange_timestamp",
+ &dc.exchange_timestamp),
+ GNUNET_JSON_spec_timestamp("refund_deadline",
+ &dc.refund_deadline),
+ GNUNET_JSON_spec_timestamp("wire_deadline",
+ &dc.wire_deadline),
+
+ TALER_JSON_spec_amount("amount_without_fee",
+ TAH_currency,
+ &dc.total_without_fee),
+*/
+ GNUNET_JSON_spec_end ()
+ };
+
+
+ // read the input json
+ json_t *json_in;
+ {
+ enum GNUNET_GenericReturnValue res;
+
+ res = TALER_MHD_parse_post_json (connection,
+ connection_cls,
+ upload_data,
+ upload_data_size,
+ &json_in);
+ if (GNUNET_SYSERR == res)
+ return MHD_NO;
+ if ((GNUNET_NO == res) ||
+ (NULL == json_in))
+ return MHD_YES;
+ res = TALER_MHD_parse_json_data (connection,
+ json_in,
+ spec);
+ if (GNUNET_SYSERR == res)
+ {
+ json_decref (json_in);
+ return MHD_NO; /* hard failure */
+ }
+ if (GNUNET_NO == res)
+ {
+ json_decref (json_in);
+ return MHD_YES; /* failure */
+ }
+ }
+
+ printf ("row_id from json: %lu\n", row_id);
+
+
qs = TAH_plugin->get_deposit_confirmations (
TAH_plugin->cls,
- 0, /* FIXME: get from query parameters! */
+ row_id,
false, /* FIXME: get from query parameters! */
&add_deposit_confirmation,
ja);