diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-24 19:55:14 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-24 19:55:14 +0200 |
commit | 77c92672cd0f83964e8a6992295595653b0f31db (patch) | |
tree | 9373dab724e351fe85a4af9f8345a22224086a43 | |
parent | c908781571cfbd27e54379adf59ce3a6781ccacc (diff) | |
download | merchant-77c92672cd0f83964e8a6992295595653b0f31db.tar.gz merchant-77c92672cd0f83964e8a6992295595653b0f31db.tar.bz2 merchant-77c92672cd0f83964e8a6992295595653b0f31db.zip |
return proper status codes when client sends bogus payment requests (#6817)
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 15 |
1 files 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 index a8c6a3ef..31ccbbea 100644 --- 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; } |