From 362bf0c5bd2270ed6a54dfbdfd83702dca892797 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 20 Jul 2021 19:33:59 +0200 Subject: -workshop refactoring --- .../taler-merchant-httpd_private-post-instances.c | 76 +++------------------- 1 file changed, 8 insertions(+), 68 deletions(-) (limited to 'src/backend/taler-merchant-httpd_private-post-instances.c') diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c index f9df3d39..71739c3d 100644 --- a/src/backend/taler-merchant-httpd_private-post-instances.c +++ b/src/backend/taler-merchant-httpd_private-post-instances.c @@ -24,6 +24,7 @@ */ #include "platform.h" #include "taler-merchant-httpd_private-post-instances.h" +#include "taler-merchant-httpd_helper.h" #include #include @@ -234,56 +235,11 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, } /* check payto_uris for well-formedness */ - { - bool payto_ok = true; - - if (! json_is_array (payto_uris)) - { - GNUNET_break_op (0); - payto_ok = false; - } - else - { - unsigned int len = json_array_size (payto_uris); - - for (unsigned int i = 0; ij_wire = json_pack ("{s:O, s:o}", - "payto_uri", payto_uri, - "salt", GNUNET_JSON_from_data_auto (&salt)); - GNUNET_assert (NULL != wm->j_wire); - /* This also tests for things like the IBAN being malformed */ - GNUNET_assert (GNUNET_OK == - TALER_JSON_merchant_wire_signature_hash (wm->j_wire, - &wm->h_wire)); - wm->wire_method - = TALER_payto_get_method (json_string_value (payto_uri)); - GNUNET_assert (NULL != wm->wire_method); /* checked earlier */ - wm->active = true; + + wm = TMH_setup_wire_account (json_string_value (payto_uri)); GNUNET_CONTAINER_DLL_insert (wm_head, wm_tail, wm); -- cgit v1.2.3