diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-claim.c | 2 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-tips.c | 51 |
2 files changed, 28 insertions, 25 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c index b1c15222..e7d0c845 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c @@ -69,8 +69,8 @@ claim_order (const char *instance_id, uint64_t order_serial; qs = TMH_db->lookup_contract_terms (TMH_db->cls, - order_id, instance_id, + order_id, contract_terms, &order_serial); } diff --git a/src/backend/taler-merchant-httpd_private-get-tips.c b/src/backend/taler-merchant-httpd_private-get-tips.c index 8aff670f..47fe3054 100644 --- a/src/backend/taler-merchant-httpd_private-get-tips.c +++ b/src/backend/taler-merchant-httpd_private-get-tips.c @@ -80,57 +80,60 @@ TMH_private_get_tips (const struct TMH_RequestHandler *rh, TALER_EC_PARAMETER_MALFORMED, "expired"); { - const char *offset_str; + const char *limit_str; - offset_str = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "offset"); - if (NULL == offset_str) + limit_str = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "limit"); + if (NULL == limit_str) { - offset = INT64_MAX; + limit = -20; } else { char dummy[2]; - unsigned long long ull; + long long ll; if (1 != - sscanf (offset_str, - "%llu%1s", - &ull, + sscanf (limit_str, + "%lld%1s", + &ll, dummy)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_PARAMETER_MALFORMED, - "date"); - offset = (uint64_t) ull; + "limit"); + limit = (uint64_t) ll; } } { - const char *limit_str; + const char *offset_str; - limit_str = MHD_lookup_connection_value (connection, - MHD_GET_ARGUMENT_KIND, - "limit"); - if (NULL == limit_str) + offset_str = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "offset"); + if (NULL == offset_str) { - limit = -20; + if (limit > 0) + offset = 0; + else + offset = INT64_MAX; } else { char dummy[2]; - long long ll; + unsigned long long ull; if (1 != - sscanf (limit_str, - "%lld%1s", - &ll, + sscanf (offset_str, + "%llu%1s", + &ull, dummy)) return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_PARAMETER_MALFORMED, - "limit"); - limit = (uint64_t) ll; + "offset"); + offset = (uint64_t) ull; } } |