summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_patch_instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_patch_instance.c')
-rw-r--r--src/lib/merchant_api_patch_instance.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c
index 721f8dd1..536fbdcf 100644
--- a/src/lib/merchant_api_patch_instance.c
+++ b/src/lib/merchant_api_patch_instance.c
@@ -110,6 +110,11 @@ handle_patch_instance_finished (void *cls,
* or the merchant is buggy (or API version conflict);
* just pass JSON reply to the application */
break;
+ case MHD_HTTP_UNAUTHORIZED:
+ hr.ec = TALER_JSON_get_error_code (json);
+ hr.hint = TALER_JSON_get_error_hint (json);
+ /* Nothing really to verify, merchant says we need to authenticate. */
+ break;
case MHD_HTTP_FORBIDDEN:
hr.ec = TALER_JSON_get_error_code (json);
hr.hint = TALER_JSON_get_error_hint (json);
@@ -172,6 +177,19 @@ TALER_MERCHANT_instance_patch (
json_t *jpayto_uris;
json_t *req_obj;
+ if (NULL != auth_token)
+ {
+ if (0 != strncasecmp (RFC_8959_PREFIX,
+ auth_token,
+ strlen (RFC_8959_PREFIX)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Authentication token must start with `%s'\n",
+ RFC_8959_PREFIX);
+ return NULL;
+ }
+ auth_token += strlen (RFC_8959_PREFIX);
+ }
jpayto_uris = json_array ();
if (NULL == jpayto_uris)
{