move reply_transfer_pending to where it belongs
This commit is contained in:
parent
f8e62141f2
commit
247f82c088
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @file taler-exchange-httpd_db.c
|
* @file taler-exchange-httpd_db.c
|
||||||
* @brief High-level (transactional-layer) database operations for the exchange.
|
* @brief Generic database operations for the exchange.
|
||||||
* @author Christian Grothoff
|
* @author Christian Grothoff
|
||||||
*/
|
*/
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
@ -116,6 +116,7 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
|
|||||||
* @param[out] ret where the resulting total is to be stored
|
* @param[out] ret where the resulting total is to be stored
|
||||||
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
|
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
|
||||||
*/
|
*/
|
||||||
|
// FIXME: maybe move to another module, i.e. exchangedb???
|
||||||
int
|
int
|
||||||
TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
|
TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
|
||||||
const struct TALER_Amount *off,
|
const struct TALER_Amount *off,
|
||||||
|
@ -76,7 +76,7 @@ TEH_DB_run_transaction (struct MHD_Connection *connection,
|
|||||||
* @param[out] ret where the resulting total is to be stored
|
* @param[out] ret where the resulting total is to be stored
|
||||||
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
|
* @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
|
||||||
*/
|
*/
|
||||||
// FIXME: maybe move to another module?
|
// FIXME: maybe move to another module, i.e. exchangedb???
|
||||||
int
|
int
|
||||||
TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
|
TEH_DB_calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
|
||||||
const struct TALER_Amount *off,
|
const struct TALER_Amount *off,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @file taler-exchange-httpd_responses.c
|
* @file taler-exchange-httpd_responses.c
|
||||||
* @brief API for generating the various replies of the exchange; these
|
* @brief API for generating genric replies of the exchange; these
|
||||||
* functions are called TEH_RESPONSE_reply_ and they generate
|
* functions are called TEH_RESPONSE_reply_ and they generate
|
||||||
* and queue MHD response objects for a given connection.
|
* and queue MHD response objects for a given connection.
|
||||||
* @author Florian Dold
|
* @author Florian Dold
|
||||||
@ -899,23 +899,4 @@ TEH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A merchant asked for details about a deposit, but
|
|
||||||
* we did not execute the deposit yet. Generate a 202 reply.
|
|
||||||
*
|
|
||||||
* @param connection connection to the client
|
|
||||||
* @param planned_exec_time planned execution time
|
|
||||||
* @return MHD result code
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
|
||||||
struct GNUNET_TIME_Absolute planned_exec_time)
|
|
||||||
{
|
|
||||||
return TEH_RESPONSE_reply_json_pack (connection,
|
|
||||||
MHD_HTTP_ACCEPTED,
|
|
||||||
"{s:o}",
|
|
||||||
"execution_time", GNUNET_JSON_from_time_abs (planned_exec_time));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* end of taler-exchange-httpd_responses.c */
|
/* end of taler-exchange-httpd_responses.c */
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file taler-exchange-httpd_responses.h
|
* @file taler-exchange-httpd_responses.h
|
||||||
* @brief API for generating the various replies of the exchange; these
|
* @brief API for generating generic replies of the exchange; these
|
||||||
* functions are called TEH_RESPONSE_reply_ and they generate
|
* functions are called TEH_RESPONSE_reply_ and they generate
|
||||||
* and queue MHD response objects for a given connection.
|
* and queue MHD response objects for a given connection.
|
||||||
* @author Florian Dold
|
* @author Florian Dold
|
||||||
@ -287,19 +287,6 @@ TEH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection,
|
|||||||
enum TALER_ErrorCode ec);
|
enum TALER_ErrorCode ec);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A merchant asked for details about a deposit, but
|
|
||||||
* we did not execute the deposit yet. Generate a 202 reply.
|
|
||||||
*
|
|
||||||
* @param connection connection to the client
|
|
||||||
* @param planned_exec_time planned execution time
|
|
||||||
* @return MHD result code
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
|
||||||
struct GNUNET_TIME_Absolute planned_exec_time);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile the transaction history of a coin into a JSON object.
|
* Compile the transaction history of a coin into a JSON object.
|
||||||
*
|
*
|
||||||
|
@ -30,6 +30,25 @@
|
|||||||
#include "taler-exchange-httpd_responses.h"
|
#include "taler-exchange-httpd_responses.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A merchant asked for details about a deposit, but
|
||||||
|
* we did not execute the deposit yet. Generate a 202 reply.
|
||||||
|
*
|
||||||
|
* @param connection connection to the client
|
||||||
|
* @param planned_exec_time planned execution time
|
||||||
|
* @return MHD result code
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
reply_transfer_pending (struct MHD_Connection *connection,
|
||||||
|
struct GNUNET_TIME_Absolute planned_exec_time)
|
||||||
|
{
|
||||||
|
return TEH_RESPONSE_reply_json_pack (connection,
|
||||||
|
MHD_HTTP_ACCEPTED,
|
||||||
|
"{s:o}",
|
||||||
|
"execution_time", GNUNET_JSON_from_time_abs (planned_exec_time));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A merchant asked for details about a deposit. Provide
|
* A merchant asked for details about a deposit. Provide
|
||||||
* them. Generates the 200 reply.
|
* them. Generates the 200 reply.
|
||||||
@ -272,8 +291,8 @@ check_and_handle_track_transaction_request (struct MHD_Connection *connection,
|
|||||||
&ctx))
|
&ctx))
|
||||||
return mhd_ret;
|
return mhd_ret;
|
||||||
if (GNUNET_YES == ctx.pending)
|
if (GNUNET_YES == ctx.pending)
|
||||||
return TEH_RESPONSE_reply_transfer_pending (connection,
|
return reply_transfer_pending (connection,
|
||||||
ctx.execution_time);
|
ctx.execution_time);
|
||||||
if (GNUNET_SYSERR == ctx.pending)
|
if (GNUNET_SYSERR == ctx.pending)
|
||||||
return TEH_RESPONSE_reply_internal_db_error (connection,
|
return TEH_RESPONSE_reply_internal_db_error (connection,
|
||||||
TALER_EC_TRACK_TRANSACTION_DB_FEE_INCONSISTENT);
|
TALER_EC_TRACK_TRANSACTION_DB_FEE_INCONSISTENT);
|
||||||
|
Loading…
Reference in New Issue
Block a user