commit 4c050ba39f04d67c9ab3abe5be55cac43d800882
parent a209ca8c6240cab7d4966239189f990ce9629ad6
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Thu, 5 Dec 2024 16:50:27 +0100
update of the services
Diffstat:
2 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/src/backend/taler-merchant-donaukeyupdate.c b/src/backend/taler-merchant-donaukeyupdate.c
@@ -24,6 +24,7 @@
#include <pthread.h>
#include <taler/taler_dbevents.h>
#include "donau/donau_service.h"
+#include "taler_merchant_util.h"
#include "taler_merchantdb_lib.h"
#include "taler_merchantdb_plugin.h"
#include "taler_merchant_bank_lib.h"
@@ -830,13 +831,8 @@ int main(int argc,
};
enum GNUNET_GenericReturnValue ret;
- if (GNUNET_OK !=
- GNUNET_STRINGS_get_utf8_args(argc, argv,
- &argc, &argv))
- return EXIT_INVALIDARGUMENT;
-
- TALER_OS_init();
ret = GNUNET_PROGRAM_run(
+ TALER_MERCHANT_project_data (),
argc, argv,
"taler-merchant-donaukeyupdate",
gettext_noop(
diff --git a/src/include/taler_merchant_donau.h b/src/include/taler_merchant_donau.h
@@ -279,4 +279,53 @@ void
TALER_MERCHANT_donau_instances_get_cancel(
struct TALER_MERCHANT_DonauInstanceGetHandle *dgh);
+
+/**
+ * Handle for a POST /donau operation.
+ */
+struct TALER_MERCHANT_DonauInstancePostHandle;
+
+
+/**
+ * Function called with the result of the POST /donau operation.
+ *
+ * @param cls closure
+ * @param hr HTTP response data
+ */
+typedef void
+(*TALER_MERCHANT_DonauInstancePostCallback)(
+ void *cls,
+ const struct TALER_MERCHANT_HttpResponse *hr);
+
+/**
+ * Post a new Donau instance.
+ * Sends a POST request to the backend to register a new Donau instance
+ * with the provided charity details.
+ *
+ * @param ctx the context
+ * @param backend_url the backend URL for the operation
+ * @param charity the details of the Donau charity to be posted
+ * @param cb function to call with the operation result
+ * @param cb_cls closure for @a cb
+ * @return the instance handle, or NULL upon error
+ */
+struct TALER_MERCHANT_DonauInstancePostHandle *
+TALER_MERCHANT_donau_instances_post(
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_MERCHANT_DONAU_Charity *charity,
+ const char *auth_token,
+ TALER_MERCHANT_DonauInstancePostCallback cb,
+ void *cb_cls);
+
+/**
+ * Cancel the POST /donau instances operation.
+ * This must not be called after the callback has been invoked.
+ *
+ * @param dph request to cancel
+ */
+void
+TALER_MERCHANT_donau_instances_post_cancel(
+ struct TALER_MERCHANT_DonauInstancePostHandle *dph);
+
#endif
\ No newline at end of file