aboutsummaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-04 01:06:25 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-04 01:06:25 +0100
commita046a9c17ccd5861fe2e44de0b77e9bf1daaacad (patch)
treee4f6a903f55a47798f42ee465dbf85d55cf08156 /src/backend/taler-merchant-httpd_private-get-orders-ID.c
parentd2d2d773cb2cc23f198d07392bab463beb2e2e04 (diff)
remove silly code duplication
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.c44
1 files changed, 13 insertions, 31 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 a19c64a4..4f7959bd 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -885,7 +885,6 @@ static void
phase_check_paid (struct GetOrderRequestContext *gorc)
{
struct TMH_HandlerContext *hc = gorc->hc;
- enum GNUNET_DB_QueryStatus qs;
if (gorc->order_only)
{
@@ -1048,22 +1047,21 @@ phase_unpaid_finish (struct GetOrderRequestContext *gorc)
}
/* User never paid for this order, suspend waiting
on payment or return details. */
-
+ if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Suspending GET /private/orders/%s\n",
+ hc->infix);
+ GNUNET_CONTAINER_DLL_insert (gorc_head,
+ gorc_tail,
+ gorc);
+ gorc->phase = GOP_SUSPENDED_ON_UNPAID;
+ gorc->suspended = GNUNET_YES;
+ MHD_suspend_connection (gorc->sc.con);
+ return;
+ }
if (! gorc->order_only)
{
- if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Suspending GET /private/orders/%s\n",
- hc->infix);
- GNUNET_CONTAINER_DLL_insert (gorc_head,
- gorc_tail,
- gorc);
- gorc->phase = GOP_SUSPENDED_ON_UNPAID;
- gorc->suspended = GNUNET_YES;
- MHD_suspend_connection (gorc->sc.con);
- return;
- }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Order %s claimed but not paid yet\n",
hc->infix);
@@ -1077,22 +1075,6 @@ phase_unpaid_finish (struct GetOrderRequestContext *gorc)
"claimed")));
return;
}
-
- /* FIXME: too similar to logic above! */
- if (GNUNET_TIME_absolute_is_future (gorc->sc.long_poll_timeout))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Suspending GET /private/orders/%s\n",
- hc->infix);
- GNUNET_assert (GNUNET_NO == gorc->suspended);
- GNUNET_CONTAINER_DLL_insert (gorc_head,
- gorc_tail,
- gorc);
- gorc->suspended = GNUNET_YES;
- gorc->phase = GOP_SUSPENDED_ON_UNPAID;
- MHD_suspend_connection (gorc->sc.con);
- return;
- }
taler_pay_uri = TMH_make_taler_pay_uri (gorc->sc.con,
hc->infix,
gorc->session_id,