commit 9d68a5d1d49b61ab5aa4792bd05a4e73a243c723 parent 22500b550b0ce9d03b99b5706afb74b29c3d9d1d Author: Christian Grothoff <grothoff@gnunet.org> Date: Tue, 5 Aug 2025 00:40:15 +0200 fix #9815 Diffstat:
7 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -589,6 +589,7 @@ TMH_instance_decref (struct TMH_MerchantInstance *mi) GNUNET_free (mi->settings.id); GNUNET_free (mi->settings.name); GNUNET_free (mi->settings.email); + GNUNET_free (mi->settings.phone); GNUNET_free (mi->settings.website); GNUNET_free (mi->settings.logo); json_decref (mi->settings.address); @@ -2487,6 +2488,8 @@ add_instance_cb (void *cls, mi->settings.name = GNUNET_strdup (mi->settings.name); if (NULL != mi->settings.email) mi->settings.email = GNUNET_strdup (mi->settings.email); + if (NULL != mi->settings.phone) + mi->settings.email = GNUNET_strdup (mi->settings.phone); if (NULL != mi->settings.website) mi->settings.website = GNUNET_strdup (mi->settings.website); if (NULL != mi->settings.logo) diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID.c b/src/backend/taler-merchant-httpd_private-get-instances-ID.c @@ -73,8 +73,8 @@ get_instances_ID (struct TMH_MerchantInstance *mi, auth = GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("method", GNUNET_is_zero (&mi->auth.auth_hash) - ? "external" - : "token")); + ? "external" + : "token")); return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, @@ -82,9 +82,6 @@ get_instances_ID (struct TMH_MerchantInstance *mi, ja), GNUNET_JSON_pack_string ("name", mi->settings.name), - GNUNET_JSON_pack_string ( - "user_type", - "business"), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("website", mi->settings.website)), @@ -92,6 +89,9 @@ get_instances_ID (struct TMH_MerchantInstance *mi, GNUNET_JSON_pack_string ("email", mi->settings.email)), GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("phone_number", + mi->settings.phone)), + GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("logo", mi->settings.logo)), GNUNET_JSON_pack_data_auto ("merchant_pub", diff --git a/src/backend/taler-merchant-httpd_private-get-instances.c b/src/backend/taler-merchant-httpd_private-get-instances.c @@ -74,9 +74,6 @@ add_instance (void *cls, GNUNET_JSON_PACK ( GNUNET_JSON_pack_string ("name", mi->settings.name), - GNUNET_JSON_pack_string ( - "user_type", - "business"), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("website", mi->settings.website)), diff --git a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c @@ -78,6 +78,10 @@ patch_instances_ID (struct TMH_MerchantInstance *mi, (const char **) &is.email), NULL), GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_string ("phone_number", + (const char **) &is.phone), + NULL), + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("logo", (const char **) &is.logo), NULL), @@ -215,6 +219,7 @@ giveup: /* Update our 'settings' */ GNUNET_free (mi->settings.name); GNUNET_free (mi->settings.email); + GNUNET_free (mi->settings.phone); GNUNET_free (mi->settings.website); GNUNET_free (mi->settings.logo); json_decref (mi->settings.address); @@ -226,6 +231,8 @@ giveup: mi->settings.name = GNUNET_strdup (name); if (NULL != is.email) mi->settings.email = GNUNET_strdup (is.email); + if (NULL != is.phone) + mi->settings.email = GNUNET_strdup (is.phone); if (NULL != is.website) mi->settings.website = GNUNET_strdup (is.website); if (NULL != is.logo) diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c @@ -52,7 +52,6 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, struct TALER_MERCHANTDB_InstanceSettings is = { 0 }; struct TALER_MERCHANTDB_InstanceAuthSettings ias; const char *auth_password = NULL; - const char *uts = "business"; struct TMH_WireMethod *wm_head = NULL; struct TMH_WireMethod *wm_tail = NULL; const json_t *jauth; @@ -62,14 +61,14 @@ 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), GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_string ("phone_number", + (const char **) &is.phone), + NULL), + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("website", (const char **) &is.website), NULL), @@ -276,6 +275,8 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh, mi->settings.name = GNUNET_strdup (is.name); if (NULL != is.email) mi->settings.email = GNUNET_strdup (is.email); + if (NULL != is.email) + mi->settings.phone = GNUNET_strdup (is.phone); if (NULL != is.website) mi->settings.website = GNUNET_strdup (is.website); if (NULL != is.logo) diff --git a/src/lib/merchant_api_get_instance.c b/src/lib/merchant_api_get_instance.c @@ -93,16 +93,12 @@ handle_get_instance_finished (void *cls, { case MHD_HTTP_OK: { - const char *uts; const json_t *address; const json_t *jurisdiction; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ( "name", &igr.details.ok.details.name), - GNUNET_JSON_spec_string ( - "user_type", - &uts), GNUNET_JSON_spec_fixed_auto ( "merchant_pub", &igr.details.ok.details.merchant_pub), diff --git a/src/lib/merchant_api_get_instances.c b/src/lib/merchant_api_get_instances.c @@ -103,12 +103,9 @@ parse_instances (const json_t *json, json_array_foreach (ia, index, value) { struct TALER_MERCHANT_InstanceInformation *ii = &iis[index]; - const char *uts; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("name", &ii->name), - GNUNET_JSON_spec_string ("user_type", - &uts), GNUNET_JSON_spec_string ("id", &ii->id), GNUNET_JSON_spec_fixed_auto ("merchant_pub",