merchant

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

commit bd78152f47c4f71291f3dd0671fe2601e4c6a760
parent 18bbcc6cb5060befc206c097254567c823fdef23
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  6 Jul 2026 00:27:52 +0200

misc fixes

Diffstat:
Msrc/backenddb/update_product.c | 2+-
Msrc/lib/merchant_api_post-orders-ORDER_ID-refund.c | 16++++++++++++++++
Msrc/lib/test_merchant_api_common.c | 2+-
3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/backenddb/update_product.c b/src/backenddb/update_product.c @@ -97,7 +97,7 @@ TALER_MERCHANTDB_update_product ( }; enum GNUNET_DB_QueryStatus qs; - if ( (pd->total_stock > pd->total_lost + pd->total_sold) || + if ( (pd->total_stock < pd->total_lost + pd->total_sold) || (pd->total_lost > pd->total_lost + pd->total_sold) /* integer overflow */) { diff --git a/src/lib/merchant_api_post-orders-ORDER_ID-refund.c b/src/lib/merchant_api_post-orders-ORDER_ID-refund.c @@ -264,10 +264,26 @@ handle_refund_finished (void *cls, break; case MHD_HTTP_NO_CONTENT: break; + case MHD_HTTP_FORBIDDEN: + orr.hr.ec = TALER_JSON_get_error_code (json); + orr.hr.hint = TALER_JSON_get_error_hint (json); + break; case MHD_HTTP_NOT_FOUND: orr.hr.ec = TALER_JSON_get_error_code (json); orr.hr.hint = TALER_JSON_get_error_hint (json); break; + case MHD_HTTP_GONE: + orr.hr.ec = TALER_JSON_get_error_code (json); + orr.hr.hint = TALER_JSON_get_error_hint (json); + break; + case MHD_HTTP_CONTENT_TOO_LARGE: + orr.hr.ec = TALER_JSON_get_error_code (json); + orr.hr.hint = TALER_JSON_get_error_hint (json); + break; + case MHD_HTTP_INTERNAL_SERVER_ERROR: + orr.hr.ec = TALER_JSON_get_error_code (json); + orr.hr.hint = TALER_JSON_get_error_hint (json); + break; default: GNUNET_break_op (0); TALER_MERCHANT_parse_error_details_ (json, diff --git a/src/lib/test_merchant_api_common.c b/src/lib/test_merchant_api_common.c @@ -134,7 +134,7 @@ main (int argc, &rd)); GNUNET_assert (0 == strcmp (rd.merchant_host, "localhost")); - GNUNET_assert (NULL == pd.merchant_prefix_path); + GNUNET_assert (NULL == rd.merchant_prefix_path); GNUNET_assert (0 == strcmp (rd.order_id, "my-order")); GNUNET_assert (0 == strcmp (rd.ssid,