merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit f9cdf071c0b945b2f8584b00232a05f059562226
parent 432177857128fd3b541d861eff160a817cb4c1bc
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 22 Mar 2026 15:26:56 +0100

-fix tests and shutdown sequence

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 13+++++++------
Msrc/include/taler/taler-merchant/post-private-webhooks-new.h | 4++--
Msrc/testing/test_merchant_api.c | 4++--
Msrc/testing/testing_api_cmd_get_statisticscounter.c | 30++++++++++++++----------------
4 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -199,6 +199,7 @@ TMH_instance_free_cb (void *cls, (void) cls; (void) key; + TMH_force_get_orders_resume (mi); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (TMH_by_id_map, &mi->h_instance, @@ -230,18 +231,12 @@ do_shutdown (void *cls) TMH_force_wallet_get_order_resume (); TMH_force_wallet_refund_order_resume (); TMH_challenge_done (); - TALER_MHD_daemons_destroy (); if (NULL != instance_eh) { TMH_db->event_listen_cancel (instance_eh); instance_eh = NULL; } TMH_EXCHANGES_done (); - if (NULL != TMH_db) - { - TALER_MERCHANTDB_plugin_unload (TMH_db); - TMH_db = NULL; - } if (NULL != TMH_by_id_map) { GNUNET_CONTAINER_multihashmap_iterate (TMH_by_id_map, @@ -250,6 +245,12 @@ do_shutdown (void *cls) GNUNET_CONTAINER_multihashmap_destroy (TMH_by_id_map); TMH_by_id_map = NULL; } + TALER_MHD_daemons_destroy (); + if (NULL != TMH_db) + { + TALER_MERCHANTDB_plugin_unload (TMH_db); + TMH_db = NULL; + } TALER_TEMPLATING_done (); if (NULL != TMH_curl_ctx) { diff --git a/src/include/taler/taler-merchant/post-private-webhooks-new.h b/src/include/taler/taler-merchant/post-private-webhooks-new.h @@ -68,8 +68,8 @@ TALER_MERCHANT_post_private_webhooks_create ( const char *event_type, const char *notification_url, const char *http_method, - const char *header_template, - const char *body_template); + const char *header_template, // FIXME: use set_option + const char *body_template); // FIXME: use set_option #ifndef TALER_MERCHANT_POST_PRIVATE_WEBHOOKS_RESULT_CLOSURE diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c @@ -3317,7 +3317,7 @@ run (void *cls, "tokens-issued", 6, #ifdef HAVE_DONAU_DONAU_SERVICE_H - 2, + 1, #else 0, #endif @@ -3327,7 +3327,7 @@ run (void *cls, "tokens-used", 6, #ifdef HAVE_DONAU_DONAU_SERVICE_H - 2, + 1, #else 0, #endif diff --git a/src/testing/testing_api_cmd_get_statisticscounter.c b/src/testing/testing_api_cmd_get_statisticscounter.c @@ -80,10 +80,9 @@ struct GetStatisticsCounterState * @param scgr response details */ static void -get_statisticscounter_cb (void *cls, - const struct - TALER_MERCHANT_GetPrivateStatisticsCounterResponse * - scgr) +get_statisticscounter_cb ( + void *cls, + const struct TALER_MERCHANT_GetPrivateStatisticsCounterResponse *scgr) { struct GetStatisticsCounterState *scs = cls; const struct TALER_MERCHANT_HttpResponse *hr = &scgr->hr; @@ -103,19 +102,19 @@ get_statisticscounter_cb (void *cls, { case MHD_HTTP_OK: { - if (scgr->details.ok.buckets_length != scs->buckets_length) + if (scgr->details.ok.buckets_length < scs->buckets_length) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Length of buckets found does not match (Got %llu, expected %llu)\n", + "Length of buckets found does not match (Got %llu, expected at least %llu)\n", (unsigned long long) scgr->details.ok.buckets_length, (unsigned long long) scs->buckets_length); TALER_TESTING_interpreter_fail (scs->is); return; } - if (scgr->details.ok.intervals_length != scs->intervals_length) + if (scgr->details.ok.intervals_length < scs->intervals_length) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Length of intervals found does not match (Got %llu, expected %llu)\n", + "Length of intervals found does not match (Got %llu, expected at least %llu)\n", (unsigned long long) scgr->details.ok.intervals_length, (unsigned long long) scs->intervals_length); TALER_TESTING_interpreter_fail (scs->is); @@ -198,14 +197,13 @@ get_statisticscounter_cleanup (void *cls, struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_statisticscounter (const char *label, - const char *merchant_url, - const char *slug, - uint64_t - expected_buckets_length, - uint64_t - expected_intervals_length, - unsigned int http_status) +TALER_TESTING_cmd_merchant_get_statisticscounter ( + const char *label, + const char *merchant_url, + const char *slug, + uint64_t expected_buckets_length, + uint64_t expected_intervals_length, + unsigned int http_status) { struct GetStatisticsCounterState *scs;