exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 555cbca862f3c56bfd7a2d6c785a05a511b0fd54
parent 9ae46f367e606f9b3866b361459e05a71be9f310
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 17 Sep 2023 12:57:08 +0200

add new GET /coins/-pub handler

Diffstat:
Msrc/exchange/taler-exchange-httpd_coins_get.c | 8++++++--
Msrc/exchange/taler-exchange-httpd_responses.c | 2++
Msrc/include/taler_exchange_service.h | 5+++--
3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_coins_get.c b/src/exchange/taler-exchange-httpd_coins_get.c @@ -41,6 +41,10 @@ add_response_headers (void *cls, { (void) cls; TALER_MHD_add_global_headers (response); + GNUNET_break (MHD_YES == + MHD_add_response_header (response, + MHD_HTTP_HEADER_CACHE_CONTROL, + "no-cache, public")); } @@ -62,7 +66,7 @@ TEH_handler_coins_get (struct TEH_RequestContext *rc, unsigned long long ev; if (1 != sscanf (etags, - "%llu%c", + "\"%llu\"%c", &ev, &dummy)) { @@ -112,7 +116,7 @@ TEH_handler_coins_get (struct TEH_RequestContext *rc, GNUNET_snprintf (etagp, sizeof (etagp), - "%llu", + "\"%llu\"", (unsigned long long) etag); history = TEH_RESPONSE_compile_transaction_history (coin_pub, tl); diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c @@ -698,8 +698,10 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( TALER_JSON_pack_ec (ec), GNUNET_JSON_pack_data_auto ("coin_pub", coin_pub), + // FIXME: to be kept only for some of the error types! GNUNET_JSON_pack_data_auto ("h_denom_pub", h_denom_pub), + // FIXME: to be removed! GNUNET_JSON_pack_array_steal ("history", history)); } diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h @@ -1171,7 +1171,8 @@ struct TALER_EXCHANGE_BatchDepositResult */ struct { - /* TODO: returning full details is not implemented */ + /* FIXME: returning full details is not implemented */ + // Should have 'coin_pub' here! } conflict; } details; @@ -1407,7 +1408,7 @@ struct TALER_EXCHANGE_CsRMeltResponse */ struct { - /* TODO: returning full details is not implemented */ + /* FIXME: returning full details is not implemented */ } gone; } details;