summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_post_transfers.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-04-23 14:40:05 +0200
committerChristian Grothoff <christian@grothoff.org>2023-04-23 14:40:05 +0200
commit4b7d9f5e19e9f28ec1163f3b6e5c00f0805e6221 (patch)
tree396b8ddf6bf4b074d85737a27cec8a58a16237cf /src/testing/testing_api_cmd_post_transfers.c
parentf8cb45f17a4bd9f9a4b68a4427ec485984703d33 (diff)
downloadmerchant-4b7d9f5e19e9f28ec1163f3b6e5c00f0805e6221.tar.gz
merchant-4b7d9f5e19e9f28ec1163f3b6e5c00f0805e6221.tar.bz2
merchant-4b7d9f5e19e9f28ec1163f3b6e5c00f0805e6221.zip
modernize POST /transfers API
Diffstat (limited to 'src/testing/testing_api_cmd_post_transfers.c')
-rw-r--r--src/testing/testing_api_cmd_post_transfers.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/testing/testing_api_cmd_post_transfers.c b/src/testing/testing_api_cmd_post_transfers.c
index 4cff2348..9a01d2d5 100644
--- a/src/testing/testing_api_cmd_post_transfers.c
+++ b/src/testing/testing_api_cmd_post_transfers.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020 Taler Systems SA
+ Copyright (C) 2020, 2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -126,48 +126,34 @@ struct PostTransfersState
* Callback for a POST /transfers operation.
*
* @param cls closure for this function
- * @param hr HTTP response details
- * @param execution_time when did the transfer happen (according to the exchange),
- * #GNUNET_TIME_UNIT_FOREVER_ABS if the transfer did not yet happen or if
- * we have no data from the exchange about it
- * @param total_amount total amount of the wire transfer, or NULL if the exchange did
- * not provide any details
- * @param wire_fee how much did the exchange charge in terms of wire fees, or NULL
- * if the exchange did not provide any details
- * @param details_length length of the @a details array
- * @param details array with details about the combined transactions
+ * @param ptr response details
*/
static void
transfers_cb (void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- struct GNUNET_TIME_Timestamp execution_time,
- const struct TALER_Amount *total_amount,
- const struct TALER_Amount *wire_fee,
- unsigned int details_length,
- const struct TALER_MERCHANT_TrackTransferDetail details[])
+ const struct TALER_MERCHANT_PostTransfersResponse *ptr)
{
struct PostTransfersState *pts = cls;
pts->pth = NULL;
- if (pts->http_status != hr->http_status)
+ if (pts->http_status != ptr->hr.http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected response code %u (%d) to command %s\n",
- hr->http_status,
- (int) hr->ec,
+ ptr->hr.http_status,
+ (int) ptr->hr.ec,
TALER_TESTING_interpreter_get_current_label (pts->is));
TALER_TESTING_interpreter_fail (pts->is);
return;
}
- switch (hr->http_status)
+ switch (ptr->hr.http_status)
{
case MHD_HTTP_OK:
{
- pts->execution_time = execution_time;
- pts->wire_fee = *wire_fee;
+ pts->execution_time = ptr->details.success.execution_time;
+ pts->wire_fee = ptr->details.success.wire_fee;
fprintf (stderr,
"FIXME");
- json_dumpf (hr->reply,
+ json_dumpf (ptr->hr.reply,
stderr,
0);
#if FIXME_WRITE_PROPPER_CHECK_OF_RETURNED_DATA_HERE
@@ -316,7 +302,7 @@ transfers_cb (void *cls,
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Unhandled HTTP status %u for POST /transfers.\n",
- hr->http_status);
+ ptr->hr.http_status);
}
TALER_TESTING_interpreter_next (pts->is);
}