summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-paid.c')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-paid.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
index d274c1f6..52f233eb 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c
@@ -23,6 +23,7 @@
* @author Christian Grothoff
*/
#include "platform.h"
+#include <taler/taler_dbevents.h>
#include <taler/taler_signatures.h>
#include <taler/taler_json_lib.h>
#include <taler/taler_exchange_service.h>
@@ -33,19 +34,19 @@
* Use database to notify other clients about the
* session being captured.
*
+ * @param hc http context
* @param session_id the captured session
* @param fulfillment_url the URL that is now paid for by @a session_id
*/
static void
-trigger_session_notification (const char *session_id,
+trigger_session_notification (struct TMH_HandlerContext *hc,
+ const char *session_id,
const char *fulfillment_url)
{
-#ifndef TALER_API_VERSION
-#define TALER_DBEVENT_MERCHANT_SESSION_CAPTURED 1103
-#endif
- struct TMH_SessionEvent session_eh = {
+ struct TMH_SessionEventP session_eh = {
.header.size = htons (sizeof (session_eh)),
- .header.type = htons (TALER_DBEVENT_MERCHANT_SESSION_CAPTURED)
+ .header.type = htons (TALER_DBEVENT_MERCHANT_SESSION_CAPTURED),
+ .merchant_pub = hc->instance->merchant_pub
};
GNUNET_CRYPTO_hash (session_id,
@@ -201,21 +202,11 @@ TMH_post_orders_ID_paid (const struct TMH_RequestHandler *rh,
/* Wake everybody up who waits for this fulfillment_url and session_id */
if ( (NULL != fulfillment_url) &&
(NULL != session_id) )
- trigger_session_notification (session_id,
+ trigger_session_notification (hc,
+ session_id,
fulfillment_url);
- if (NULL != fulfillment_url)
- TMH_long_poll_resume2 (session_id,
- fulfillment_url);
-
/* fulfillment_url is part of the contract_terms */
json_decref (contract_terms);
- /* Resume clients waiting on the order
- (NOTE: should never be needed, as /pay
- would have triggered those, right?) */
- TMH_long_poll_resume (order_id,
- hc->instance,
- NULL,
- false);
return TALER_MHD_reply_static (connection,
MHD_HTTP_NO_CONTENT,
NULL,