diff options
-rw-r--r-- | src/backend/taler-merchant-httpd_config.c | 17 |
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; } |