diff options
Diffstat (limited to 'src/lib/merchant_api_post_instances.c')
-rw-r--r-- | src/lib/merchant_api_post_instances.c | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c index 183b3400..73d36369 100644 --- a/src/lib/merchant_api_post_instances.c +++ b/src/lib/merchant_api_post_instances.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2020-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -32,6 +32,7 @@ #include "merchant_api_common.h" #include <taler/taler_json_lib.h> #include <taler/taler_curl_lib.h> +#include <taler/taler_kyclogic_lib.h> /** @@ -163,14 +164,11 @@ TALER_MERCHANT_instances_post ( struct GNUNET_CURL_Context *ctx, const char *backend_url, const char *instance_id, - unsigned int accounts_length, - const char *payto_uris[], const char *name, + enum TALER_KYCLOGIC_KycUserType ut, const json_t *address, const json_t *jurisdiction, - const struct TALER_Amount *default_max_wire_fee, - uint32_t default_wire_fee_amortization, - const struct TALER_Amount *default_max_deposit_fee, + bool use_stefan, struct GNUNET_TIME_Relative default_wire_transfer_delay, struct GNUNET_TIME_Relative default_pay_delay, const char *auth_token, @@ -178,10 +176,16 @@ TALER_MERCHANT_instances_post ( void *cb_cls) { struct TALER_MERCHANT_InstancesPostHandle *iph; - json_t *jpayto_uris; json_t *req_obj; json_t *auth_obj; + const char *uts; + uts = TALER_KYCLOGIC_kyc_user_type2s (ut); + if (NULL == uts) + { + GNUNET_break (0); + return NULL; + } if (NULL != auth_token) { if (0 != strncasecmp (RFC_8959_PREFIX, @@ -210,42 +214,19 @@ TALER_MERCHANT_instances_post ( GNUNET_break (0); return NULL; } - jpayto_uris = json_array (); - if (NULL == jpayto_uris) - { - json_decref (auth_obj); - GNUNET_break (0); - return NULL; - } - for (unsigned int i = 0; i<accounts_length; i++) - { - if (0 != - json_array_append_new (jpayto_uris, - json_string (payto_uris[i]))) - { - GNUNET_break (0); - json_decref (auth_obj); - json_decref (jpayto_uris); - return NULL; - } - } req_obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_array_steal ("payto_uris", - jpayto_uris), GNUNET_JSON_pack_string ("id", instance_id), GNUNET_JSON_pack_string ("name", name), + GNUNET_JSON_pack_string ("user_type", + uts), GNUNET_JSON_pack_object_incref ("address", (json_t *) address), GNUNET_JSON_pack_object_incref ("jurisdiction", (json_t *) jurisdiction), - TALER_JSON_pack_amount ("default_max_wire_fee", - default_max_wire_fee), - GNUNET_JSON_pack_uint64 ("default_wire_fee_amortization", - default_wire_fee_amortization), - TALER_JSON_pack_amount ("default_max_deposit_fee", - default_max_deposit_fee), + GNUNET_JSON_pack_bool ("use_stefan", + use_stefan), GNUNET_JSON_pack_time_rel ("default_wire_transfer_delay", default_wire_transfer_delay), GNUNET_JSON_pack_time_rel ("default_pay_delay", |