diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-05-25 00:13:37 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-05-25 00:13:37 +0200 |
commit | a1ecc4a85e1634a0c02ac84f140195040138a254 (patch) | |
tree | e38023acfa32499cef7f92beea14812756c040c7 /src/backend/taler-merchant-httpd_responses.c | |
parent | 13eb40e3bcc935dc39a03d071f8ab2391c8c085e (diff) | |
download | merchant-a1ecc4a85e1634a0c02ac84f140195040138a254.tar.gz merchant-a1ecc4a85e1634a0c02ac84f140195040138a254.tar.bz2 merchant-a1ecc4a85e1634a0c02ac84f140195040138a254.zip |
adding scaffold for integrating /track/{deposit,wtid} API calls
Diffstat (limited to 'src/backend/taler-merchant-httpd_responses.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_responses.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_responses.c b/src/backend/taler-merchant-httpd_responses.c index 0f066ba9..d63eacb5 100644 --- a/src/backend/taler-merchant-httpd_responses.c +++ b/src/backend/taler-merchant-httpd_responses.c @@ -289,5 +289,41 @@ TMH_RESPONSE_make_external_error (const char *hint) "hint", hint); } +/** + * Send a response indicating a missing argument. + * + * @param connection the MHD connection to use + * @param param_name the parameter that is missing + * @return a MHD result code + */ +int +TMH_RESPONSE_reply_arg_missing (struct MHD_Connection *connection, + const char *param_name) +{ + return TMH_RESPONSE_reply_json_pack (connection, + MHD_HTTP_BAD_REQUEST, + "{ s:s, s:s}", + "error", "missing parameter", + "parameter", param_name); +} + + +/** + * Send a response indicating an invalid argument. + * + * @param connection the MHD connection to use + * @param param_name the parameter that is invalid + * @return a MHD result code + */ +int +TMH_RESPONSE_reply_arg_invalid (struct MHD_Connection *connection, + const char *param_name) +{ + return TMH_RESPONSE_reply_json_pack (connection, + MHD_HTTP_BAD_REQUEST, + "{s:s, s:s}", + "error", "invalid parameter", + "parameter", param_name); +} /* end of taler-exchange-httpd_responses.c */ |