merchant

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

commit a4911b5a53ee635eafe3288de9572d9116576cf9
parent e0d40ac048b6da31f5f7759cab1a8612717ad45c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 25 Feb 2026 22:52:46 +0100

untested fix for #11162

Diffstat:
Msrc/backend/taler-merchant-httpd_post-reports-ID.c | 40+++++++++++++++++++++++++++++++++++++++-
Msrc/testing/test_merchant_transfer_tracking.sh | 22+++++++++++++++++++++-
2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-reports-ID.c b/src/backend/taler-merchant-httpd_post-reports-ID.c @@ -130,8 +130,46 @@ TMH_post_reports_ID ( { enum GNUNET_GenericReturnValue ret; bool is_public; /* ignored: access control never applies for reports */ + char *q; + + /* This rewrites the request: force request handler to match report! */ + q = strchr (data_source, + '?'); + if (NULL != q) + { + /* Terminate URI at '?' for dispatching, parse + query parameters and add them to this connection */ + *q = '\0'; + for (char *tok = strtok (q + 1, + "&"); + NULL != tok; + tok = strtok (NULL, + "&")) + { + char *eq; + + eq = strchr (tok, + '='); + if (NULL == eq) + { + GNUNET_break (MHD_YES == + MHD_set_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + tok, + NULL)); + } + else + { + *eq = '\0'; + GNUNET_break (MHD_YES == + MHD_set_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + tok, + eq + 1)); + } + } + } - /* This rewrite request: force request handler to match report! */ hc->rh = NULL; /* just to make it clear: current one will NOT remain */ ret = TMH_dispatch_request (hc, data_source, diff --git a/src/testing/test_merchant_transfer_tracking.sh b/src/testing/test_merchant_transfer_tracking.sh @@ -175,7 +175,6 @@ then exit_fail "Expected 200 OK. Got: $STATUS" fi - # CREATE ORDER AND SELL IT echo -n "Creating order to be paid..." STATUS=$(curl 'http://localhost:9966/instances/test/private/orders' \ @@ -188,9 +187,30 @@ then exit_fail "Expected 200 ok, order created. got: $STATUS" fi +echo " OK" + ORDER_ID=$(jq -e -r .order_id < "$LAST_RESPONSE") #TOKEN=$(jq -e -r .token < "$LAST_RESPONSE") +# Check max-age argument +echo -n "Checking order list generation with max-age..." +STATUS=$(curl 'http://localhost:9966/instances/test/private/orders?max_age=3600000' \ + -H 'Accept: application/pdf' \ + -w "%{http_code}" \ + -s \ + -o "$LAST_RESPONSE") + +if [ "$STATUS" != "200" ] +then + cat "$LAST_RESPONSE" + exit_fail "Expected 200 ok, order created. got: $STATUS" +fi +# If we want to see the order list... +# cat $LAST_RESPONSE > order-list.pdf +echo " OK" + + +echo -n "Checking order status before claiming it..." STATUS=$(curl "http://localhost:9966/instances/test/private/orders/${ORDER_ID}" \ -w "%{http_code}" -s -o "$LAST_RESPONSE")