aboutsummaryrefslogtreecommitdiff
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.c37
1 files changed, 36 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 6bba091b..3688bb87 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -158,11 +158,18 @@ struct GetOrderRequestContext
struct GNUNET_SCHEDULER_Task *tt;
/**
- * Database event we are waiting on to be resuming.
+ * Database event we are waiting on to be resuming
+ * for payment or refunds.
*/
struct GNUNET_DB_EventHandler *eh;
/**
+ * Database event we are waiting on to be resuming
+ * for session capture.
+ */
+ struct GNUNET_DB_EventHandler *seh;
+
+ /**
* Contract terms of the payment we are checking. NULL when they
* are not (yet) known.
*/
@@ -656,6 +663,11 @@ gorc_cleanup (void *cls)
TMH_db->event_listen_cancel (gorc->eh);
gorc->eh = NULL;
}
+ if (NULL != gorc->seh)
+ {
+ TMH_db->event_listen_cancel (gorc->seh);
+ gorc->seh = NULL;
+ }
GNUNET_free (gorc);
}
@@ -870,6 +882,29 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh,
timeout,
&resume_by_event,
gorc);
+ if ( (NULL != gorc->session_id) &&
+ (NULL != gorc->fulfillment_url) )
+ {
+#ifndef TALER_API_VERSION
+#define TALER_DBEVENT_MERCHANT_SESSION_CAPTURED 1103
+#endif
+ struct TMH_SessionEvent session_eh = {
+ .header.size = htons (sizeof (session_eh)),
+ .header.type = htons (TALER_DBEVENT_MERCHANT_SESSION_CAPTURED)
+ };
+
+ GNUNET_CRYPTO_hash (gorc->session_id,
+ strlen (gorc->session_id),
+ &session_eh.h_session_id);
+ GNUNET_CRYPTO_hash (gorc->fulfillment_url,
+ strlen (gorc->fulfillment_url),
+ &session_eh.h_fulfillment_url);
+ gorc->seh = TMH_db->event_listen (TMH_db->cls,
+ &session_eh.header,
+ timeout,
+ &resume_by_event,
+ gorc);
+ }
}
}
else