diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-04-11 19:44:51 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-04-11 19:44:51 +0200 |
commit | 5ed3b2cfe1aa0cb31c589b308cc70684a20dd368 (patch) | |
tree | 858e253a3393febe8207e5870e59e04946fa6958 /src/backend/taler-merchant-httpd_private-post-instances.c | |
parent | feaf7bae8baf8ec701d02374e18a6b978dcfb9f8 (diff) | |
download | merchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.tar.gz merchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.tar.bz2 merchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.zip |
store user-type with merchant settings
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-instances.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-post-instances.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c index 89bd937e..4d9320ba 100644 --- a/src/backend/taler-merchant-httpd_private-post-instances.c +++ b/src/backend/taler-merchant-httpd_private-post-instances.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2020, 2021 Taler Systems SA + (C) 2020-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -149,6 +149,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, struct TALER_MERCHANTDB_InstanceAuthSettings ias; json_t *payto_uris; const char *auth_token = NULL; + const char *uts = "business"; struct TMH_WireMethod *wm_head = NULL; struct TMH_WireMethod *wm_tail = NULL; json_t *jauth; @@ -160,6 +161,10 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_string ("name", (const char **) &is.name), GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_string ("user_type", + &uts), + NULL), + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("email", (const char **) &is.email), NULL), @@ -204,6 +209,20 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, : MHD_NO; } + if (NULL == uts) + uts = "business"; + if (GNUNET_OK != + TALER_KYCLOGIC_kyc_user_type_from_string (uts, + &is.ut)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "user_type"); + } + { enum GNUNET_GenericReturnValue ret; |