merchant

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

commit 8d25278cbdb7f6af73c1fe295e069526e0bded62
parent e2b2e60859f0158f0e12cd55ca5cde8b00f7e862
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 24 Mar 2021 10:42:20 -0300

fix 0006814: looking up for order using date parameter and positive delta returns empty

Diffstat:
Msrc/backend/taler-merchant-httpd_private-get-orders.c | 57++++++++++++++++++++++++++++++---------------------------
1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c @@ -515,33 +515,6 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, TALER_EC_GENERIC_PARAMETER_MALFORMED, "wired"); { - const char *start_row_str; - - start_row_str = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "start"); - if (NULL == start_row_str) - { - of.start_row = INT64_MAX; - } - else - { - char dummy[2]; - unsigned long long ull; - - if (1 != - sscanf (start_row_str, - "%llu%1s", - &ull, - dummy)) - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - "date"); - of.start_row = (uint64_t) ull; - } - } - { const char *delta_str; delta_str = MHD_lookup_connection_value (connection, @@ -593,6 +566,36 @@ TMH_private_get_orders (const struct TMH_RequestHandler *rh, } } { + const char *start_row_str; + + start_row_str = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "start"); + if (NULL == start_row_str) + { + if (of.delta > 0) + of.start_row = 0; + else + of.start_row = INT64_MAX; + } + else + { + char dummy[2]; + unsigned long long ull; + + if (1 != + sscanf (start_row_str, + "%llu%1s", + &ull, + dummy)) + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "start"); + of.start_row = (uint64_t) ull; + } + } + { const char *timeout_ms_str; timeout_ms_str = MHD_lookup_connection_value (connection,