summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-25 20:32:36 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-25 20:32:36 +0200
commitd354d119db7ca0195cb93140bf3160b11449fa92 (patch)
treeae96671396a0073d4416cb59d57a7a54f87bd20b /src/backend/taler-merchant-httpd_post-orders-ID-paid.c
parent0acefc910ff1b86aa04300310d63e3ea88d509de (diff)
downloadmerchant-d354d119db7ca0195cb93140bf3160b11449fa92.tar.gz
merchant-d354d119db7ca0195cb93140bf3160b11449fa92.tar.bz2
merchant-d354d119db7ca0195cb93140bf3160b11449fa92.zip
fix #6432
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-paid.c')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-paid.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
index 623b2760..f48e69f8 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
@@ -84,12 +84,10 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
&hc->instance->merchant_pub.eddsa_pub))
{
GNUNET_break_op (0);
- return TALER_MHD_reply_json_pack (
- connection,
- MHD_HTTP_FORBIDDEN,
- "{s:s, s:I}",
- "hint", "deposit signature invalid",
- "code", (json_int_t) TALER_EC_PAID_COIN_SIGNATURE_INVALID);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_FORBIDDEN,
+ TALER_EC_PAID_COIN_SIGNATURE_INVALID,
+ NULL);
}
TMH_db->preflight (TMH_db->cls);
@@ -111,19 +109,17 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_PAID_DB_ERROR,
- "database error looking up contract");
+ NULL);
}
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Unknown order id given: `%s'\n",
order_id);
- return TALER_MHD_reply_json_pack (
- connection,
- MHD_HTTP_NOT_FOUND,
- "{s:s, s:I}",
- "hint", "order unknown",
- "code", (json_int_t) TALER_EC_PAID_ORDER_UNKNOWN);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_NOT_FOUND,
+ TALER_EC_PAID_ORDER_UNKNOWN,
+ order_id);
}
{
@@ -144,12 +140,10 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
&h_contract_terms))
{
json_decref (contract_terms);
- return TALER_MHD_reply_json_pack (
- connection,
- MHD_HTTP_CONFLICT,
- "{s:s, s:I}",
- "hint", "contract hash does not match this order",
- "code", (json_int_t) TALER_EC_PAID_CONTRACT_HASH_MISMATCH);
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_CONFLICT,
+ TALER_EC_PAID_CONTRACT_HASH_MISMATCH,
+ NULL);
}
}
if (NULL != session_id)
@@ -162,7 +156,7 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_PAID_DB_ERROR,
- "failed to start database transaction");
+ NULL);
}
qs = TMH_db->mark_contract_paid (TMH_db->cls,
hc->instance->settings.id,
@@ -182,7 +176,7 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_PAID_DB_ERROR,
- "failed to update contract's session id");
+ NULL);
}
}
json_decref (contract_terms);