summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-03 18:38:57 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-03 18:38:57 +0200
commitae0a2ee80040bb71fd4cc5d6b41d9899b423bc54 (patch)
tree7509d3dfa6ec4c4f0a78d7c5216ada1cf0f46a3d
parent3f2290cfa13732991dabb175f322e32ea9f11086 (diff)
downloadmerchant-ae0a2ee80040bb71fd4cc5d6b41d9899b423bc54.tar.gz
merchant-ae0a2ee80040bb71fd4cc5d6b41d9899b423bc54.tar.bz2
merchant-ae0a2ee80040bb71fd4cc5d6b41d9899b423bc54.zip
-more API clean up
-rw-r--r--src/include/taler_merchant_service.h320
-rw-r--r--src/lib/merchant_api_get_reserve.c12
-rw-r--r--src/lib/merchant_api_patch_instance.c2
-rw-r--r--src/lib/merchant_api_patch_order_forget.c21
-rw-r--r--src/lib/merchant_api_post_order_abort.c19
-rw-r--r--src/lib/merchant_api_post_order_pay.c4
-rw-r--r--src/lib/merchant_api_post_orders.c12
-rw-r--r--src/lib/merchant_api_post_reserves.c8
-rw-r--r--src/lib/merchant_api_tip_pickup.c2
-rw-r--r--src/lib/merchant_api_tip_pickup2.c17
10 files changed, 220 insertions, 197 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 874a8a8c..12b8ce95 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -369,17 +369,18 @@ struct TALER_MERCHANT_ConfigGetHandle;
* @return the config check handle; NULL upon error
*/
struct TALER_MERCHANT_ConfigGetHandle *
-TALER_MERCHANT_config_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- TALER_MERCHANT_ConfigCallback config_cb,
- void *config_cb_cls);
+TALER_MERCHANT_config_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ TALER_MERCHANT_ConfigCallback config_cb,
+ void *config_cb_cls);
/**
* Cancel /config request. Must not be called by clients after
* the callback was invoked.
*
- * @param vgh request to cancel.
+ * @param[in] vgh request to cancel.
*/
void
TALER_MERCHANT_config_get_cancel (struct TALER_MERCHANT_ConfigGetHandle *vgh);
@@ -486,10 +487,11 @@ typedef void
* @return the instances handle; NULL upon error
*/
struct TALER_MERCHANT_InstancesGetHandle *
-TALER_MERCHANT_instances_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- TALER_MERCHANT_InstancesGetCallback instances_cb,
- void *instances_cb_cls);
+TALER_MERCHANT_instances_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ TALER_MERCHANT_InstancesGetCallback instances_cb,
+ void *instances_cb_cls);
/**
@@ -768,7 +770,7 @@ TALER_MERCHANT_instance_patch (
const char *backend_url,
const char *instance_id,
unsigned int accounts_length,
- const struct TALER_MERCHANT_AccountConfig accounts[],
+ const struct TALER_MERCHANT_AccountConfig accounts[static accounts_length],
const char *name,
enum TALER_KYCLOGIC_KycUserType ut,
const json_t *address,
@@ -1005,11 +1007,12 @@ typedef void
* @return the instances handle; NULL upon error
*/
struct TALER_MERCHANT_InstanceGetHandle *
-TALER_MERCHANT_instance_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const char *instance_id,
- TALER_MERCHANT_InstanceGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_instance_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const char *instance_id,
+ TALER_MERCHANT_InstanceGetCallback cb,
+ void *cb_cls);
/**
@@ -1697,12 +1700,13 @@ typedef void
* @return a handle for this request, NULL on error
*/
struct TALER_MERCHANT_PostOrdersHandle *
-TALER_MERCHANT_orders_post (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const json_t *order,
- struct GNUNET_TIME_Relative refund_delay,
- TALER_MERCHANT_PostOrdersCallback cb,
- void *cb_cls);
+TALER_MERCHANT_orders_post (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const json_t *order,
+ struct GNUNET_TIME_Relative refund_delay,
+ TALER_MERCHANT_PostOrdersCallback cb,
+ void *cb_cls);
/**
* Information needed per product for constructing orders from
@@ -1752,7 +1756,7 @@ TALER_MERCHANT_orders_post2 (
unsigned int inventory_products_length,
const struct TALER_MERCHANT_InventoryProduct inventory_products[],
unsigned int uuids_length,
- const char *uuids[],
+ const char *uuids[static uuids_length],
bool create_token,
TALER_MERCHANT_PostOrdersCallback cb,
void *cb_cls);
@@ -1762,7 +1766,7 @@ TALER_MERCHANT_orders_post2 (
* Cancel a POST /orders request. This function cannot be used
* on a request handle if a response is already served for it.
*
- * @param po the proposal operation request handle
+ * @param[in] po the proposal operation request handle
*/
void
TALER_MERCHANT_orders_post_cancel (
@@ -1920,7 +1924,7 @@ TALER_MERCHANT_orders_get2 (
/**
* Cancel GET /orders operation.
*
- * @param pgh operation to cancel
+ * @param[in] pgh operation to cancel
*/
void
TALER_MERCHANT_orders_get_cancel (
@@ -2049,7 +2053,7 @@ TALER_MERCHANT_wallet_order_get (
/**
* Cancel a GET /orders/$ID request.
*
- * @param owgh handle to the request to be canceled
+ * @param[in] owgh handle to the request to be canceled
*/
void
TALER_MERCHANT_wallet_order_get_cancel (
@@ -2395,7 +2399,7 @@ TALER_MERCHANT_merchant_order_get (struct GNUNET_CURL_Context *ctx,
/**
* Cancel a GET /private/orders/$ID request.
*
- * @param omgh handle to the request to be canceled
+ * @param[in] omgh handle to the request to be canceled
*/
void
TALER_MERCHANT_merchant_order_get_cancel (
@@ -2445,7 +2449,7 @@ TALER_MERCHANT_order_delete (
/**
* Cancel DELETE /orders/$ID operation.
*
- * @param odh operation to cancel
+ * @param[in] odh operation to cancel
*/
void
TALER_MERCHANT_order_delete_cancel (
@@ -2525,19 +2529,20 @@ typedef void
* @return handle for this handle, NULL upon errors
*/
struct TALER_MERCHANT_OrderClaimHandle *
-TALER_MERCHANT_order_claim (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const char *order_id,
- const struct GNUNET_CRYPTO_EddsaPublicKey *nonce,
- const struct TALER_ClaimTokenP *claim_token,
- TALER_MERCHANT_OrderClaimCallback cb,
- void *cb_cls);
+TALER_MERCHANT_order_claim (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const char *order_id,
+ const struct GNUNET_CRYPTO_EddsaPublicKey *nonce,
+ const struct TALER_ClaimTokenP *claim_token,
+ TALER_MERCHANT_OrderClaimCallback cb,
+ void *cb_cls);
/**
* Cancel a POST /order/$ID/claim request.
*
- * @param och handle to the request to be canceled
+ * @param[in] och handle to the request to be canceled
*/
void
TALER_MERCHANT_order_claim_cancel (struct TALER_MERCHANT_OrderClaimHandle *och);
@@ -2683,7 +2688,7 @@ TALER_MERCHANT_order_pay_frontend (
const char *order_id,
const char *session_id,
unsigned int num_coins,
- const struct TALER_MERCHANT_PaidCoin coins[],
+ const struct TALER_MERCHANT_PaidCoin coins[static num_coins],
TALER_MERCHANT_OrderPayCallback pay_cb,
void *pay_cb_cls);
@@ -2762,23 +2767,24 @@ struct TALER_MERCHANT_PayCoin
* @return a handle for this request
*/
struct TALER_MERCHANT_OrderPayHandle *
-TALER_MERCHANT_order_pay (struct GNUNET_CURL_Context *ctx,
- const char *merchant_url,
- const char *session_id,
- const struct TALER_PrivateContractHashP *h_contract,
- const struct TALER_Amount *amount,
- const struct TALER_Amount *max_fee,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_MerchantSignatureP *merchant_sig,
- struct GNUNET_TIME_Timestamp timestamp,
- struct GNUNET_TIME_Timestamp refund_deadline,
- struct GNUNET_TIME_Timestamp pay_deadline,
- const struct TALER_MerchantWireHashP *h_wire,
- const char *order_id,
- unsigned int num_coins,
- const struct TALER_MERCHANT_PayCoin coins[],
- TALER_MERCHANT_OrderPayCallback pay_cb,
- void *pay_cb_cls);
+TALER_MERCHANT_order_pay (
+ struct GNUNET_CURL_Context *ctx,
+ const char *merchant_url,
+ const char *session_id,
+ const struct TALER_PrivateContractHashP *h_contract,
+ const struct TALER_Amount *amount,
+ const struct TALER_Amount *max_fee,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_MerchantSignatureP *merchant_sig,
+ struct GNUNET_TIME_Timestamp timestamp,
+ struct GNUNET_TIME_Timestamp refund_deadline,
+ struct GNUNET_TIME_Timestamp pay_deadline,
+ const struct TALER_MerchantWireHashP *h_wire,
+ const char *order_id,
+ unsigned int num_coins,
+ const struct TALER_MERCHANT_PayCoin coins[static num_coins],
+ TALER_MERCHANT_OrderPayCallback pay_cb,
+ void *pay_cb_cls);
/**
@@ -3000,15 +3006,16 @@ struct TALER_MERCHANT_AbortCoin
* @return a handle for this request
*/
struct TALER_MERCHANT_OrderAbortHandle *
-TALER_MERCHANT_order_abort (struct GNUNET_CURL_Context *ctx,
- const char *merchant_url,
- const char *order_id,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_PrivateContractHashP *h_contract,
- unsigned int num_coins,
- const struct TALER_MERCHANT_AbortCoin coins[],
- TALER_MERCHANT_AbortCallback cb,
- void *cb_cls);
+TALER_MERCHANT_order_abort (
+ struct GNUNET_CURL_Context *ctx,
+ const char *merchant_url,
+ const char *order_id,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_PrivateContractHashP *h_contract,
+ unsigned int num_coins,
+ const struct TALER_MERCHANT_AbortCoin coins[static num_coins],
+ TALER_MERCHANT_AbortCallback cb,
+ void *cb_cls);
/**
@@ -3055,13 +3062,14 @@ typedef void
* @return a handle for this request.
*/
struct TALER_MERCHANT_OrderForgetHandle *
-TALER_MERCHANT_order_forget (struct GNUNET_CURL_Context *ctx,
- const char *merchant_url,
- const char *order_id,
- unsigned int fields_length,
- const char *fields[],
- TALER_MERCHANT_ForgetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_order_forget (
+ struct GNUNET_CURL_Context *ctx,
+ const char *merchant_url,
+ const char *order_id,
+ unsigned int fields_length,
+ const char *fields[static fields_length],
+ TALER_MERCHANT_ForgetCallback cb,
+ void *cb_cls);
/**
@@ -3069,11 +3077,11 @@ TALER_MERCHANT_order_forget (struct GNUNET_CURL_Context *ctx,
* like this, you have no assurance that the request has not yet been
* forwarded to the merchant.
*
- * @param ofh the forget request handle
+ * @param[in] ofh the forget request handle
*/
void
-TALER_MERCHANT_order_forget_cancel (struct
- TALER_MERCHANT_OrderForgetHandle *ofh);
+TALER_MERCHANT_order_forget_cancel (
+ struct TALER_MERCHANT_OrderForgetHandle *ofh);
/**
@@ -3142,13 +3150,14 @@ typedef void
* @param cb_cls closure for cb
*/
struct TALER_MERCHANT_OrderRefundHandle *
-TALER_MERCHANT_post_order_refund (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const char *order_id,
- const struct TALER_Amount *refund,
- const char *reason,
- TALER_MERCHANT_RefundCallback cb,
- void *cb_cls);
+TALER_MERCHANT_post_order_refund (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const char *order_id,
+ const struct TALER_Amount *refund,
+ const char *reason,
+ TALER_MERCHANT_RefundCallback cb,
+ void *cb_cls);
/**
* Cancel a POST /refund request.
@@ -4093,13 +4102,14 @@ TALER_MERCHANT_tip_authorize2 (
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_TipAuthorizeHandle *
-TALER_MERCHANT_tip_authorize (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const char *next_url,
- const struct TALER_Amount *amount,
- const char *justification,
- TALER_MERCHANT_TipAuthorizeCallback authorize_cb,
- void *authorize_cb_cls);
+TALER_MERCHANT_tip_authorize (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const char *next_url,
+ const struct TALER_Amount *amount,
+ const char *justification,
+ TALER_MERCHANT_TipAuthorizeCallback authorize_cb,
+ void *authorize_cb_cls);
/**
@@ -4162,17 +4172,18 @@ TALER_MERCHANT_reserve_delete (
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_ReserveDeleteHandle *
-TALER_MERCHANT_reserve_purge (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- TALER_MERCHANT_ReserveDeleteCallback cb,
- void *cb_cls);
+TALER_MERCHANT_reserve_purge (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ TALER_MERCHANT_ReserveDeleteCallback cb,
+ void *cb_cls);
/**
* Cancel a DELETE (or purge) /reserve/$RESERVE_ID request.
*
- * @param rdh handle to the request to be canceled
+ * @param[in] rdh handle to the request to be canceled
*/
void
TALER_MERCHANT_reserve_delete_cancel (
@@ -4258,17 +4269,18 @@ typedef void
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_TipWalletGetHandle *
-TALER_MERCHANT_wallet_tip_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const struct TALER_TipIdentifierP *tip_id,
- TALER_MERCHANT_TipWalletGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_wallet_tip_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_TipIdentifierP *tip_id,
+ TALER_MERCHANT_TipWalletGetCallback cb,
+ void *cb_cls);
/**
* Cancel a GET /tips/$TIP_ID request.
*
- * @param tgh handle to the request to be canceled
+ * @param[in] tgh handle to the request to be canceled
*/
void
TALER_MERCHANT_wallet_tip_get_cancel (
@@ -4393,20 +4405,21 @@ typedef void
* @return handle for this operation, NULL upon errors
*/
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);
+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);
/**
* Cancel a GET /private/tips/$TIP_ID request.
*
- * @param tgh handle to the request to be canceled
+ * @param[in] tgh handle to the request to be canceled
*/
void
TALER_MERCHANT_merchant_tip_get_cancel (
@@ -4501,10 +4514,11 @@ typedef void
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_TipsGetHandle *
-TALER_MERCHANT_tips_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- TALER_MERCHANT_TipsGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_tips_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ TALER_MERCHANT_TipsGetCallback cb,
+ void *cb_cls);
/**
@@ -4520,13 +4534,14 @@ TALER_MERCHANT_tips_get (struct GNUNET_CURL_Context *ctx,
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_TipsGetHandle *
-TALER_MERCHANT_tips_get2 (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- enum TALER_EXCHANGE_YesNoAll expired,
- int64_t limit,
- uint64_t offset,
- TALER_MERCHANT_TipsGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_tips_get2 (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ enum TALER_EXCHANGE_YesNoAll expired,
+ int64_t limit,
+ uint64_t offset,
+ TALER_MERCHANT_TipsGetCallback cb,
+ void *cb_cls);
/**
@@ -4633,7 +4648,7 @@ TALER_MERCHANT_tip_pickup (
const char *backend_url,
const struct TALER_TipIdentifierP *tip_id,
unsigned int num_planchets,
- const struct TALER_MERCHANT_PlanchetData planchets[],
+ const struct TALER_MERCHANT_PlanchetData planchets[static num_planchets],
TALER_MERCHANT_TipPickupCallback pickup_cb,
void *pickup_cb_cls);
@@ -4718,19 +4733,20 @@ typedef void
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_TipPickup2Handle *
-TALER_MERCHANT_tip_pickup2 (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const struct TALER_TipIdentifierP *tip_id,
- unsigned int num_planchets,
- const struct TALER_PlanchetDetail planchets[],
- TALER_MERCHANT_TipPickup2Callback pickup_cb,
- void *pickup_cb_cls);
+TALER_MERCHANT_tip_pickup2 (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_TipIdentifierP *tip_id,
+ unsigned int num_planchets,
+ const struct TALER_PlanchetDetail planchets[static num_planchets],
+ TALER_MERCHANT_TipPickup2Callback pickup_cb,
+ void *pickup_cb_cls);
/**
* Cancel a pending /tip-pickup request.
*
- * @param tp handle from the operation to cancel
+ * @param[in] tp handle from the operation to cancel
*/
void
TALER_MERCHANT_tip_pickup2_cancel (
@@ -4876,13 +4892,14 @@ typedef void
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_KycGetHandle *
-TALER_MERCHANT_kyc_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const struct TALER_MerchantWireHashP *h_wire,
- const char *exchange_url,
- struct GNUNET_TIME_Relative timeout,
- TALER_MERCHANT_KycGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_kyc_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_MerchantWireHashP *h_wire,
+ const char *exchange_url,
+ struct GNUNET_TIME_Relative timeout,
+ TALER_MERCHANT_KycGetCallback cb,
+ void *cb_cls);
/**
@@ -4900,14 +4917,15 @@ TALER_MERCHANT_kyc_get (struct GNUNET_CURL_Context *ctx,
* @return handle for this operation, NULL upon errors
*/
struct TALER_MERCHANT_KycGetHandle *
-TALER_MERCHANT_management_kyc_get (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const char *instance_id,
- const struct TALER_MerchantWireHashP *h_wire,
- const char *exchange_url,
- struct GNUNET_TIME_Relative timeout,
- TALER_MERCHANT_KycGetCallback cb,
- void *cb_cls);
+TALER_MERCHANT_management_kyc_get (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const char *instance_id,
+ const struct TALER_MerchantWireHashP *h_wire,
+ const char *exchange_url,
+ struct GNUNET_TIME_Relative timeout,
+ TALER_MERCHANT_KycGetCallback cb,
+ void *cb_cls);
/**
@@ -5167,7 +5185,7 @@ TALER_MERCHANT_templates_post (
/**
* Cancel POST /templates operation.
*
- * @param tph operation to cancel
+ * @param[in] tph operation to cancel
*/
void
TALER_MERCHANT_templates_post_cancel (
@@ -5224,7 +5242,7 @@ TALER_MERCHANT_template_patch (
/**
* Cancel PATCH /template operation.
*
- * @param tph operation to cancel
+ * @param[in] tph operation to cancel
*/
void
TALER_MERCHANT_template_patch_cancel (
@@ -5271,7 +5289,7 @@ TALER_MERCHANT_template_delete (
/**
* Cancel DELETE /template/$ID operation.
*
- * @param tdh operation to cancel
+ * @param[in] tdh operation to cancel
*/
void
TALER_MERCHANT_template_delete_cancel (
@@ -5304,7 +5322,7 @@ TALER_MERCHANT_using_templates_post (
/**
* Cancel POST /using-templates operation.
*
- * @param utph operation to cancel
+ * @param[in] utph operation to cancel
*/
void
TALER_MERCHANT_using_templates_post_cancel (
@@ -5401,7 +5419,7 @@ TALER_MERCHANT_webhooks_get (
/**
* Cancel GET /webhooks operation.
*
- * @param tgh operation to cancel
+ * @param[in] tgh operation to cancel
*/
void
TALER_MERCHANT_webhooks_get_cancel (
@@ -5462,7 +5480,7 @@ TALER_MERCHANT_webhook_get (
/**
* Cancel GET /webhooks/$ID operation.
*
- * @param tgh operation to cancel
+ * @param[in] tgh operation to cancel
*/
void
TALER_MERCHANT_webhook_get_cancel (
@@ -5519,7 +5537,7 @@ TALER_MERCHANT_webhooks_post (
/**
* Cancel POST /webhooks operation.
*
- * @param wph operation to cancel
+ * @param[in] wph operation to cancel
*/
void
TALER_MERCHANT_webhooks_post_cancel (
@@ -5578,7 +5596,7 @@ TALER_MERCHANT_webhook_patch (
/**
* Cancel PATCH /webhook operation.
*
- * @param wph operation to cancel
+ * @param[in] wph operation to cancel
*/
void
TALER_MERCHANT_webhook_patch_cancel (
@@ -5625,7 +5643,7 @@ TALER_MERCHANT_webhook_delete (
/**
* Cancel DELETE /webhook/$ID operation.
*
- * @param wdh operation to cancel
+ * @param[in] wdh operation to cancel
*/
void
TALER_MERCHANT_webhook_delete_cancel (
diff --git a/src/lib/merchant_api_get_reserve.c b/src/lib/merchant_api_get_reserve.c
index 3df1dc75..b1c32cef 100644
--- a/src/lib/merchant_api_get_reserve.c
+++ b/src/lib/merchant_api_get_reserve.c
@@ -98,6 +98,7 @@ handle_reserve_get_finished (void *cls,
= &rgr.details.ok.rs;
const json_t *tips = NULL;
const json_t *accounts = NULL;
+ unsigned int accounts_len;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_timestamp ("creation_time",
&rs->creation_time),
@@ -148,15 +149,14 @@ handle_reserve_get_finished (void *cls,
if (NULL != accounts)
{
- unsigned int accounts_len = json_array_size (accounts);
-
+ accounts_len = json_array_size (accounts);
was = GNUNET_new_array (accounts_len,
struct TALER_EXCHANGE_WireAccount);
if (GNUNET_OK !=
TALER_EXCHANGE_parse_accounts (NULL,
accounts,
- was,
- accounts_len))
+ accounts_len,
+ was))
{
GNUNET_break_op (0);
rgr.hr.http_status = 0;
@@ -217,8 +217,8 @@ handle_reserve_get_finished (void *cls,
&rgr);
if (NULL != accounts)
{
- TALER_EXCHANGE_free_accounts (was,
- json_array_size (accounts));
+ TALER_EXCHANGE_free_accounts (accounts_len,
+ was);
GNUNET_free (was);
}
GNUNET_free (tds);
diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c
index 240cafd0..6a3c06c1 100644
--- a/src/lib/merchant_api_patch_instance.c
+++ b/src/lib/merchant_api_patch_instance.c
@@ -159,7 +159,7 @@ TALER_MERCHANT_instance_patch (
const char *backend_url,
const char *instance_id,
unsigned int accounts_length,
- const struct TALER_MERCHANT_AccountConfig accounts[],
+ const struct TALER_MERCHANT_AccountConfig accounts[static accounts_length],
const char *name,
enum TALER_KYCLOGIC_KycUserType ut,
const json_t *address,
diff --git a/src/lib/merchant_api_patch_order_forget.c b/src/lib/merchant_api_patch_order_forget.c
index 572f00e6..118655db 100644
--- a/src/lib/merchant_api_patch_order_forget.c
+++ b/src/lib/merchant_api_patch_order_forget.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020, 2021 Taler Systems SA
+ Copyright (C) 2020, 2021, 2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -150,13 +150,14 @@ handle_forget_finished (void *cls,
struct TALER_MERCHANT_OrderForgetHandle *
-TALER_MERCHANT_order_forget (struct GNUNET_CURL_Context *ctx,
- const char *merchant_url,
- const char *order_id,
- unsigned int fields_length,
- const char *fields[],
- TALER_MERCHANT_ForgetCallback cb,
- void *cb_cls)
+TALER_MERCHANT_order_forget (
+ struct GNUNET_CURL_Context *ctx,
+ const char *merchant_url,
+ const char *order_id,
+ unsigned int fields_length,
+ const char *fields[static fields_length],
+ TALER_MERCHANT_ForgetCallback cb,
+ void *cb_cls)
{
struct TALER_MERCHANT_OrderForgetHandle *ofh;
json_t *req_fields;
@@ -236,8 +237,8 @@ TALER_MERCHANT_order_forget (struct GNUNET_CURL_Context *ctx,
void
-TALER_MERCHANT_order_forget_cancel (struct
- TALER_MERCHANT_OrderForgetHandle *ofh)
+TALER_MERCHANT_order_forget_cancel (
+ struct TALER_MERCHANT_OrderForgetHandle *ofh)
{
if (NULL != ofh->job)
{
diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c
index 3c9665c6..82cca481 100644
--- a/src/lib/merchant_api_post_order_abort.c
+++ b/src/lib/merchant_api_post_order_abort.c
@@ -298,15 +298,16 @@ handle_abort_finished (void *cls,
struct TALER_MERCHANT_OrderAbortHandle *
-TALER_MERCHANT_order_abort (struct GNUNET_CURL_Context *ctx,
- const char *merchant_url,
- const char *order_id,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_PrivateContractHashP *h_contract,
- unsigned int num_coins,
- const struct TALER_MERCHANT_AbortCoin coins[],
- TALER_MERCHANT_AbortCallback cb,
- void *cb_cls)
+TALER_MERCHANT_order_abort (
+ struct GNUNET_CURL_Context *ctx,
+ const char *merchant_url,
+ const char *order_id,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_PrivateContractHashP *h_contract,
+ unsigned int num_coins,
+ const struct TALER_MERCHANT_AbortCoin coins[static num_coins],
+ TALER_MERCHANT_AbortCallback cb,
+ void *cb_cls)
{
struct TALER_MERCHANT_OrderAbortHandle *oah;
json_t *abort_obj;
diff --git a/src/lib/merchant_api_post_order_pay.c b/src/lib/merchant_api_post_order_pay.c
index 4b674337..886d9bd6 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -566,7 +566,7 @@ TALER_MERCHANT_order_pay_frontend (
const char *order_id,
const char *session_id,
unsigned int num_coins,
- const struct TALER_MERCHANT_PaidCoin coins[],
+ const struct TALER_MERCHANT_PaidCoin coins[static num_coins],
TALER_MERCHANT_OrderPayCallback pay_cb,
void *pay_cb_cls)
{
@@ -727,7 +727,7 @@ TALER_MERCHANT_order_pay (
const struct TALER_MerchantWireHashP *h_wire,
const char *order_id,
unsigned int num_coins,
- const struct TALER_MERCHANT_PayCoin coins[],
+ const struct TALER_MERCHANT_PayCoin coins[static num_coins],
TALER_MERCHANT_OrderPayCallback pay_cb,
void *pay_cb_cls)
{
diff --git a/src/lib/merchant_api_post_orders.c b/src/lib/merchant_api_post_orders.c
index c0fd5fcb..fc37a439 100644
--- a/src/lib/merchant_api_post_orders.c
+++ b/src/lib/merchant_api_post_orders.c
@@ -92,9 +92,9 @@ handle_post_order_finished (void *cls,
po->job = NULL;
TALER_MERCHANT_handle_order_creation_response_ (po->cb,
- po->cb_cls,
- response_code,
- json);
+ po->cb_cls,
+ response_code,
+ json);
TALER_MERCHANT_orders_post_cancel (po);
}
@@ -107,6 +107,8 @@ TALER_MERCHANT_orders_post (struct GNUNET_CURL_Context *ctx,
TALER_MERCHANT_PostOrdersCallback cb,
void *cb_cls)
{
+ static const char *no_uuids[GNUNET_NZL (0)];
+
return TALER_MERCHANT_orders_post2 (ctx,
backend_url,
order,
@@ -115,7 +117,7 @@ TALER_MERCHANT_orders_post (struct GNUNET_CURL_Context *ctx,
0,
NULL,
0,
- NULL,
+ no_uuids,
true,
cb,
cb_cls);
@@ -132,7 +134,7 @@ TALER_MERCHANT_orders_post2 (
unsigned int inventory_products_length,
const struct TALER_MERCHANT_InventoryProduct inventory_products[],
unsigned int uuids_length,
- const char *uuids[],
+ const char *uuids[static uuids_length],
bool create_token,
TALER_MERCHANT_PostOrdersCallback cb,
void *cb_cls)
diff --git a/src/lib/merchant_api_post_reserves.c b/src/lib/merchant_api_post_reserves.c
index a2822c26..8898d61e 100644
--- a/src/lib/merchant_api_post_reserves.c
+++ b/src/lib/merchant_api_post_reserves.c
@@ -130,8 +130,8 @@ handle_post_reserves_finished (void *cls,
if (GNUNET_OK !=
TALER_EXCHANGE_parse_accounts (NULL,
accounts,
- was,
- accounts_len))
+ accounts_len,
+ was))
{
GNUNET_break_op (0);
prr.hr.http_status = 0;
@@ -139,8 +139,8 @@ handle_post_reserves_finished (void *cls,
}
prh->cb (prh->cb_cls,
&prr);
- TALER_EXCHANGE_free_accounts (was,
- accounts_len);
+ TALER_EXCHANGE_free_accounts (accounts_len,
+ was);
GNUNET_JSON_parse_free (spec);
TALER_MERCHANT_reserves_post_cancel (prh);
return;
diff --git a/src/lib/merchant_api_tip_pickup.c b/src/lib/merchant_api_tip_pickup.c
index e8cee8ec..eb0e3fb3 100644
--- a/src/lib/merchant_api_tip_pickup.c
+++ b/src/lib/merchant_api_tip_pickup.c
@@ -333,7 +333,7 @@ TALER_MERCHANT_tip_pickup (
const char *backend_url,
const struct TALER_TipIdentifierP *tip_id,
unsigned int num_planchets,
- const struct TALER_MERCHANT_PlanchetData *pds,
+ const struct TALER_MERCHANT_PlanchetData pds[static num_planchets],
TALER_MERCHANT_TipPickupCallback pickup_cb,
void *pickup_cb_cls)
{
diff --git a/src/lib/merchant_api_tip_pickup2.c b/src/lib/merchant_api_tip_pickup2.c
index 84b57b3c..74e183ab 100644
--- a/src/lib/merchant_api_tip_pickup2.c
+++ b/src/lib/merchant_api_tip_pickup2.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2021 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
@@ -231,13 +231,14 @@ handle_tip_pickup_finished (void *cls,
struct TALER_MERCHANT_TipPickup2Handle *
-TALER_MERCHANT_tip_pickup2 (struct GNUNET_CURL_Context *ctx,
- const char *backend_url,
- const struct TALER_TipIdentifierP *tip_id,
- unsigned int num_planchets,
- const struct TALER_PlanchetDetail planchets[],
- TALER_MERCHANT_TipPickup2Callback pickup_cb,
- void *pickup_cb_cls)
+TALER_MERCHANT_tip_pickup2 (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_TipIdentifierP *tip_id,
+ unsigned int num_planchets,
+ const struct TALER_PlanchetDetail planchets[static num_planchets],
+ TALER_MERCHANT_TipPickup2Callback pickup_cb,
+ void *pickup_cb_cls)
{
struct TALER_MERCHANT_TipPickup2Handle *tpo;
CURL *eh;