commit 994d4b37c06326f3e27a4d6300a16e7c3e7f0704
parent 129a6573fef7b34b2bfd433fd8f13be714826ab2
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Wed, 16 Jul 2025 20:18:50 +0200
MAKE CODE workinG AGAIN
Diffstat:
2 files changed, 36 insertions(+), 42 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -539,6 +539,28 @@ struct PayContext
*/
struct DonauData donau;
+#ifdef HAVE_DONAU_DONAU_SERVICE_H
+ /**
+ * Number of the blinded key pairs
+ */
+ unsigned int num_bkps;
+
+ /**
+ * Blinded key pairs received from the wallet
+ */
+ struct DONAU_BlindedUniqueDonorIdentifierKeyPair *bkps;
+
+ /**
+ * The id of the charity as saved on the donau.
+ */
+ uint64_t charity_id;
+
+ /**
+ * Private key of the charity(related to the private key of the merchant).
+ */
+ struct DONAU_CharityPrivateKeyP charity_priv;
+#endif
+
} parse_wallet_data;
/**
@@ -696,44 +718,16 @@ struct PayContext
} batch_deposits;
#ifdef HAVE_DONAU_DONAU_SERVICE_H
- struct
- {
- /**
- * The id of the charity as saved on the donau.
- */
- uint64_t charity_id;
-
- /**
- * Private key of the charity(related to the private key of the merchant).
- */
- struct DONAU_CharityPrivateKeyP charity_priv;
-
- } charity;
-
/**
- * Struct to hold the clients bkps + donau request handler
+ * Struct for #phase_generate_donation_receipt
*/
- /*FIXME: merge with the donaudata, birh to another phase*/
struct
{
/**
- * Number of the blinded key pairs
- */
- unsigned int num_bkps;
-
- /**
- * Blinded key pairs received from the wallet
- */
- struct DONAU_BlindedUniqueDonorIdentifierKeyPair *bkps;
-
- /**
* Handler of the donau request
*/
struct DONAU_BatchIssueReceiptHandle *birh;
- } donau_handler;
- struct
- {
/**
* Receipts for the donations from the Donau.
*/
@@ -2054,17 +2048,17 @@ phase_generate_donation_receipt (struct PayContext *pc)
return;
#else
/* Call DONAU_charity_issue_receipt() asynchronously. */
- pc->donau_handler.birh =
+ pc->donau_receipt.birh =
DONAU_charity_issue_receipt (TMH_curl_ctx,
pc->parse_wallet_data.donau.donau_url,
- &pc->charity.charity_priv,
- pc->charity.charity_id,
+ &pc->parse_wallet_data.charity_priv,
+ pc->parse_wallet_data.charity_id,
pc->parse_wallet_data.donau.donation_year,
- pc->donau_handler.num_bkps,
- pc->donau_handler.bkps,
+ pc->parse_wallet_data.num_bkps,
+ pc->parse_wallet_data.bkps,
&merchant_donau_issue_receipt_cb,
pc);
- if (NULL == pc->donau_handler.birh)
+ if (NULL == pc->donau_receipt.birh)
{
/* The request was invalid from the library’s perspective. */
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -3955,12 +3949,12 @@ phase_parse_wallet_data (struct PayContext *pc)
}
/* FIXME: remove check as already in array const */
- if (! json_is_array (budikeypairs) || (0 == json_array_size (budikeypairs)))
+ if (0 == json_array_size (budikeypairs))
{
GNUNET_break_op (0);
resume_pay_with_error (pc,
TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "Missing or empty 'budikeypairs' array");
+ "Empty 'budikeypairs' array");
return;
}
@@ -3972,8 +3966,8 @@ phase_parse_wallet_data (struct PayContext *pc)
qs = TMH_db->lookup_order_charity (
TMH_db->cls,
donau_url_tmp,
- &pc->charity.charity_id,
- &pc->charity.charity_priv);
+ &pc->parse_wallet_data.charity_id,
+ &pc->parse_wallet_data.charity_priv);
switch (qs)
{
@@ -4028,8 +4022,8 @@ phase_parse_wallet_data (struct PayContext *pc)
}
}
- pc->donau_handler.num_bkps = num_bkps;
- pc->donau_handler.bkps = bkps;
+ pc->parse_wallet_data.num_bkps = num_bkps;
+ pc->parse_wallet_data.bkps = bkps;
}
}
#else
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -3372,7 +3372,7 @@ parse_donau_instances (struct OrderContext *oc,
/* FIXME: select_donau_instanceS */
qs = TMH_db->select_donau_instance (TMH_db->cls,
&add_donau_url,
- oc);
+ output);
/* REVIEW: If no switch */
if (qs < 0)