aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-16 13:50:07 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-16 13:50:07 +0100
commitf58fb4fc21be694096ae223fe0990ab93a52e815 (patch)
tree6bb6f4bec9d3f7ba8b4dc8a72d577f650c7d0211 /src/mint/taler-mint-httpd_deposit.c
parent0430d6fb031d1713a39a996068387c3ab2c36c2d (diff)
starting to separate out response generation API and parsing APIs
Diffstat (limited to 'src/mint/taler-mint-httpd_deposit.c')
-rw-r--r--src/mint/taler-mint-httpd_deposit.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/mint/taler-mint-httpd_deposit.c b/src/mint/taler-mint-httpd_deposit.c
index b8bcc87db..8c040b691 100644
--- a/src/mint/taler-mint-httpd_deposit.c
+++ b/src/mint/taler-mint-httpd_deposit.c
@@ -31,9 +31,10 @@
#include "taler_signatures.h"
#include "taler_rsa.h"
#include "taler_json_lib.h"
-#include "taler-mint-httpd_json.h"
+#include "taler-mint-httpd_parsing.h"
#include "taler-mint-httpd_keys.h"
#include "taler-mint-httpd_deposit.h"
+#include "taler-mint-httpd_responses.h"
/**
@@ -48,8 +49,11 @@ helper_deposit_send_response_success (struct MHD_Connection *connection,
struct Deposit *deposit)
{
// FIXME: return more information here
- return request_send_json_pack (connection, MHD_HTTP_OK,
- "{s:s}", "status", "DEPOSIT_OK");
+ return TALER_MINT_reply_json_pack (connection,
+ MHD_HTTP_OK,
+ "{s:s}",
+ "status",
+ "DEPOSIT_OK");
}
@@ -199,9 +203,11 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
// FIXME: in the future, check if there's enough credits
// left on the coin. For now: refuse
// FIXME: return more information here
- return request_send_json_pack (connection, MHD_HTTP_FORBIDDEN,
- "{s:s}",
- "error", "double spending");
+ return TALER_MINT_reply_json_pack (connection,
+ MHD_HTTP_FORBIDDEN,
+ "{s:s}",
+ "error",
+ "double spending");
}
if (GNUNET_SYSERR == res)
@@ -221,9 +227,10 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
// coin must have been refreshed
// FIXME: check
// FIXME: return more information here
- return request_send_json_pack (connection, MHD_HTTP_FORBIDDEN,
- "{s:s}",
- "error", "coin was refreshed");
+ return TALER_MINT_reply_json_pack (connection,
+ MHD_HTTP_FORBIDDEN,
+ "{s:s}",
+ "error", "coin was refreshed");
}
if (GNUNET_SYSERR == res)
{
@@ -252,7 +259,9 @@ TALER_MINT_handler_deposit (struct RequestHandler *rh,
EXITIF_exit:
if (NULL != resp)
- res = send_response_json (connection, resp, resp_code);
+ res = TALER_MINT_reply_json (connection,
+ resp,
+ resp_code);
else
res = MHD_NO;
if (NULL != wire)