commit 0183da0b57c70422fdfa83613728b84f5ee125fd
parent d1095d824f8da80db82de6355869c6052215fcc1
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date: Tue, 10 Oct 2023 11:56:56 +0200
[header] some changes
Diffstat:
1 file changed, 14 insertions(+), 246 deletions(-)
diff --git a/src/include/taler_donau_service.h b/src/include/taler_donau_service.h
@@ -694,33 +694,6 @@ TALER_DONAU_csr_batch-issue_cancel (
/* ********************* GET /charities/$CHARITY_ID *********************** */
/**
- * information about a charity for a specific year
- */
-struct TALER_DONAU_CHARITY_YEAR
-{
- /**
- * year of validity.
- */
- unsigned int year;
-
- /**
- * charity id.
- */
- unsigned int charity_id;
-
- /**
- * max allowed donation amount per year.
- */
- struct Taler_Amount max_amount;
-
- /**
- * total donation amount for the current year
- */
- struct Taler_Amount current_amount;
-
-}
-
-/**
* Charity issue receipt transaction.
*/
struct CharityIssueReceiptTransaction
@@ -841,245 +814,40 @@ void
TALER_DONAU_charitys_get_cancel (
struct TALER_DONAU_charitysGetHandle *rgh);
+/* ********************* POST /charitys/$CHARITY_ID/batch-issue *********************** */
/**
- * @brief A /charitys/$RID/status Handle
- */
-struct TALER_DONAU_charitysStatusHandle;
-
-
-/**
- * @brief charity status details.
- */
-struct TALER_DONAU_charityStatus
-{
-
- /**
- * High-level HTTP response details.
- */
- struct TALER_DONAU_HttpResponse hr;
-
- /**
- * Details depending on @e hr.http_status.
- */
- union
- {
-
- /**
- * Information returned on success, if
- * @e hr.http_status is #MHD_HTTP_OK
- */
- struct
- {
-
- /**
- * Current charity balance. May not be the difference between
- * @e total_in and @e total_out because the @e may be truncated.
- */
- struct TALER_Amount balance;
-
- /**
- * Total of all inbound transactions in @e history.
- */
- struct TALER_Amount total_in;
-
- /**
- * Total of all outbound transactions in @e history.
- */
- struct TALER_Amount total_out;
-
- /**
- * charity history.
- */
- const struct TALER_DONAU_charityHistoryEntry *history;
-
- /**
- * Length of the @e history array.
- */
- unsigned int history_len;
-
- } ok;
-
- } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity status request to a donau.
- *
- * @param cls closure
- * @param rs HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysStatusCallback) (
- void *cls,
- const struct TALER_DONAU_charityStatus *rs);
-
-
-/**
- * Submit a request to obtain the charity status.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param charity_priv private key of the charity to inspect
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- * signatures fail to verify). In this case, the callback is not called.
- */
-struct TALER_DONAU_charitysStatusHandle *
-TALER_DONAU_charitys_status (
- struct GNUNET_CURL_Context *ctx,
- const char *url,
- struct TALER_DONAU_Keys *keys,
- const struct TALER_charityPrivateKeyP *charity_priv,
- TALER_DONAU_charitysStatusCallback cb,
- void *cb_cls);
-
-
-/**
- * Cancel a charity status request. This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param rsh the charity request handle
- */
-void
-TALER_DONAU_charitys_status_cancel (
- struct TALER_DONAU_charitysStatusHandle *rsh);
-
-
-/**
- * @brief A /charitys/$RID/history Handle
+ * @brief A /charitys/$CHARITY_PUB/batch-issue Handle
*/
-struct TALER_DONAU_charitysHistoryHandle;
+struct TALER_DONAU_BatchIssueHandle;
/**
- * @brief charity history details.
+ * Charity issue receipt transaction.
*/
-struct TALER_DONAU_charityHistory
+struct TALER_DONAU_BatchIssueInput
{
-
/**
- * High-level HTTP response details.
+ * Amount issued.
*/
- struct TALER_DONAU_HttpResponse hr;
+ struct TALER_Amount amount;
/**
- * Timestamp of when we made the history request
- * (client-side).
+ * Year of validity.
*/
- struct GNUNET_TIME_Timestamp ts;
+ unsigned int year;
/**
- * charity signature affirming the history request
- * (generated as part of the request).
+ * Hash of the BDIDs to be signed
*/
- const struct TALER_charitySignatureP *charity_sig;
+ struct TALER_EnvelopeHash h_blinded_bdids;
/**
- * Details depending on @e hr.http_status.
+ * Charity's eddsa signature.
*/
- union
- {
-
- /**
- * Information returned on success, if
- * @e hr.http_status is #MHD_HTTP_OK
- */
- struct
- {
-
- /**
- * charity balance. May not be the difference between
- * @e total_in and @e total_out because the @e may be truncated
- * due to expiration.
- */
- struct TALER_Amount balance;
-
- /**
- * Total of all inbound transactions in @e history.
- */
- struct TALER_Amount total_in;
-
- /**
- * Total of all outbound transactions in @e history.
- */
- struct TALER_Amount total_out;
-
- /**
- * charity history.
- */
- const struct TALER_DONAU_charityHistoryEntry *history;
-
- /**
- * Length of the @e history array.
- */
- unsigned int history_len;
-
- } ok;
-
- } details;
-
-};
-
-
-/**
- * Callbacks of this type are used to serve the result of submitting a
- * charity history request to a donau.
- *
- * @param cls closure
- * @param rs HTTP response data
- */
-typedef void
-(*TALER_DONAU_charitysHistoryCallback) (
- void *cls,
- const struct TALER_DONAU_charityHistory *rs);
-
-
-/**
- * Submit a request to obtain the charity history.
- *
- * @param ctx curl context
- * @param url donau base URL
- * @param keys donau keys
- * @param charity_priv private key of the charity to inspect
- * @param cb the callback to call when a reply for this request is available
- * @param cb_cls closure for the above callback
- * @return a handle for this request; NULL if the inputs are invalid (i.e.
- * signatures fail to verify). In this case, the callback is not called.
- */
-struct TALER_DONAU_charitysHistoryHandle *
-TALER_DONAU_charitys_history (
- struct GNUNET_CURL_Context *ctx,
- const char *url,
- struct TALER_DONAU_Keys *keys,
- const struct TALER_charityPrivateKeyP *charity_priv,
- TALER_DONAU_charitysHistoryCallback cb,
- void *cb_cls);
-
-
-/**
- * Cancel a charity history request. This function cannot be used
- * on a request handle if a response is already served for it.
- *
- * @param rsh the charity request handle
- */
-void
-TALER_DONAU_charitys_history_cancel (
- struct TALER_DONAU_charitysHistoryHandle *rsh);
-
-
-/* ********************* POST /charitys/$CHARITY_PUB/batch-issue *********************** */
-
+ struct TALER_DonauSignatureP donau_sig;
+}
-/**
- * @brief A /charitys/$CHARITY_PUB/batch-issue Handle
- */
-struct TALER_DONAU_BatchIssueHandle;
/**