aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-09-01 22:46:24 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-09-01 22:46:24 +0200
commit7a1a7b5ba308fd4fbc6125df960d8841ba9eff7b (patch)
treed733bd6407ddea3faa9fdba86ad7415cac3b8333
parent50583b73f0b69bb2a76044bcd13669aefb7cc057 (diff)
teach config about instancesdemo-2019-08-31-00
-rw-r--r--src/backend/taler-merchant-httpd_config.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_config.c b/src/backend/taler-merchant-httpd_config.c
index 931270f1..51d44729 100644
--- a/src/backend/taler-merchant-httpd_config.c
+++ b/src/backend/taler-merchant-httpd_config.c
@@ -49,12 +49,27 @@ MH_handler_config (struct TMH_RequestHandler *rh,
size_t *upload_data_size)
{
int ret;
+ const char *instance_str;
+ struct MerchantInstance *mi;
+
+ instance_str = MHD_lookup_connection_value (connection,
+ MHD_GET_ARGUMENT_KIND,
+ "instance");
+ if (NULL == instance_str)
+ instance_str = "default";
+
+ mi = TMH_lookup_instance (instance_str);
+
+ if (NULL == mi)
+ return TMH_RESPONSE_reply_bad_request (connection,
+ TALER_EC_CHECK_PAYMENT_INSTANCE_UNKNOWN,
+ "merchant instance unknown");
+
ret = TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_OK,
"{s:s}",
"currency", TMH_currency);
-
return ret;
}