From 21d26132877990d7beac118b33e336aaed395234 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 29 Mar 2017 16:42:38 +0200 Subject: first sketch at db module implementation for #3887 --- src/exchange/taler-exchange-httpd_responses.h | 43 +++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_responses.h') diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h index 179ae0066..27b20d353 100644 --- a/src/exchange/taler-exchange-httpd_responses.h +++ b/src/exchange/taler-exchange-httpd_responses.h @@ -250,17 +250,20 @@ TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection, /** - * Send proof that a /deposit request is invalid to client. This - * function will create a message with all of the operations affecting - * the coin that demonstrate that the coin has insufficient value. + * Send proof that a request is invalid to client because of + * insufficient funds. This function will create a message with all + * of the operations affecting the coin that demonstrate that the coin + * has insufficient value. * * @param connection connection to the client + * @param ec error code to return * @param tl transaction list to use to build reply * @return MHD result code */ int -TEH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection, - const struct TALER_EXCHANGEDB_TransactionList *tl); +TEH_RESPONSE_reply_coin_insufficient_funds (struct MHD_Connection *connection, + enum TALER_ErrorCode ec, + const struct TALER_EXCHANGEDB_TransactionList *tl); /** @@ -556,4 +559,34 @@ TEH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection, const struct TEH_RESPONSE_LinkSessionInfo *sessions); +/** + * A wallet asked for /payback, but we do not know anything + * about the original withdraw operation given. Generates a + * 404 reply. + * + * @param connection connection to the client + * @param ec Taler error code + * @return MHD result code + */ +int +TEH_RESPONSE_reply_payback_unknown (struct MHD_Connection *connection, + enum TALER_ErrorCode ec); + + +/** + * A wallet asked for /payback, return the successful response. + * + * @param connection connection to the client + * @param wire_subject the wire subject we will use for the pay back operation + * @param amount the amount we will wire back + * @param payback_deadline deadline by which the exchange promises to pay + * @return MHD result code + */ +int +TEH_RESPONSE_reply_payback_success (struct MHD_Connection *connection, + const char *wire_subject, + const struct TALER_Amount *amount, + struct GNUNET_TIME_Absolute payback_deadline); + + #endif -- cgit v1.2.3