commit 77c92672cd0f83964e8a6992295595653b0f31db
parent c908781571cfbd27e54379adf59ce3a6781ccacc
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 24 Apr 2021 19:55:14 +0200
return proper status codes when client sends bogus payment requests (#6817)
Diffstat:
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- (C) 2014-2020 Taler Systems SA
+ (C) 2014-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -893,7 +893,8 @@ process_pay_with_exchange (void *cls,
pc->refund_deadline,
&dc->coin_sig,
&deposit_cb,
- dc);
+ dc,
+ &ec);
if (NULL == dc->dh)
{
/* Signature was invalid or some other constraint was not satisfied. If
@@ -902,15 +903,11 @@ process_pay_with_exchange (void *cls,
GNUNET_break_op (0);
resume_pay_with_response (
pc,
- MHD_HTTP_FORBIDDEN,
+ TALER_ErrorCode_get_http_status_safe (ec),
TALER_MHD_make_json_pack (
"{s:s, s:I, s:i}",
- "hint",
- TALER_ErrorCode_get_hint (
- TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID),
- "code",
- (json_int_t)
- TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID,
+ "hint", TALER_ErrorCode_get_hint (ec),
+ "code", (json_int_t) ec,
"coin_idx", i));
return;
}