aboutsummaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_get-orders-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-13 23:14:14 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-13 23:14:14 +0200
commit80a224c1f0fc64c75c15b525c6d78e607f3351f3 (patch)
tree32dcabbba2c65b504bba732c1a5c38d4cde087df /src/backend/taler-merchant-httpd_get-orders-ID.c
parente0c0cfd6f3b1ef5287a413ffd9aa361be5d4b0ea (diff)
-preps for 0.8.1
Diffstat (limited to 'src/backend/taler-merchant-httpd_get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_get-orders-ID.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c
index 430a314e..29a906c6 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -914,7 +914,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
{
god->claimed = true;
}
- else if (! token_match)
+ else if (! token_match) // FIXME: This 'if' seems unnecessary, 'token_match' would seem always 'false' here.
{
struct TALER_ClaimTokenP db_claim_token;
struct GNUNET_HashCode unused;
@@ -939,6 +939,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
TALER_EC_GENERIC_DB_FETCH_FAILED,
"lookup_order");
}
+ // FIXME: simplify: contract_available is always FALSE here!
if ( (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) &&
(! contract_available) )
{
@@ -950,6 +951,9 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
TALER_EC_MERCHANT_GENERIC_ORDER_UNKNOWN,
order_id);
}
+ // FIXME: given that contract_available is always
+ // false and thus qs always non-zero, the RVAL simplifies
+ // to 'false', which should already be the LVAL.
god->claimed = ( (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) ||
(contract_available) );
token_match = (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs) &&
@@ -979,6 +983,11 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
contract_available,
contract_match,
god->claimed);
+ /* FIXME: this should be strengthend: two conditions
+ (claim_token_provided && ! token_match) ||
+ (h_contract_provided && ! contract_match)
+ in separate branches with more specific error
+ replies (about token or contract) */
if ( (claim_token_provided || h_contract_provided) &&
(! (token_match || contract_match)) )
{
@@ -994,6 +1003,10 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
{
const char *public_reorder_url;
+ /* FIXME: taking this branch seems wrong for unclaimed
+ orders without claim token! Also seems to contradict
+ the spec, as there 'authOk' is defined to include the
+ || "! ord.requireClaimToken" part! */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Neither claim token nor contract matched\n");
public_reorder_url = json_string_value (json_object_get (