summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-06-13 18:45:50 +0200
committerChristian Grothoff <christian@grothoff.org>2020-06-13 18:45:50 +0200
commite39aa8b4e8df86273a3f5f823a4cba3c844c51cb (patch)
tree2b8e07af72c12af3770f5a2ce0b252c800c935b5
parent1ceb91a1f401f6dea116a71e6f7eea8877dd853c (diff)
downloadmerchant-e39aa8b4e8df86273a3f5f823a4cba3c844c51cb.tar.gz
merchant-e39aa8b4e8df86273a3f5f823a4cba3c844c51cb.tar.bz2
merchant-e39aa8b4e8df86273a3f5f823a4cba3c844c51cb.zip
fix #5957
-rw-r--r--src/backend/taler-merchant-httpd_private-get-transfers.c2
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c28
2 files changed, 23 insertions, 7 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c b/src/backend/taler-merchant-httpd_private-get-transfers.c
index c2f12107..f98b785b 100644
--- a/src/backend/taler-merchant-httpd_private-get-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-get-transfers.c
@@ -93,7 +93,7 @@ TMH_private_get_transfers (const struct TMH_RequestHandler *rh,
const char *payto_uri;
struct GNUNET_TIME_Absolute before = GNUNET_TIME_UNIT_FOREVER_ABS;
struct GNUNET_TIME_Absolute after = GNUNET_TIME_UNIT_ZERO_ABS;
- int64_t limit = -20; /* FIXME: default? Nothing documented!!? */
+ int64_t limit = -20;
uint64_t offset;
enum TALER_EXCHANGE_YesNoAll verified;
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 7c6a0c39..e7b04e3d 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -542,14 +542,32 @@ patch_order (struct MHD_Connection *connection,
if (NULL == json_object_get (order,
"refund_deadline"))
{
- struct GNUNET_TIME_Absolute zero = { 0 };
+ const char *refdel_s;
+ struct GNUNET_TIME_Absolute rd = { 0 };
- // FIXME: #5957: add way to compute non-zero refund deadline
- // from 'refund delay' specified "somewhere".
+ refdel_s = MHD_lookup_connection_value (connection,
+ MHD_GET_ARGUMENT_KIND,
+ "refund_delay");
+ if (NULL == refdel_s)
+ {
+ struct GNUNET_TIME_Relative r;
+
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_fancy_time_to_relative (refdel_s,
+ &r))
+ {
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_PARAMETER_MALFORMED,
+ "refund_delay");
+
+ }
+ rd = GNUNET_TIME_relative_to_absolute (r);
+ }
GNUNET_assert (0 ==
json_object_set_new (order,
"refund_deadline",
- GNUNET_JSON_from_time_abs (zero)));
+ GNUNET_JSON_from_time_abs (rd)));
}
if (NULL == json_object_get (order,
@@ -909,8 +927,6 @@ merge_inventory (struct MHD_Connection *connection,
inventory_products,
uuids_length,
uuids);
-
-
}