merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 0107fd64aad2dcbf5497e2b6ef751eb8ec95b934
parent bf872f712e7af196341a0aacde1c0fd70b046e72
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 31 Jan 2023 15:37:49 +0100

fix #7607

Diffstat:
Msrc/backend/taler-merchant-httpd_private-post-orders.c | 27+++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2014, 2015, 2016, 2018, 2020, 2021 Taler Systems SA + (C) 2014-2023 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 @@ -930,9 +930,7 @@ patch_order (struct MHD_Connection *connection, refund_deadline))); } if ( (! GNUNET_TIME_absolute_is_zero (delivery_date.abs_time)) && - (GNUNET_TIME_timestamp_cmp (delivery_date, - <, - now)) ) + (GNUNET_TIME_absolute_is_past (delivery_date.abs_time)) ) { GNUNET_break_op (0); GNUNET_JSON_parse_free (spec); @@ -954,6 +952,27 @@ patch_order (struct MHD_Connection *connection, "pay_deadline", GNUNET_JSON_from_timestamp (t))); } + else if (GNUNET_TIME_absolute_is_past (pay_deadline.abs_time)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST, + NULL); + } + if ( (! GNUNET_TIME_absolute_is_zero (refund_deadline.abs_time)) && + (GNUNET_TIME_absolute_is_past (refund_deadline.abs_time)) ) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return TALER_MHD_reply_with_error ( + connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST, + NULL); + } if (GNUNET_TIME_absolute_is_never (wire_deadline.abs_time)) {