summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-09-09 23:11:51 +0200
committerChristian Grothoff <christian@grothoff.org>2020-09-09 23:11:51 +0200
commite12f64d45b2f58b716497aab6fd6273b8f92b740 (patch)
tree06edf6f0faf5839dde351aca7f9fd275eedfe7cd /src/backend/taler-merchant-httpd.h
parent7302e0cc35bd3de6e84fa1310be094243372a3bc (diff)
downloadmerchant-e12f64d45b2f58b716497aab6fd6273b8f92b740.tar.gz
merchant-e12f64d45b2f58b716497aab6fd6273b8f92b740.tar.bz2
merchant-e12f64d45b2f58b716497aab6fd6273b8f92b740.zip
likely fix for #6581, still needs testcase
Diffstat (limited to 'src/backend/taler-merchant-httpd.h')
-rw-r--r--src/backend/taler-merchant-httpd.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h
index 0d78312e..c631729d 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -344,6 +344,13 @@ struct TMH_SuspendedConnection
struct GNUNET_HashCode key;
/**
+ * Optional session/fulfillment URI-based key
+ * of this entry in the #payment_trigger_map. Used internally by
+ * TMH_long_poll_resume2().
+ */
+ struct GNUNET_HashCode key2;
+
+ /**
* At what time does this request expire? If set in the future, we
* may wait this long for a payment to arrive before responding.
*/
@@ -355,7 +362,7 @@ struct TMH_SuspendedConnection
struct TALER_Amount refund_expected;
/**
- * #GNUNET_YES if we are waiting for a refund.
+ * true if we are waiting for a refund.
*/
bool awaiting_refund;
@@ -364,6 +371,10 @@ struct TMH_SuspendedConnection
*/
bool awaiting_refund_obtained;
+ /**
+ * True if @a key2 is set.
+ */
+ bool has_key2;
};
@@ -411,6 +422,8 @@ TMH_trigger_daemon (void);
* Suspend connection from @a sc until payment has been received.
*
* @param order_id the order that we are waiting on
+ * @param session_id session ID of the requester
+ * @param fulfillment_url fulfillment URL of the contract
* @param mi the merchant instance we are waiting on
* @param sc connection to suspend
* @param min_refund refund amount we are waiting on to be exceeded before resuming,
@@ -418,6 +431,8 @@ TMH_trigger_daemon (void);
*/
void
TMH_long_poll_suspend (const char *order_id,
+ const char *session_id,
+ const char *fulfillment_url,
const struct TMH_MerchantInstance *mi,
struct TMH_SuspendedConnection *sc,
const struct TALER_Amount *min_refund);
@@ -440,6 +455,18 @@ TMH_long_poll_resume (const char *order_id,
/**
+ * Find out if we have any clients long-polling for @a order_id to be
+ * confirmed at merchant @a mpub, and if so, tell them to resume.
+ *
+ * @param session_id the session for which @a fulfillment_url became paid
+ * @param fulfillment_url fullfillment URL of which an order was paid
+ */
+void
+TMH_long_poll_resume2 (const char *session_id,
+ const char *fulfillment_url);
+
+
+/**
* Decrement reference counter of @a mi, and free if it hits zero.
*
* @param[in,out] mi merchant instance to update and possibly free