summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_kyc-check.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-09 20:36:30 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-09 20:36:30 +0100
commit016551dbb4af5de4725fb67787dff07c852c0280 (patch)
treed7199334658b8caaa51307ddff69d4fe1bb0a661 /src/exchange/taler-exchange-httpd_kyc-check.c
parenta9b2140b1ece806847aa45a6b95a959c9ddaa7bf (diff)
downloadexchange-016551dbb4af5de4725fb67787dff07c852c0280.tar.gz
exchange-016551dbb4af5de4725fb67787dff07c852c0280.tar.bz2
exchange-016551dbb4af5de4725fb67787dff07c852c0280.zip
misc TODOs for KYC left
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-check.c')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
index 38890e98c..5964da501 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -105,6 +105,7 @@ TEH_handler_kyc_check (
MHD_RESULT res;
enum GNUNET_GenericReturnValue ret;
char dummy;
+ struct TALER_PaytoHash h_payto;
if (1 !=
sscanf (args[0],
@@ -118,6 +119,34 @@ TEH_handler_kyc_check (
TALER_EC_GENERIC_PARAMETER_MALFORMED,
"payment_target_uuid");
}
+ /* FIXME: write long polling logic ... */
+ {
+ const char *hps;
+
+ hps = MHD_lookup_connection_value (rc->connection,
+ MHD_GET_ARGUMENT_KIND,
+ "h_payto");
+ if (NULL == hps)
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MISSING,
+ "h_payto");
+ }
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (hps,
+ strlen (hps),
+ &h_payto,
+ sizeof (h_payto)))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ "h_payto");
+ }
+ }
if (TEH_KYC_NONE == TEH_kyc_config.mode)
return TALER_MHD_reply_static (
@@ -141,6 +170,16 @@ TEH_handler_kyc_check (
&kcc);
if (GNUNET_SYSERR == ret)
return res;
+ if (0 !=
+ GNUNET_memcmp (&kcc.h_payto,
+ &h_payto))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_FORBIDDEN,
+ 42, /* FIXME: EC! */
+ "h_payto");
+ }
if (! kcc.kyc.ok)
{
char *url;