From a24a8eef9e71866f738f88e93d628c881014294b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 5 Feb 2024 10:40:38 +0100 Subject: add missing /config endpoints --- src/bank-lib/fakebank_tbr.c | 20 ++++++++++++++++++++ src/bank-lib/fakebank_twg.c | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'src/bank-lib') diff --git a/src/bank-lib/fakebank_tbr.c b/src/bank-lib/fakebank_tbr.c index 94d6ea84f..56681841c 100644 --- a/src/bank-lib/fakebank_tbr.c +++ b/src/bank-lib/fakebank_tbr.c @@ -46,6 +46,26 @@ TALER_FAKEBANK_tbr_main_ ( "Fakebank - Anastasis API: serving URL `%s' for account `%s'\n", url, account); + + if ( (0 == strcmp (url, + "/config")) && + (0 == strcasecmp (method, + MHD_HTTP_METHOD_GET)) ) + { + /* GET /config */ + return TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_string ("version", + "0:0:0"), + GNUNET_JSON_pack_string ("currency", + h->currency), + GNUNET_JSON_pack_string ("implementation", + "urn:net:taler:specs:bank:fakebank"), + GNUNET_JSON_pack_string ("name", + "taler-revenue")); + } + if (0 == strcasecmp (method, MHD_HTTP_METHOD_GET)) { diff --git a/src/bank-lib/fakebank_twg.c b/src/bank-lib/fakebank_twg.c index 353821bd2..775bbb58d 100644 --- a/src/bank-lib/fakebank_twg.c +++ b/src/bank-lib/fakebank_twg.c @@ -49,6 +49,24 @@ TALER_FAKEBANK_twg_main_ ( "Fakebank TWG, serving URL `%s' for account `%s'\n", url, account); + if ( (0 == strcmp (url, + "/config")) && + (0 == strcasecmp (method, + MHD_HTTP_METHOD_GET)) ) + { + /* GET /config */ + return TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_string ("version", + "0:0:0"), + GNUNET_JSON_pack_string ("currency", + h->currency), + GNUNET_JSON_pack_string ("implementation", + "urn:net:taler:specs:bank:fakebank"), + GNUNET_JSON_pack_string ("name", + "taler-wire-gateway")); + } if (0 == strcasecmp (method, MHD_HTTP_METHOD_GET)) { -- cgit v1.2.3