diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_responses.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_responses.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/backend/taler-merchant-httpd_responses.c b/src/backend/taler-merchant-httpd_responses.c index 8cbdf6b0..1ea2600e 100644 --- a/src/backend/taler-merchant-httpd_responses.c +++ b/src/backend/taler-merchant-httpd_responses.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014, 2015, 2016 GNUnet e.V. + Copyright (C) 2014-2017 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software @@ -395,52 +395,4 @@ TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection, } -/** - * Generate /track/transaction response. - * - * @param num_transfers how many wire transfers make up the transaction - * @param transfers data on each wire transfer - * @param exchange_uri URI of the exchange that made the transfer - * @return MHD response object - */ -struct MHD_Response * -TMH_RESPONSE_make_track_transaction_ok (unsigned int num_transfers, - const struct TALER_MERCHANT_TransactionWireTransfer *transfers, - const char *exchange_uri) -{ - struct MHD_Response *ret; - unsigned int i; - json_t *j_transfers; - struct TALER_Amount sum; - - j_transfers = json_array (); - for (i=0;i<num_transfers;i++) - { - const struct TALER_MERCHANT_TransactionWireTransfer *transfer = &transfers[i]; - unsigned int j; - - sum = transfer->coins[0].amount_with_fee; - for (j=1;j<transfer->num_coins;j++) - { - const struct TALER_MERCHANT_CoinWireTransfer *coin = &transfer->coins[j]; - - GNUNET_assert (GNUNET_SYSERR != TALER_amount_add (&sum, - &sum, - &coin->amount_with_fee)); - } - - GNUNET_assert (0 == - json_array_append_new (j_transfers, - json_pack ("{s:s, s:o, s:o, s:o}", - "exchange", exchange_uri, - "wtid", GNUNET_JSON_from_data_auto (&transfer->wtid), - "execution_time", GNUNET_JSON_from_time_abs (transfer->execution_time), - "amount", TALER_JSON_from_amount (&sum)))); - } - ret = TMH_RESPONSE_make_json (j_transfers); - json_decref (j_transfers); - return ret; -} - - /* end of taler-exchange-httpd_responses.c */ |