merchant

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

commit ada2522485d6d6cc08f0821681898e027fb598f6
parent 8f19589b66258f79f54a4a65d4bb221f9a56a6ea
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 25 Nov 2025 21:47:56 +0100

-minor fixes

Diffstat:
Msrc/backend/taler-merchant-httpd_helper.h | 18+++++++++---------
Msrc/backend/taler-merchant-httpd_private-delete-units-ID.c | 2++
Msrc/backend/taler-merchant-httpd_private-patch-units-ID.c | 5+++++
Msrc/backend/taler-merchant-httpd_private-post-units.c | 5+----
4 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_helper.h b/src/backend/taler-merchant-httpd_helper.h @@ -20,8 +20,8 @@ * @author Benedikt Mueller * @author Christian Grothoff */ -#ifndef TALER_EXCHANGE_HTTPD_HELPER_H -#define TALER_EXCHANGE_HTTPD_HELPER_H +#ifndef TALER_MERCHANT_HTTPD_HELPER_H +#define TALER_MERCHANT_HTTPD_HELPER_H #define TMH_MAX_FRACTIONAL_PRECISION_LEVEL 6 @@ -349,13 +349,13 @@ TMH_make_order_status_url (struct MHD_Connection *con, * @param hr a `TALER_EXCHANGE_HttpResponse` */ #define TMH_pack_exchange_reply(hr) \ - GNUNET_JSON_pack_uint64 ("exchange_code", (hr)->ec), \ - GNUNET_JSON_pack_uint64 ("exchange_http_status", (hr)->http_status), \ - GNUNET_JSON_pack_uint64 ("exchange_ec", (hr)->ec), /* LEGACY */ \ - GNUNET_JSON_pack_uint64 ("exchange_hc", (hr)->http_status), /* LEGACY */ \ - GNUNET_JSON_pack_allow_null ( \ - GNUNET_JSON_pack_object_incref ("exchange_reply", (json_t *) (hr)-> \ - reply)) + GNUNET_JSON_pack_uint64 ("exchange_code", (hr)->ec), \ + GNUNET_JSON_pack_uint64 ("exchange_http_status", (hr)->http_status), \ + GNUNET_JSON_pack_uint64 ("exchange_ec", (hr)->ec), /* LEGACY */ \ + GNUNET_JSON_pack_uint64 ("exchange_hc", (hr)->http_status), /* LEGACY */ \ + GNUNET_JSON_pack_allow_null ( \ + GNUNET_JSON_pack_object_incref ("exchange_reply", (json_t *) (hr)-> \ + reply)) /** diff --git a/src/backend/taler-merchant-httpd_private-delete-units-ID.c b/src/backend/taler-merchant-httpd_private-delete-units-ID.c @@ -44,12 +44,14 @@ TMH_private_delete_units_ID (const struct TMH_RequestHandler *rh, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; case GNUNET_DB_STATUS_SOFT_ERROR: + GNUNET_break (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_SOFT_FAILURE, "delete_unit"); case GNUNET_DB_STATUS_HARD_ERROR: default: + GNUNET_break (0); return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_STORE_FAILED, diff --git a/src/backend/taler-merchant-httpd_private-patch-units-ID.c b/src/backend/taler-merchant-httpd_private-patch-units-ID.c @@ -108,6 +108,7 @@ TMH_private_patch_units_ID (const struct TMH_RequestHandler *rh, { if (nud.unit_precision_level > TMH_MAX_UNIT_PRECISION_LEVEL) { + GNUNET_break_op (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED, @@ -135,6 +136,7 @@ TMH_private_patch_units_ID (const struct TMH_RequestHandler *rh, { if (! TALER_JSON_check_i18n (nud.unit_name_long_i18n)) { + GNUNET_break_op (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED, @@ -147,6 +149,7 @@ TMH_private_patch_units_ID (const struct TMH_RequestHandler *rh, { if (! TALER_JSON_check_i18n (nud.unit_name_short_i18n)) { + GNUNET_break_op (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED, @@ -173,6 +176,7 @@ TMH_private_patch_units_ID (const struct TMH_RequestHandler *rh, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; case GNUNET_DB_STATUS_SOFT_ERROR: + GNUNET_break (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_SOFT_FAILURE, @@ -180,6 +184,7 @@ TMH_private_patch_units_ID (const struct TMH_RequestHandler *rh, goto cleanup; case GNUNET_DB_STATUS_HARD_ERROR: default: + GNUNET_break (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_STORE_FAILED, diff --git a/src/backend/taler-merchant-httpd_private-post-units.c b/src/backend/taler-merchant-httpd_private-post-units.c @@ -23,10 +23,6 @@ #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> -/** - * Maximum fractional precision level accepted from clients. - */ -#define TMH_MAX_UNIT_PRECISION_LEVEL 6 MHD_RESULT TMH_private_post_units (const struct TMH_RequestHandler *rh, @@ -105,6 +101,7 @@ TMH_private_post_units (const struct TMH_RequestHandler *rh, } if (nud.unit_precision_level > TMH_MAX_UNIT_PRECISION_LEVEL) { + GNUNET_break_op (0); ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_GENERIC_PARAMETER_MALFORMED,