summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/taler-merchant-httpd.c8
-rw-r--r--src/backend/taler-merchant-httpd_private-post-instances.c2
-rw-r--r--src/lib/merchant_api_delete_instance.c2
-rw-r--r--src/lib/merchant_api_delete_product.c2
-rw-r--r--src/lib/merchant_api_get_instance.c2
-rw-r--r--src/lib/merchant_api_get_instances.c2
-rw-r--r--src/lib/merchant_api_get_product.c2
-rw-r--r--src/lib/merchant_api_get_products.c2
-rw-r--r--src/lib/merchant_api_lock_product.c2
-rw-r--r--src/lib/merchant_api_patch_instance.c2
-rw-r--r--src/lib/merchant_api_patch_product.c2
-rw-r--r--src/lib/merchant_api_post_instances.c2
-rw-r--r--src/lib/merchant_api_post_products.c2
-rw-r--r--src/testing/testing_api_cmd_post_instances.c7
14 files changed, 21 insertions, 18 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 25c7bab4..d5bcec60 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -832,11 +832,9 @@ url_handler (void *cls,
}
};
static struct TMH_RequestHandler h404 = {
- .mime_type = "text/html",
- .data = "<html><title>404: not found</title>"
- "<body>404: not found</body></html>",
- .data_size = strlen ("<html><title>404: not found</title>"
- "<body>404: not found</body></html>"),
+ .mime_type = "application/json",
+ .data = "{\"code\":10}",
+ .data_size = strlen ("{\"code\":10}"),
.handler = &TMH_MHD_handler_static_response,
.response_code = MHD_HTTP_NOT_FOUND
};
diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c
index 75c5b2e6..228cc3a2 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -149,7 +149,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler *rh,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_json ("payto_uris",
&payto_uris),
- GNUNET_JSON_spec_string ("instance",
+ GNUNET_JSON_spec_string ("id",
&id),
GNUNET_JSON_spec_string ("name",
&name),
diff --git a/src/lib/merchant_api_delete_instance.c b/src/lib/merchant_api_delete_instance.c
index 01852c45..edf73f87 100644
--- a/src/lib/merchant_api_delete_instance.c
+++ b/src/lib/merchant_api_delete_instance.c
@@ -139,7 +139,7 @@ instance_delete (struct GNUNET_CURL_Context *ctx,
char *path;
GNUNET_asprintf (&path,
- "instances/%s",
+ "private/instances/%s",
instance_id);
if (purge)
idh->url = TALER_url_join (backend_url,
diff --git a/src/lib/merchant_api_delete_product.c b/src/lib/merchant_api_delete_product.c
index e406581c..88607b42 100644
--- a/src/lib/merchant_api_delete_product.c
+++ b/src/lib/merchant_api_delete_product.c
@@ -144,7 +144,7 @@ TALER_MERCHANT_product_delete (
char *path;
GNUNET_asprintf (&path,
- "products/%s",
+ "private/products/%s",
product_id);
pdh->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_get_instance.c b/src/lib/merchant_api_get_instance.c
index 6499a6e5..98e7f146 100644
--- a/src/lib/merchant_api_get_instance.c
+++ b/src/lib/merchant_api_get_instance.c
@@ -244,7 +244,7 @@ TALER_MERCHANT_instance_get (struct GNUNET_CURL_Context *ctx,
char *path;
GNUNET_asprintf (&path,
- "instances/%s",
+ "private/instances/%s",
instance_id);
igh->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_get_instances.c b/src/lib/merchant_api_get_instances.c
index 830e9b5f..0ad33faa 100644
--- a/src/lib/merchant_api_get_instances.c
+++ b/src/lib/merchant_api_get_instances.c
@@ -249,7 +249,7 @@ TALER_MERCHANT_instances_get (struct GNUNET_CURL_Context *ctx,
igh->cb = instances_cb;
igh->cb_cls = instances_cb_cls;
igh->url = TALER_url_join (backend_url,
- "instances",
+ "private/instances",
NULL);
if (NULL == igh->url)
{
diff --git a/src/lib/merchant_api_get_product.c b/src/lib/merchant_api_get_product.c
index fc33dedf..0388c793 100644
--- a/src/lib/merchant_api_get_product.c
+++ b/src/lib/merchant_api_get_product.c
@@ -212,7 +212,7 @@ TALER_MERCHANT_product_get (
char *path;
GNUNET_asprintf (&path,
- "products/%s",
+ "private/products/%s",
product_id);
pgh->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_get_products.c b/src/lib/merchant_api_get_products.c
index 86e93cdc..c3edbde0 100644
--- a/src/lib/merchant_api_get_products.c
+++ b/src/lib/merchant_api_get_products.c
@@ -222,7 +222,7 @@ TALER_MERCHANT_products_get (
pgh->cb = cb;
pgh->cb_cls = cb_cls;
pgh->url = TALER_url_join (backend_url,
- "products",
+ "private/products",
NULL);
if (NULL == pgh->url)
{
diff --git a/src/lib/merchant_api_lock_product.c b/src/lib/merchant_api_lock_product.c
index 9a831508..3b91d47a 100644
--- a/src/lib/merchant_api_lock_product.c
+++ b/src/lib/merchant_api_lock_product.c
@@ -197,7 +197,7 @@ TALER_MERCHANT_product_lock (
char *path;
GNUNET_asprintf (&path,
- "products/%s/lock",
+ "private/products/%s/lock",
product_id);
plh->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c
index 93f3b9fb..f4102357 100644
--- a/src/lib/merchant_api_patch_instance.c
+++ b/src/lib/merchant_api_patch_instance.c
@@ -243,7 +243,7 @@ TALER_MERCHANT_instance_patch (
char *path;
GNUNET_asprintf (&path,
- "instances/%s",
+ "private/instances/%s",
instance_id);
iph->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_patch_product.c b/src/lib/merchant_api_patch_product.c
index 9b0aead2..4fba0974 100644
--- a/src/lib/merchant_api_patch_product.c
+++ b/src/lib/merchant_api_patch_product.c
@@ -235,7 +235,7 @@ TALER_MERCHANT_product_patch (
char *path;
GNUNET_asprintf (&path,
- "products/%s",
+ "private/products/%s",
product_id);
pph->url = TALER_url_join (backend_url,
path,
diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c
index 4548bc0c..55a45e5c 100644
--- a/src/lib/merchant_api_post_instances.c
+++ b/src/lib/merchant_api_post_instances.c
@@ -244,7 +244,7 @@ TALER_MERCHANT_instances_post (
iph->cb = cb;
iph->cb_cls = cb_cls;
iph->url = TALER_url_join (backend_url,
- "/instances",
+ "private/instances",
NULL);
if (NULL == iph->url)
{
diff --git a/src/lib/merchant_api_post_products.c b/src/lib/merchant_api_post_products.c
index 77cc8590..7c3f57ba 100644
--- a/src/lib/merchant_api_post_products.c
+++ b/src/lib/merchant_api_post_products.c
@@ -228,7 +228,7 @@ TALER_MERCHANT_products_post (
pph->cb = cb;
pph->cb_cls = cb_cls;
pph->url = TALER_url_join (backend_url,
- "products",
+ "private/products",
NULL);
if (NULL == pph->url)
{
diff --git a/src/testing/testing_api_cmd_post_instances.c b/src/testing/testing_api_cmd_post_instances.c
index 26efd0be..71626008 100644
--- a/src/testing/testing_api_cmd_post_instances.c
+++ b/src/testing/testing_api_cmd_post_instances.c
@@ -203,6 +203,7 @@ post_instances_cleanup (void *cls,
}
json_decref (pis->address);
json_decref (pis->jurisdiction);
+ GNUNET_free (pis->payto_uris);
GNUNET_free (pis);
}
@@ -251,7 +252,11 @@ TALER_TESTING_cmd_merchant_post_instances2 (
pis->instance_id = instance_id;
pis->http_status = http_status;
pis->payto_uris_length = payto_uris_length;
- pis->payto_uris = payto_uris;
+ pis->payto_uris = GNUNET_new_array (payto_uris_length,
+ const char *);
+ memcpy (pis->payto_uris,
+ payto_uris,
+ sizeof (const char *) * payto_uris_length);
pis->name = name;
pis->address = address; /* ownership transfer! */
pis->jurisdiction = jurisdiction; /* ownership transfer! */