diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-19 09:31:51 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-19 09:31:51 +0200 |
commit | 2c4bd1e1d0094b93588a5c35205d54e9eac60f03 (patch) | |
tree | 9dbddb18e52d76a254c6dd64e6ecadaf9318b984 /src/exchange | |
parent | 9c1f1c76be598baeb7cc14d4c63e9815ad78d22f (diff) | |
download | exchange-2c4bd1e1d0094b93588a5c35205d54e9eac60f03.tar.gz exchange-2c4bd1e1d0094b93588a5c35205d54e9eac60f03.tar.bz2 exchange-2c4bd1e1d0094b93588a5c35205d54e9eac60f03.zip |
add user type to kyc-check
Diffstat (limited to 'src/exchange')
-rw-r--r-- | src/exchange/taler-exchange-httpd.c | 2 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_kyc-check.c | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index c91dbfbb4..496d3d29f 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -1217,7 +1217,7 @@ handle_mhd_request (void *cls, .url = "kyc-check", .method = MHD_HTTP_METHOD_GET, .handler.get = &TEH_handler_kyc_check, - .nargs = 2 + .nargs = 3 }, { .url = "kyc-proof", diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c index 61d1abf8e..c4181e11f 100644 --- a/src/exchange/taler-exchange-httpd_kyc-check.c +++ b/src/exchange/taler-exchange-httpd_kyc-check.c @@ -108,6 +108,11 @@ struct KycPoller enum TALER_ErrorCode ec; /** + * What kind of entity is doing the KYC check? + */ + enum TALER_KYCLOGIC_KycUserType ut; + + /** * True if we are still suspended. */ bool suspended; @@ -401,7 +406,7 @@ db_event_cb (void *cls, MHD_RESULT TEH_handler_kyc_check ( struct TEH_RequestContext *rc, - const char *const args[2]) + const char *const args[3]) { struct KycPoller *kyp = rc->rh_ctx; MHD_RESULT res; @@ -447,6 +452,17 @@ TEH_handler_kyc_check ( "h_payto"); } + if (GNUNET_OK != + TALER_KYCLOGIC_kyc_user_type_from_string (args[2], + &kyp->ut)) + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (rc->connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "usertype"); + } + { const char *ts; |