summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r--src/include/taler_merchant_service.h83
1 files changed, 67 insertions, 16 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index e22e84f0..25ce2a44 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -3549,29 +3549,76 @@ struct TALER_MERCHANT_PickupDetail
/**
+ * Details returned about a tip by the merchant.
+ */
+struct TALER_MERCHANT_TipStatusResponse
+{
+ /**
+ * HTTP status of the response.
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ /**
+ * Details depending on the HTTP status.
+ */
+ union {
+
+ /**
+ * Details on #MHD_HTTP_OK.
+ */
+ struct {
+
+ /**
+ * Amount that was authorized under this tip
+ */
+ struct TALER_Amount total_authorized;
+
+ /**
+ * Amount that has been picked up
+ */
+ struct TALER_Amount total_picked_up;
+
+ /**
+ * The reason given for the tip
+ */
+ const char *reason;
+
+ /**
+ * Time when the tip will expire
+ */
+ struct GNUNET_TIME_Timestamp expiration;
+
+ /**
+ * reserve which is funding this tip
+ */
+ struct TALER_ReservePublicKeyP reserve_pub;
+
+ /**
+ * Length of the @e pickups array
+ */
+ unsigned int pickups_length;
+
+ /**
+ * array of pickup operations performed for this tip
+ */
+ struct TALER_MERCHANT_PickupDetail *pickups;
+ } success;
+
+ } details;
+
+};
+
+
+/**
* Callback to process a GET /private/tips/$TIP_ID request
*
* @param cls closure
- * @param hr HTTP response details
- * @param total_authorized how many tips were authorized under this tip
- * @param total_picked_up how many tips have been picked up
- * @param reason what was the reason given for the tip
- * @param expiration when the tip will expire
- * @param reserve_pub which reserve is funding this tip
- * @param pickups_length length of the @a pickups array
- * @param pickups array of pickup operations performed for this tip
+ * @param tsr response details
*/
typedef void
(*TALER_MERCHANT_TipMerchantGetCallback) (
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- const struct TALER_Amount *total_authorized,
- const struct TALER_Amount *total_picked_up,
- const char *reason,
- struct GNUNET_TIME_Timestamp expiration,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- unsigned int pickups_length,
- const struct TALER_MERCHANT_PickupDetail pickups[]);
+ const struct TALER_MERCHANT_TipStatusResponse *tsr);
/**
@@ -3581,6 +3628,8 @@ typedef void
* @param ctx execution context
* @param backend_url base URL of the merchant backend
* @param tip_id which tip should we query
+ * @param min_pick_up minimum amount picked up to notify about
+ * @param lp_timeout how long to wait for @a min_pick_up to be exceeded
* @param pickups whether to fetch associated pickups
* @param cb function to call with the result
* @param cb_cls closure for @a cb
@@ -3590,6 +3639,8 @@ struct TALER_MERCHANT_TipMerchantGetHandle *
TALER_MERCHANT_merchant_tip_get (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const struct TALER_TipIdentifierP *tip_id,
+ const struct TALER_Amount *min_pick_up,
+ struct GNUNET_TIME_Relative lp_timeout,
bool pickups,
TALER_MERCHANT_TipMerchantGetCallback cb,
void *cb_cls);