merchant

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

commit fbb0c53cc8524428387059d966aca726716494f3
parent 77355d764c7e495bf56ad698a158a74004733d27
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri, 10 Jul 2026 10:09:04 +0200

return after failure

Diffstat:
Msrc/testing/testing_api_cmd_checkserver.c | 12++++++++++++
Msrc/testing/testing_api_cmd_get_instance.c | 18++++++++++++++++++
Msrc/testing/testing_api_cmd_get_otp_device.c | 3+++
Msrc/testing/testing_api_cmd_get_product.c | 27+++++++++++++++++++++++++++
Msrc/testing/testing_api_cmd_get_template.c | 9+++++++++
Msrc/testing/testing_api_cmd_get_webhook.c | 15+++++++++++++++
6 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/src/testing/testing_api_cmd_checkserver.c b/src/testing/testing_api_cmd_checkserver.c @@ -145,7 +145,10 @@ checkserver_run (void *cls, TALER_TESTING_get_trait_http_methods (ref, cs->index, &http_method)) + { TALER_TESTING_interpreter_fail (is); + return; + } if (0 != strcmp (cs->expected_method, http_method)) { @@ -158,7 +161,10 @@ checkserver_run (void *cls, TALER_TESTING_get_trait_http_header (ref, cs->index, &header)) + { TALER_TESTING_interpreter_fail (is); + return; + } if ( ( (NULL == cs->expected_header) && (NULL != header)) || ( (NULL != cs->expected_header) && (NULL == header)) || ( (NULL != cs->expected_header) && @@ -176,12 +182,18 @@ checkserver_run (void *cls, TALER_TESTING_get_trait_http_body (ref, cs->index, &body)) + { TALER_TESTING_interpreter_fail (is); + return; + } if (GNUNET_OK != TALER_TESTING_get_trait_http_body_size (ref, cs->index, &body_size)) + { TALER_TESTING_interpreter_fail (is); + return; + } if ( ( (NULL == cs->expected_body) && (NULL != body) ) || ( (NULL != cs->expected_body) && diff --git a/src/testing/testing_api_cmd_get_instance.c b/src/testing/testing_api_cmd_get_instance.c @@ -117,7 +117,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_instance_name (instance_cmd, &name)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (details->name, name)) { @@ -135,7 +138,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_address (instance_cmd, &address)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (1 != json_equal (details->address, address)) { @@ -151,7 +157,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_jurisdiction (instance_cmd, &jurisdiction)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (1 != json_equal (details->jurisdiction, jurisdiction)) { @@ -167,7 +176,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_use_stefan (instance_cmd, &use_stefan)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (*use_stefan != details->use_stefan) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -182,7 +194,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_wire_delay (instance_cmd, &default_wire_transfer_delay)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (details->default_wire_transfer_delay.rel_value_us != default_wire_transfer_delay->rel_value_us) { @@ -198,7 +213,10 @@ get_instance_cb (struct GetInstanceState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_pay_delay (instance_cmd, &default_pay_delay)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (details->default_pay_delay.rel_value_us != default_pay_delay->rel_value_us) { diff --git a/src/testing/testing_api_cmd_get_otp_device.c b/src/testing/testing_api_cmd_get_otp_device.c @@ -106,7 +106,10 @@ get_otp_device_cb (struct GetOtpDeviceState *gis, TALER_TESTING_get_trait_otp_device_description (otp_device_cmd, &expected_description) ) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (tgr->details.ok.otp_device_description, expected_description)) { diff --git a/src/testing/testing_api_cmd_get_product.c b/src/testing/testing_api_cmd_get_product.c @@ -112,7 +112,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_product_description (product_cmd, &expected_description)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (pgr->details.ok.description, expected_description)) { @@ -128,7 +131,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_i18n_description (product_cmd, &expected_description_i18n)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (1 != json_equal (pgr->details.ok.description_i18n, expected_description_i18n)) { @@ -144,7 +150,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_amount (product_cmd, &expected_price)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if ((GNUNET_OK != TALER_amount_cmp_currency (&pgr->details.ok.price, expected_price)) || @@ -270,7 +279,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_product_image (product_cmd, &expected_image)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (pgr->details.ok.image, expected_image)) { @@ -286,7 +298,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_taxes (product_cmd, &expected_taxes)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (1 != json_equal (pgr->details.ok.taxes, expected_taxes)) { @@ -302,7 +317,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_product_unit (product_cmd, &expected_unit)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (pgr->details.ok.unit, expected_unit)) { @@ -318,7 +336,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_address (product_cmd, &expected_location)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (NULL != expected_location) { if (1 != json_equal (pgr->details.ok.location, @@ -337,7 +358,10 @@ get_product_cb (struct GetProductState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_product_stock (product_cmd, &expected_total_stock)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (pgr->details.ok.total_stock != *expected_total_stock) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -353,7 +377,10 @@ get_product_cb (struct GetProductState *gis, TALER_TESTING_get_trait_timestamp (product_cmd, 0, &expected_next_restock)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (GNUNET_TIME_timestamp_cmp (pgr->details.ok.next_restock, !=, *expected_next_restock)) diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c @@ -105,7 +105,10 @@ get_template_cb (struct GetTemplateState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_template_description (template_cmd, &expected_description)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (tgr->details.ok.template_description, expected_description)) { @@ -121,7 +124,10 @@ get_template_cb (struct GetTemplateState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_otp_id (template_cmd, &expected_otp_id)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if ( ( (NULL == tgr->details.ok.otp_id) && (NULL != expected_otp_id)) || ( (NULL != tgr->details.ok.otp_id) && (NULL == expected_otp_id)) || ( (NULL != tgr->details.ok.otp_id) && @@ -143,7 +149,10 @@ get_template_cb (struct GetTemplateState *gis, TALER_TESTING_get_trait_template_contract (template_cmd, &expected_template_contract )) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (1 != json_equal (tgr->details.ok.template_contract, expected_template_contract)) { diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c @@ -105,7 +105,10 @@ get_webhook_cb (struct GetWebhookState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_event_type (webhook_cmd, &expected_event_type)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (wgr->details.ok.event_type, expected_event_type)) { @@ -121,7 +124,10 @@ get_webhook_cb (struct GetWebhookState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_url (webhook_cmd, &expected_url)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (wgr->details.ok.url, expected_url)) { @@ -137,7 +143,10 @@ get_webhook_cb (struct GetWebhookState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_http_method (webhook_cmd, &expected_http_method)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if (0 != strcmp (wgr->details.ok.http_method, expected_http_method)) { @@ -153,7 +162,10 @@ get_webhook_cb (struct GetWebhookState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_header_template (webhook_cmd, &expected_header_template)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if ( ( (NULL == wgr->details.ok.header_template) && (NULL != expected_header_template)) || @@ -176,7 +188,10 @@ get_webhook_cb (struct GetWebhookState *gis, if (GNUNET_OK != TALER_TESTING_get_trait_body_template (webhook_cmd, &expected_body_template)) + { TALER_TESTING_interpreter_fail (gis->is); + return; + } if ( ( (NULL == wgr->details.ok.body_template) && (NULL != expected_body_template) ) ||