summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index 87408fe5..de5cb980 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -825,6 +825,14 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
hc->infix,
&gorc->contract_terms,
&gorc->order_serial);
+ if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+ {
+ /* We don't have contract terms, but the order may still exist. */
+ qs = TMH_db->lookup_order (TMH_db->cls,
+ hc->instance->settings.id,
+ hc->infix,
+ &gorc->contract_terms);
+ }
if (0 > qs)
{
/* single, read-only SQL statements should never cause
@@ -906,7 +914,7 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
gorc->session_id,
&paid,
&wired);
- if (0 >= qs)
+ if (0 > qs)
{
/* single, read-only SQL statements should never cause
serialization problems, and the entry should exist as per above */
@@ -916,6 +924,7 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
TALER_EC_GET_ORDERS_DB_FETCH_PAYMENT_STATUS,
"DB error fetching payment status");
}
+ /* qs == 0: the order hasn't been claimed, but this is okay. */
if ((! paid) &&
(NULL != gorc->session_id))
{