summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_kyc-proof.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-10-17 19:02:26 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-17 19:02:26 +0200
commitadb93355282653438c9850948146cd5171d92aaf (patch)
tree34171cf610ee2be9626802371fd0463bfee64309 /src/exchange/taler-exchange-httpd_kyc-proof.c
parentb38b51d5e8b71f2fcf30dc6aaef82c1fbcede5f8 (diff)
downloadexchange-adb93355282653438c9850948146cd5171d92aaf.tar.gz
exchange-adb93355282653438c9850948146cd5171d92aaf.tar.bz2
exchange-adb93355282653438c9850948146cd5171d92aaf.zip
integrate /kyc-* handlers with dispatching logic
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-proof.c')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c b/src/exchange/taler-exchange-httpd_kyc-proof.c
index cb3f00dde..be7fc50fe 100644
--- a/src/exchange/taler-exchange-httpd_kyc-proof.c
+++ b/src/exchange/taler-exchange-httpd_kyc-proof.c
@@ -67,21 +67,36 @@ proof_kyc_check (void *cls,
MHD_RESULT
TEH_handler_kyc_proof (
- struct MHD_Connection *connection,
- ...)
+ struct TEH_RequestContext *rc,
+ const char *const args[])
{
struct KycProofContext kpc;
MHD_RESULT res;
enum GNUNET_GenericReturnValue ret;
+ unsigned long long payment_target_uuid;
+ char dummy;
+
+ if (1 !=
+ sscanf (args[0],
+ "%llu%c",
+ &payment_target_uuid,
+ &dummy))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ "payment_target_uuid");
+ }
if (1 || (TEH_KYC_NONE == TEH_kyc_config.mode))
return TALER_MHD_reply_static (
- connection,
+ rc->connection,
MHD_HTTP_NO_CONTENT,
NULL,
NULL,
0);
- ret = TEH_DB_run_transaction (connection,
+ ret = TEH_DB_run_transaction (rc->connection,
"check proof kyc",
&res,
&proof_kyc_check,
@@ -89,7 +104,7 @@ TEH_handler_kyc_proof (
if (GNUNET_SYSERR == ret)
return res;
return TALER_MHD_REPLY_JSON_PACK (
- connection,
+ rc->connection,
MHD_HTTP_OK,
GNUNET_JSON_pack_uint64 ("42",
42));