From c75ed08b4dbeb70959e10861a7eeb78c545a2fc8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 3 Jun 2023 23:42:39 +0200 Subject: address more FIXMEs --- src/include/taler_merchant_service.h | 105 +++++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 18 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index cb9edb29..e8d76263 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -3767,21 +3767,53 @@ struct TALER_MERCHANT_ReserveSummary }; -// FIXME: change signature! +/** + * Response to a GET /reserves request. + */ +struct TALER_MERCHANT_ReservesGetResponse +{ + /** + * HTTP response details + */ + struct TALER_MERCHANT_HttpResponse hr; + + /** + * Details depending on status. + */ + union + { + + /** + * Details if status is #MHD_HTTP_OK. + */ + struct + { + /** + * length of the @e reserves array + */ + unsigned int reserves_length; + + /** + * array with details about the reserves + */ + const struct TALER_MERCHANT_ReserveSummary *reserves; + + } ok; + + } details; +}; + + /** * Callback to process a GET /reserves request * * @param cls closure - * @param hr HTTP response details - * @param reserves_length length of the @a reserves array - * @param reserves array with details about the reserves, NULL on error + * @param rgr response details */ typedef void (*TALER_MERCHANT_ReservesGetCallback) ( void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - unsigned int reserves_length, - const struct TALER_MERCHANT_ReserveSummary reserves[]); + const struct TALER_MERCHANT_ReservesGetResponse *rgr); /** @@ -3963,24 +3995,61 @@ TALER_MERCHANT_reserve_get_cancel ( struct TALER_MERCHANT_TipAuthorizeHandle; -// FIXME: change signature! /** - * Callback for a /reserves/$RESERVE_PUB/tip-authorize request. Returns the result of - * the operation. + * Response to a /tip-authorize request. + */ +struct TALER_MERCHANT_TipAuthorizeResponse +{ + /** + * HTTP response details + */ + struct TALER_MERCHANT_HttpResponse hr; + + /** + * Details depending on HTTP status. + */ + union + { + + /** + * Details if status is #MHD_HTTP_OK. + */ + struct + { + + /** + * which tip ID should be used to pickup the tip + */ + struct TALER_TipIdentifierP tip_id; + + /** + * URI for the tip + */ + const char *tip_uri; + + /** + * when does the tip expire + */ + struct GNUNET_TIME_Timestamp tip_expiration; + + } ok; + + } details; + +}; + + +/** + * Callback for a /reserves/$RESERVE_PUB/tip-authorize request. Returns the + * result of the operation. * * @param cls closure - * @param hr HTTP response details - * @param tip_id which tip ID should be used to pickup the tip - * @param tip_uri URI for the tip - * @param tip_expiration when does the tip expire + * @param tar response */ typedef void (*TALER_MERCHANT_TipAuthorizeCallback) ( void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - struct TALER_TipIdentifierP *tip_id, - const char *tip_uri, - struct GNUNET_TIME_Timestamp tip_expiration); + const struct TALER_MERCHANT_TipAuthorizeResponse *tar); /** -- cgit v1.2.3