summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-22 14:31:43 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-22 14:31:43 +0200
commit1b0aca733237973bb69541d2b95295c759ad064e (patch)
tree996bf7efc303da640a543b0b38ef205858f8e572
parent262940332979dfc3f0703ce12638abab8c63605c (diff)
downloadmerchant-1b0aca733237973bb69541d2b95295c759ad064e.tar.gz
merchant-1b0aca733237973bb69541d2b95295c759ad064e.tar.bz2
merchant-1b0aca733237973bb69541d2b95295c759ad064e.zip
-code cleanup order creation
-rw-r--r--src/backend/taler-merchant-httpd_private-post-orders.c261
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c12
-rw-r--r--src/include/taler_merchantdb_plugin.h604
3 files changed, 425 insertions, 452 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c
index 172cb05c..55fd42b3 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -58,8 +58,8 @@
* @param products JSON array to check
* @return #GNUNET_OK if all is fine
*/
-static int
-check_products (json_t *products)
+static enum GNUNET_GenericReturnValue
+check_products (const json_t *products)
{
size_t index;
json_t *value;
@@ -73,9 +73,12 @@ check_products (json_t *products)
const char *description;
const char *error_name;
unsigned int error_line;
- int res;
+ enum GNUNET_GenericReturnValue res;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_string ("description", &description),
+ // FIXME: parse and format-validate all
+ // optional fields of a product and check validity
+ GNUNET_JSON_spec_string ("description",
+ &description),
GNUNET_JSON_spec_end ()
};
@@ -122,7 +125,7 @@ make_merchant_base_url (struct MHD_Connection *connection,
GNUNET_buffer_write_str (&buf, "http://");
host = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
- "Host");
+ MHD_HTTP_HEADER_HOST);
forwarded_host = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
"X-Forwarded-Host");
@@ -178,9 +181,6 @@ struct InventoryProduct
};
-#define PRODUCT_OOS_OFFSET -3
-
-
/**
* Execute the database transaction to setup the order.
*
@@ -194,6 +194,7 @@ struct InventoryProduct
* @param inventory_products array of products to add to @a order from our inventory
* @param uuids_length length of the @a uuids array
* @param uuids array of UUIDs used to reserve products from @a inventory_products
+ * @param[out] out_of_stock_index which product (by offset) is out of stock, UINT_MAX if all were in-stock
* @return transaction status, 0 if @a uuids were insufficient to reserve required inventory
*/
static enum GNUNET_DB_QueryStatus
@@ -201,12 +202,13 @@ execute_transaction (struct TMH_HandlerContext *hc,
const char *order_id,
const struct GNUNET_HashCode *h_post_data,
struct GNUNET_TIME_Absolute pay_deadline,
- json_t *order,
+ const json_t *order,
const struct TALER_ClaimTokenP *claim_token,
unsigned int inventory_products_length,
const struct InventoryProduct inventory_products[],
unsigned int uuids_length,
- const struct GNUNET_Uuid uuids[])
+ const struct GNUNET_Uuid uuids[],
+ unsigned int *out_of_stock_index)
{
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute timestamp;
@@ -219,17 +221,6 @@ execute_transaction (struct TMH_HandlerContext *hc,
GNUNET_break (0);
return GNUNET_DB_STATUS_HARD_ERROR;
}
- qs = TMH_db->lookup_order_summary (TMH_db->cls,
- hc->instance->settings.id,
- order_id,
- &timestamp,
- &order_serial);
- if (0 != qs)
- {
- /* order already exists. */
- TMH_db->rollback (TMH_db->cls);
- return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
- }
/* Setup order */
qs = TMH_db->insert_order (TMH_db->cls,
hc->instance->settings.id,
@@ -238,11 +229,11 @@ execute_transaction (struct TMH_HandlerContext *hc,
pay_deadline,
claim_token,
order);
- /* qs == 0: probably instance does not exist. */
if (qs <= 0)
{
+ /* qs == 0: probably instance does not exist (anymore) */
TMH_db->rollback (TMH_db->cls);
- return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
+ return qs;
}
/* Migrate locks from UUIDs to new order: first release old locks */
for (unsigned int i = 0; i<uuids_length; i++)
@@ -268,15 +259,21 @@ execute_transaction (struct TMH_HandlerContext *hc,
order_id,
inventory_products[i].product_id,
inventory_products[i].quantity);
- if (qs <= 0)
+ if (qs < 0)
{
- /* qs == 0: lock acquisition failed due to insufficient stocks */
TMH_db->rollback (TMH_db->cls);
- if (0 == qs)
- qs = PRODUCT_OOS_OFFSET - i; /* indicate which product is causing the issue */
return qs;
}
+ if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
+ {
+ /* qs == 0: lock acquisition failed due to insufficient stocks */
+ TMH_db->rollback (TMH_db->cls);
+ *out_of_stock_index = i; /* indicate which product is causing the issue */
+ return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
+ }
}
+ *out_of_stock_index = UINT_MAX;
+
/* Get the order serial and timestamp for the order we just created to
update long-poll clients. */
qs = TMH_db->lookup_order_summary (TMH_db->cls,
@@ -284,7 +281,7 @@ execute_transaction (struct TMH_HandlerContext *hc,
order_id,
&timestamp,
&order_serial);
- if (1 != qs)
+ if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
{
TMH_db->rollback (TMH_db->cls);
return qs;
@@ -292,24 +289,9 @@ execute_transaction (struct TMH_HandlerContext *hc,
/* finally, commit transaction (note: if it fails, we ALSO re-acquire
the UUID locks, which is exactly what we want) */
qs = TMH_db->commit (TMH_db->cls);
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
- {
- /* Notify clients that have been waiting for the payment to succeed */
- TMH_long_poll_resume (order_id,
- hc->instance,
- NULL,
- false);
- TMH_notify_order_change (hc->instance,
- order_id,
- false, /* paid */
- false, /* refunded */
- false, /* wired */
- timestamp,
- order_serial);
-
- return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; /* 1 == success! */
- }
- return qs;
+ if (0 > qs)
+ return qs;
+ return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; /* 1 == success! */
}
@@ -376,6 +358,7 @@ execute_order (struct MHD_Connection *connection,
GNUNET_JSON_spec_end ()
};
enum GNUNET_DB_QueryStatus qs;
+ unsigned int out_of_stock_index;
/* extract fields we need to sign separately */
{
@@ -405,23 +388,7 @@ execute_order (struct MHD_Connection *connection,
TMH_currency);
}
- if (wire_transfer_deadline.abs_value_us <
- refund_deadline.abs_value_us)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "invariant failed: wire_transfer_deadline %llu >= refund_deadline %llu\n",
- (unsigned long long) wire_transfer_deadline.abs_value_us,
- (unsigned long long) refund_deadline.abs_value_us);
- GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "order:wire_transfer_deadline;order:refund_deadline");
- }
-
-
- /* check contract is well-formed */
+ /* check product list in contract is well-formed */
if (GNUNET_OK != check_products (products))
{
GNUNET_JSON_parse_free (spec);
@@ -447,20 +414,24 @@ execute_order (struct MHD_Connection *connection,
/* If yes, check for idempotency */
if (0 > qs)
{
+ GNUNET_break (0);
TMH_db->rollback (TMH_db->cls);
GNUNET_JSON_parse_free (spec);
- return qs;
+ return TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_FETCH_FAILED,
+ "lookup_order");
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
+ MHD_RESULT ret;
+
json_decref (contract_terms);
/* Comparing the contract terms is sufficient because all the other
params get added to it at some point. */
if (0 == GNUNET_memcmp (&orig_post,
h_post_data))
{
- MHD_RESULT ret;
-
ret = TALER_MHD_reply_json_pack (
connection,
MHD_HTTP_OK,
@@ -471,22 +442,18 @@ execute_order (struct MHD_Connection *connection,
(GNUNET_YES == GNUNET_is_zero (&token))
? NULL
: GNUNET_JSON_from_data_auto (&token));
- GNUNET_JSON_parse_free (spec);
- return ret;
}
else
{
/* This request is not idempotent */
- MHD_RESULT ret;
-
ret = TALER_MHD_reply_with_error (
connection,
MHD_HTTP_CONFLICT,
TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS,
order_id);
- GNUNET_JSON_parse_free (spec);
- return ret;
}
+ GNUNET_JSON_parse_free (spec);
+ return ret;
}
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -505,23 +472,23 @@ execute_order (struct MHD_Connection *connection,
inventory_products_length,
inventory_products,
uuids_length,
- uuids);
+ uuids,
+ &out_of_stock_index);
if (GNUNET_DB_STATUS_SOFT_ERROR != qs)
break;
}
if (0 >= qs)
{
+ GNUNET_JSON_parse_free (spec);
/* Special report if retries insufficient */
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
{
GNUNET_break (0);
- GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_SOFT_FAILURE,
NULL);
}
-
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
/* should be: contract (!) with same order ID
@@ -532,83 +499,83 @@ execute_order (struct MHD_Connection *connection,
TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS,
order_id);
}
-
- /* If we have a product that has insufficient quantities,
- generate the details for the response. */
- if (PRODUCT_OOS_OFFSET >= qs)
- {
- unsigned int i = -qs + PRODUCT_OOS_OFFSET;
- struct TALER_MERCHANTDB_ProductDetails pd;
- MHD_RESULT ret;
-
- memset (&pd, 0, sizeof (pd));
- qs = TMH_db->lookup_product (TMH_db->cls,
- hc->instance->settings.id,
- inventory_products[i].product_id,
- &pd);
- GNUNET_JSON_parse_free (spec);
- switch (qs)
- {
- case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
- ret = TALER_MHD_reply_json_pack (connection,
- MHD_HTTP_GONE,
- "{s:s,s:I,s:I,s:o?}",
- "product_id",
- inventory_products[i].product_id,
- "requested_quantity",
- inventory_products[i].quantity,
- "available_quantity",
- pd.total_stock - pd.total_sold
- - pd.total_lost,
- "restock_expected",
- (pd.next_restock.abs_value_us == 0) ?
- NULL :
- GNUNET_JSON_from_time_abs (
- pd.next_restock));
- TALER_MERCHANTDB_product_details_free (&pd);
- break;
- case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
- ret = TALER_MHD_reply_json_pack (connection,
- MHD_HTTP_GONE,
- "{s:s,s:I,s:I}",
- "product_id",
- inventory_products[i].product_id,
- "requested_quantity",
- inventory_products[i].quantity,
- "available_quantity",
- (json_int_t) 0);
- break;
- case GNUNET_DB_STATUS_SOFT_ERROR:
- GNUNET_break (0);
- ret = TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_SOFT_FAILURE,
- NULL);
- break;
- case GNUNET_DB_STATUS_HARD_ERROR:
- ret = TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_FETCH_FAILED,
- NULL);
- break;
- default:
- GNUNET_break (0);
- return MHD_NO;
- }
- return ret;
- }
-
/* Other hard transaction error (disk full, etc.) */
- GNUNET_JSON_parse_free (spec);
+ GNUNET_break (0);
return TALER_MHD_reply_with_error (
connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_COMMIT_FAILED,
NULL);
}
- /* DB transaction succeeded, generate positive response */
+
+ /* DB transaction succeeded, check for out-of-stock */
+ if (out_of_stock_index < UINT_MAX)
+ {
+ /* We had a product that has insufficient quantities,
+ generate the details for the response. */
+ struct TALER_MERCHANTDB_ProductDetails pd;
+ MHD_RESULT ret;
+
+ memset (&pd, 0, sizeof (pd));
+ qs = TMH_db->lookup_product (
+ TMH_db->cls,
+ hc->instance->settings.id,
+ inventory_products[out_of_stock_index].product_id,
+ &pd);
+ GNUNET_JSON_parse_free (spec);
+ switch (qs)
+ {
+ case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+ ret = TALER_MHD_reply_json_pack (connection,
+ MHD_HTTP_GONE,
+ "{s:s,s:I,s:I,s:o?}",
+ "product_id",
+ inventory_products[out_of_stock_index].
+ product_id,
+ "requested_quantity",
+ inventory_products[out_of_stock_index].
+ quantity,
+ "available_quantity",
+ pd.total_stock - pd.total_sold
+ - pd.total_lost,
+ "restock_expected",
+ (0 == pd.next_restock.abs_value_us)
+ ? NULL
+ : GNUNET_JSON_from_time_abs (
+ pd.next_restock));
+ TALER_MERCHANTDB_product_details_free (&pd);
+ return ret;
+ case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ return TALER_MHD_reply_json_pack (connection,
+ MHD_HTTP_GONE,
+ "{s:s,s:I,s:I}",
+ "product_id",
+ inventory_products[out_of_stock_index].
+ product_id,
+ "requested_quantity",
+ inventory_products[out_of_stock_index].
+ quantity,
+ "available_quantity",
+ (json_int_t) 0);
+ case GNUNET_DB_STATUS_SOFT_ERROR:
+ GNUNET_break (0);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_SOFT_FAILURE,
+ NULL);
+ case GNUNET_DB_STATUS_HARD_ERROR:
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_FETCH_FAILED,
+ NULL);
+ }
+ GNUNET_break (0);
+ return MHD_NO;
+ }
+
+ /* Everything in-stock, generate positive response */
{
MHD_RESULT ret;
@@ -912,10 +879,12 @@ patch_order (struct MHD_Connection *connection,
connection,
MHD_HTTP_BAD_REQUEST,
TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE,
- NULL);
+ "order:wire_transfer_deadline;order:refund_deadline");
}
+ /* Note: total amount currency match checked
+ later in execute_order() */
if (GNUNET_OK !=
TALER_amount_is_valid (&max_wire_fee))
{
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index ee7acf1f..bc3af1bb 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -175,13 +175,17 @@ postgres_preflight (void *cls)
/**
- * Check that the database connection is still up.
+ * Check that the database connection is still up
+ * and automatically reconnects unless we are
+ * already inside of a transaction.
*
* @param pg connection to check
*/
static void
check_connection (struct PostgresClosure *pg)
{
+ if (NULL != pg->transaction_name)
+ return;
GNUNET_PQ_reconnect_if_down (pg->conn);
}
@@ -1496,7 +1500,7 @@ postgres_lookup_orders (void *cls,
* @param cls closure
* @param instance_id identifies the instance responsible for the order
* @param order_id alphanumeric string that uniquely identifies the proposal
- * @param h_post_order hash of the POST data for idempotency checks
+ * @param h_post_data hash of the POST data for idempotency checks
* @param pay_deadline how long does the customer have to pay for the order
* @param claim_token token to use for access control
* @param contract_terms proposal data to store
@@ -1506,7 +1510,7 @@ static enum GNUNET_DB_QueryStatus
postgres_insert_order (void *cls,
const char *instance_id,
const char *order_id,
- const struct GNUNET_HashCode *h_post_order,
+ const struct GNUNET_HashCode *h_post_data,
struct GNUNET_TIME_Absolute pay_deadline,
const struct TALER_ClaimTokenP *claim_token,
const json_t *contract_terms)
@@ -1518,7 +1522,7 @@ postgres_insert_order (void *cls,
GNUNET_PQ_query_param_string (order_id),
GNUNET_PQ_query_param_absolute_time (&pay_deadline),
GNUNET_PQ_query_param_auto_from_type (claim_token),
- GNUNET_PQ_query_param_auto_from_type (h_post_order),
+ GNUNET_PQ_query_param_auto_from_type (h_post_data),
GNUNET_PQ_query_param_absolute_time (&now),
TALER_PQ_query_param_json (contract_terms),
GNUNET_PQ_query_param_end
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 58f93b6e..91c33f60 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -766,7 +766,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*commit)(void *cls);
+ (*commit)(void *cls);
/**
* Lookup all of the instances this backend has configured.
@@ -777,10 +777,10 @@ struct TALER_MERCHANTDB_Plugin
* @param cb_cls closure for @a cb
*/
enum GNUNET_DB_QueryStatus
- (*lookup_instances)(void *cls,
- bool active_only,
- TALER_MERCHANTDB_InstanceCallback cb,
- void *cb_cls);
+ (*lookup_instances)(void *cls,
+ bool active_only,
+ TALER_MERCHANTDB_InstanceCallback cb,
+ void *cb_cls);
/**
* Lookup authentication data of an instance.
@@ -790,9 +790,9 @@ struct TALER_MERCHANTDB_Plugin
* @param[out] ias where to store the auth data
*/
enum GNUNET_DB_QueryStatus
- (*lookup_instance_auth)(void *cls,
- const char *instance_id,
- struct TALER_MERCHANTDB_InstanceAuthSettings *ias);
+ (*lookup_instance_auth)(void *cls,
+ const char *instance_id,
+ struct TALER_MERCHANTDB_InstanceAuthSettings *ias);
/**
@@ -805,11 +805,11 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*insert_instance)(void *cls,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_MerchantPrivateKeyP *merchant_priv,
- const struct TALER_MERCHANTDB_InstanceSettings *is,
- const struct TALER_MERCHANTDB_InstanceAuthSettings *ias);
+ (*insert_instance)(void *cls,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_MerchantPrivateKeyP *merchant_priv,
+ const struct TALER_MERCHANTDB_InstanceSettings *is,
+ const struct TALER_MERCHANTDB_InstanceAuthSettings *ias);
/**
* Insert information about an instance's account into our database.
@@ -820,7 +820,7 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*insert_account)(
+ (*insert_account)(
void *cls,
const char *id,
const struct TALER_MERCHANTDB_AccountDetails *account_details);
@@ -833,7 +833,7 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*delete_instance_private_key)(
+ (*delete_instance_private_key)(
void *cls,
const char *merchant_id);
@@ -846,8 +846,8 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*purge_instance)(void *cls,
- const char *merchant_id);
+ (*purge_instance)(void *cls,
+ const char *merchant_id);
/**
* Update information about an instance into our database.
@@ -857,8 +857,8 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*update_instance)(void *cls,
- const struct TALER_MERCHANTDB_InstanceSettings *is);
+ (*update_instance)(void *cls,
+ const struct TALER_MERCHANTDB_InstanceSettings *is);
/**
* Update information about an instance's authentication settings
@@ -870,10 +870,10 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*update_instance_auth)(void *cls,
- const char *merchant_id,
- const struct
- TALER_MERCHANTDB_InstanceAuthSettings *ias);
+ (*update_instance_auth)(void *cls,
+ const char *merchant_id,
+ const struct
+ TALER_MERCHANTDB_InstanceAuthSettings *ias);
/**
* Set an instance's account in our database to "inactive".
@@ -884,9 +884,9 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*inactivate_account)(void *cls,
- const char *merchant_id,
- const struct GNUNET_HashCode *h_wire);
+ (*inactivate_account)(void *cls,
+ const char *merchant_id,
+ const struct GNUNET_HashCode *h_wire);
/**
@@ -898,9 +898,9 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*activate_account)(void *cls,
- const char *merchant_id,
- const struct GNUNET_HashCode *h_wire);
+ (*activate_account)(void *cls,
+ const char *merchant_id,
+ const struct GNUNET_HashCode *h_wire);
/**
* Lookup all of the products the given instance has configured.
@@ -912,10 +912,10 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*lookup_products)(void *cls,
- const char *instance_id,
- TALER_MERCHANTDB_ProductsCallback cb,
- void *cb_cls);
+ (*lookup_products)(void *cls,
+ const char *instance_id,
+ TALER_MERCHANTDB_ProductsCallback cb,
+ void *cb_cls);
/**
* Lookup details about a particular product.
@@ -928,10 +928,10 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*lookup_product)(void *cls,
- const char *instance_id,
- const char *product_id,
- struct TALER_MERCHANTDB_ProductDetails *pd);
+ (*lookup_product)(void *cls,
+ const char *instance_id,
+ const char *product_id,
+ struct TALER_MERCHANTDB_ProductDetails *pd);
/**
* Delete information about a product. Note that the transaction must
@@ -944,9 +944,9 @@ struct TALER_MERCHANTDB_Plugin
* if locks prevent deletion OR product unknown
*/
enum GNUNET_DB_QueryStatus
- (*delete_product)(void *cls,
- const char *instance_id,
- const char *product_id);
+ (*delete_product)(void *cls,
+ const char *instance_id,
+ const char *product_id);
/**
* Insert details about a particular product.
@@ -958,10 +958,10 @@ struct TALER_MERCHANTDB_Plugin
* @return database result code
*/
enum GNUNET_DB_QueryStatus
- (*insert_product)(void *cls,
- const char *instance_id,
- const char *product_id,
- const struct TALER_MERCHANTDB_ProductDetails *pd);
+ (*insert_product)(void *cls,
+ const char *instance_id,
+ const char *product_id,
+ const struct TALER_MERCHANTDB_ProductDetails *pd);
/**
* Update details about a particular product. Note that the
@@ -983,10 +983,10 @@ struct TALER_MERCHANTDB_Plugin
* does not yet exist.
*/
enum GNUNET_DB_QueryStatus
- (*update_product)(void *cls,
- const char *instance_id,
- const char *product_id,
- const struct TALER_MERCHANTDB_ProductDetails *pd);
+ (*update_product)(void *cls,
+ const char *instance_id,
+ const char *product_id,
+ const struct TALER_MERCHANTDB_ProductDetails *pd);
/**
* Lock stocks of a particular product. Note that the transaction must
@@ -1002,12 +1002,12 @@ struct TALER_MERCHANTDB_Plugin
* product is unknown OR if there insufficient stocks remaining
*/
enum GNUNET_DB_QueryStatus
- (*lock_product)(void *cls,
- const char *instance_id,
- const char *product_id,
- const struct GNUNET_Uuid *uuid,
- uint64_t quantity,
- struct GNUNET_TIME_Absolute expiration_time);
+ (*lock_product)(void *cls,
+ const char *instance_id,
+ const char *product_id,
+ const struct GNUNET_Uuid *uuid,
+ uint64_t quantity,
+ struct GNUNET_TIME_Absolute expiration_time);
/**
@@ -1021,9 +1021,9 @@ struct TALER_MERCHANTDB_Plugin
* if locks prevent deletion OR order unknown
*/
enum GNUNET_DB_QueryStatus
- (*delete_order)(void *cls,
- const char *instance_id,
- const char *order_id);
+ (*delete_order)(void *cls,
+ const char *instance_id,
+ const char *order_id);
/**
@@ -1040,12 +1040,12 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_order)(void *cls,
- const char *instance_id,
- const char *order_id,
- struct TALER_ClaimTokenP *claim_token,
- struct GNUNET_HashCode *h_post_data,
- json_t **contract_terms);
+ (*lookup_order)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ struct TALER_ClaimTokenP *claim_token,
+ struct GNUNET_HashCode *h_post_data,
+ json_t **contract_terms);
/**
@@ -1059,11 +1059,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_order_summary)(void *cls,
- const char *instance_id,
- const char *order_id,
- struct GNUNET_TIME_Absolute *timestamp,
- uint64_t *order_serial);
+ (*lookup_order_summary)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ struct GNUNET_TIME_Absolute *timestamp,
+ uint64_t *order_serial);
/**
@@ -1077,11 +1077,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_orders)(void *cls,
- const char *instance_id,
- const struct TALER_MERCHANTDB_OrderFilter *of,
- TALER_MERCHANTDB_OrdersCallback cb,
- void *cb_cls);
+ (*lookup_orders)(void *cls,
+ const char *instance_id,
+ const struct TALER_MERCHANTDB_OrderFilter *of,
+ TALER_MERCHANTDB_OrdersCallback cb,
+ void *cb_cls);
/**
@@ -1090,20 +1090,20 @@ struct TALER_MERCHANTDB_Plugin
* @param cls closure
* @param instance_id identifies the instance responsible for the order
* @param order_id alphanumeric string that uniquely identifies the order
- * @param h_post_order hash of the POST data for idempotency checks
+ * @param h_post_data hash of the POST data for idempotency checks
* @param pay_deadline how long does the customer have to pay for the order
* @param claim_token token to use for access control
* @param contract_terms proposal data to store
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*insert_order)(void *cls,
- const char *instance_id,
- const char *order_id,
- const struct GNUNET_HashCode *h_post_order,
- struct GNUNET_TIME_Absolute pay_deadline,
- const struct TALER_ClaimTokenP *claim_token,
- const json_t *contract_terms);
+ (*insert_order)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ const struct GNUNET_HashCode *h_post_data,
+ struct GNUNET_TIME_Absolute pay_deadline,
+ const struct TALER_ClaimTokenP *claim_token,
+ const json_t *contract_terms);
/**
@@ -1117,8 +1117,8 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT indicates success
*/
enum GNUNET_DB_QueryStatus
- (*unlock_inventory)(void *cls,
- const struct GNUNET_Uuid *uuid);
+ (*unlock_inventory)(void *cls,
+ const struct GNUNET_Uuid *uuid);
/**
@@ -1134,11 +1134,11 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT indicates success
*/
enum GNUNET_DB_QueryStatus
- (*insert_order_lock)(void *cls,
- const char *instance_id,
- const char *order_id,
- const char *product_id,
- uint64_t quantity);
+ (*insert_order_lock)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ const char *product_id,
+ uint64_t quantity);
/**
@@ -1152,11 +1152,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_contract_terms)(void *cls,
- const char *instance_id,
- const char *order_id,
- json_t **contract_terms,
- uint64_t *order_serial);
+ (*lookup_contract_terms)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ json_t **contract_terms,
+ uint64_t *order_serial);
/**
@@ -1175,10 +1175,10 @@ struct TALER_MERCHANTDB_Plugin
* is malformed
*/
enum GNUNET_DB_QueryStatus
- (*insert_contract_terms)(void *cls,
- const char *instance_id,
- const char *order_id,
- json_t *contract_terms);
+ (*insert_contract_terms)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ json_t *contract_terms);
/**
@@ -1197,10 +1197,10 @@ struct TALER_MERCHANTDB_Plugin
* is malformed
*/
enum GNUNET_DB_QueryStatus
- (*update_contract_terms)(void *cls,
- const char *instance_id,
- const char *order_id,
- json_t *contract_terms);
+ (*update_contract_terms)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ json_t *contract_terms);
/**
@@ -1217,10 +1217,10 @@ struct TALER_MERCHANTDB_Plugin
* if locks prevent deletion OR order unknown
*/
enum GNUNET_DB_QueryStatus
- (*delete_contract_terms)(void *cls,
- const char *instance_id,
- const char *order_id,
- struct GNUNET_TIME_Relative legal_expiration);
+ (*delete_contract_terms)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ struct GNUNET_TIME_Relative legal_expiration);
/**
@@ -1235,11 +1235,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_deposits)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *h_contract_terms,
- TALER_MERCHANTDB_DepositsCallback cb,
- void *cb_cls);
+ (*lookup_deposits)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *h_contract_terms,
+ TALER_MERCHANTDB_DepositsCallback cb,
+ void *cb_cls);
/**
@@ -1254,7 +1254,7 @@ struct TALER_MERCHANTDB_Plugin
* @param master_sig signature of @a master_pub over the @a exchange_pub and the dates
*/
enum GNUNET_DB_QueryStatus
- (*insert_exchange_signkey)(
+ (*insert_exchange_signkey)(
void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_ExchangePublicKeyP *exchange_pub,
@@ -1282,19 +1282,19 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*insert_deposit)(void *cls,
- const char *instance_id,
- struct GNUNET_TIME_Absolute deposit_timestamp,
- const struct GNUNET_HashCode *h_contract_terms,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const char *exchange_url,
- const struct TALER_Amount *amount_with_fee,
- const struct TALER_Amount *deposit_fee,
- const struct TALER_Amount *refund_fee,
- const struct TALER_Amount *wire_fee,
- const struct GNUNET_HashCode *h_wire,
- const struct TALER_ExchangeSignatureP *exchange_sig,
- const struct TALER_ExchangePublicKeyP *exchange_pub);
+ (*insert_deposit)(void *cls,
+ const char *instance_id,
+ struct GNUNET_TIME_Absolute deposit_timestamp,
+ const struct GNUNET_HashCode *h_contract_terms,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const char *exchange_url,
+ const struct TALER_Amount *amount_with_fee,
+ const struct TALER_Amount *deposit_fee,
+ const struct TALER_Amount *refund_fee,
+ const struct TALER_Amount *wire_fee,
+ const struct GNUNET_HashCode *h_wire,
+ const struct TALER_ExchangeSignatureP *exchange_sig,
+ const struct TALER_ExchangePublicKeyP *exchange_pub);
/**
@@ -1308,11 +1308,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_refunds)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *h_contract_terms,
- TALER_MERCHANTDB_RefundCallback rc,
- void *rc_cls);
+ (*lookup_refunds)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *h_contract_terms,
+ TALER_MERCHANTDB_RefundCallback rc,
+ void *rc_cls);
/**
@@ -1327,10 +1327,10 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*mark_contract_paid)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *h_contract_terms,
- const char *session_id);
+ (*mark_contract_paid)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *h_contract_terms,
+ const char *session_id);
/**
@@ -1349,12 +1349,12 @@ struct TALER_MERCHANTDB_Plugin
* regardless of whether it actually increased the refund
*/
enum GNUNET_DB_QueryStatus
- (*refund_coin)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *h_contract_terms,
- struct GNUNET_TIME_Absolute refund_timestamp,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const char *reason);
+ (*refund_coin)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *h_contract_terms,
+ struct GNUNET_TIME_Absolute refund_timestamp,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const char *reason);
/**
@@ -1368,11 +1368,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_order_status)(void *cls,
- const char *instance_id,
- const char *order_id,
- struct GNUNET_HashCode *h_contract_terms,
- bool *paid);
+ (*lookup_order_status)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ struct GNUNET_HashCode *h_contract_terms,
+ bool *paid);
/**
@@ -1387,11 +1387,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_payment_status)(void *cls,
- uint64_t order_serial,
- const char *session_id,
- bool *paid,
- bool *wired);
+ (*lookup_payment_status)(void *cls,
+ uint64_t order_serial,
+ const char *session_id,
+ bool *paid,
+ bool *wired);
/**
@@ -1404,10 +1404,10 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_deposits_by_order)(void *cls,
- uint64_t order_serial,
- TALER_MERCHANTDB_DepositedCoinsCallback cb,
- void *cb_cls);
+ (*lookup_deposits_by_order)(void *cls,
+ uint64_t order_serial,
+ TALER_MERCHANTDB_DepositedCoinsCallback cb,
+ void *cb_cls);
/**
@@ -1421,7 +1421,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_transfer_details_by_order)(
+ (*lookup_transfer_details_by_order)(
void *cls,
uint64_t order_serial,
TALER_MERCHANTDB_OrderTransferDetailsCallback cb,
@@ -1437,9 +1437,9 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*insert_deposit_to_transfer)(void *cls,
- uint64_t deposit_serial,
- const struct TALER_EXCHANGE_DepositData *dd);
+ (*insert_deposit_to_transfer)(void *cls,
+ uint64_t deposit_serial,
+ const struct TALER_EXCHANGE_DepositData *dd);
/**
@@ -1450,8 +1450,8 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*mark_order_wired)(void *cls,
- uint64_t order_serial);
+ (*mark_order_wired)(void *cls,
+ uint64_t order_serial);
/**
@@ -1474,11 +1474,11 @@ struct TALER_MERCHANTDB_Plugin
* what was already refunded (idempotency!)
*/
enum TALER_MERCHANTDB_RefundStatus
- (*increase_refund)(void *cls,
- const char *instance_id,
- const char *order_id,
- const struct TALER_Amount *refund,
- const char *reason);
+ (*increase_refund)(void *cls,
+ const char *instance_id,
+ const char *order_id,
+ const struct TALER_Amount *refund,
+ const char *reason);
/**
@@ -1492,11 +1492,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_refunds_detailed)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *h_contract_terms,
- TALER_MERCHANTDB_RefundDetailCallback rc,
- void *rc_cls);
+ (*lookup_refunds_detailed)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *h_contract_terms,
+ TALER_MERCHANTDB_RefundDetailCallback rc,
+ void *rc_cls);
/**
* Insert refund proof data from the exchange into the database.
@@ -1508,10 +1508,10 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*insert_refund_proof)(void *cls,
- uint64_t refund_serial,
- const struct TALER_ExchangeSignatureP *exchange_sig,
- const struct TALER_ExchangePublicKeyP *exchange_pub);
+ (*insert_refund_proof)(void *cls,
+ uint64_t refund_serial,
+ const struct TALER_ExchangeSignatureP *exchange_sig,
+ const struct TALER_ExchangePublicKeyP *exchange_pub);
/**
@@ -1524,10 +1524,10 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_refund_proof)(void *cls,
- uint64_t refund_serial,
- struct TALER_ExchangeSignatureP *exchange_sig,
- struct TALER_ExchangePublicKeyP *exchange_pub);
+ (*lookup_refund_proof)(void *cls,
+ uint64_t refund_serial,
+ struct TALER_ExchangeSignatureP *exchange_sig,
+ struct TALER_ExchangePublicKeyP *exchange_pub);
/**
@@ -1543,11 +1543,11 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_order_by_fulfillment)(void *cls,
- const char *instance_id,
- const char *fulfillment_url,
- const char *session_id,
- char **order_id);
+ (*lookup_order_by_fulfillment)(void *cls,
+ const char *instance_id,
+ const char *fulfillment_url,
+ const char *session_id,
+ char **order_id);
/**
* Insert information about a wire transfer the merchant has received.
@@ -1563,7 +1563,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*insert_transfer)(
+ (*insert_transfer)(
void *cls,
const char *instance_id,
const char *exchange_url,
@@ -1584,9 +1584,9 @@ struct TALER_MERCHANTDB_Plugin
* if deletion is prohibited OR transfer is unknown
*/
enum GNUNET_DB_QueryStatus
- (*delete_transfer)(void *cls,
- const char *instance_id,
- uint64_t transfer_serial_id);
+ (*delete_transfer)(void *cls,
+ const char *instance_id,
+ uint64_t transfer_serial_id);
/**
@@ -1600,9 +1600,9 @@ struct TALER_MERCHANTDB_Plugin
* if the transfer record exists
*/
enum GNUNET_DB_QueryStatus
- (*check_transfer_exists)(void *cls,
- const char *instance_id,
- uint64_t transfer_serial_id);
+ (*check_transfer_exists)(void *cls,
+ const char *instance_id,
+ uint64_t transfer_serial_id);
/**
@@ -1615,10 +1615,10 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_account)(void *cls,
- const char *instance_id,
- const char *payto_uri,
- uint64_t *account_serial);
+ (*lookup_account)(void *cls,
+ const char *instance_id,
+ const char *payto_uri,
+ uint64_t *account_serial);
/**
@@ -1635,7 +1635,7 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT on success
*/
enum GNUNET_DB_QueryStatus
- (*insert_transfer_details)(
+ (*insert_transfer_details)(
void *cls,
const char *instance_id,
const char *exchange_url,
@@ -1661,15 +1661,15 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*lookup_wire_fee)(void *cls,
- const struct TALER_MasterPublicKeyP *master_pub,
- const char *wire_method,
- struct GNUNET_TIME_Absolute contract_date,
- struct TALER_Amount *wire_fee,
- struct TALER_Amount *closing_fee,
- struct GNUNET_TIME_Absolute *start_date,
- struct GNUNET_TIME_Absolute *end_date,
- struct TALER_MasterSignatureP *master_sig);
+ (*lookup_wire_fee)(void *cls,
+ const struct TALER_MasterPublicKeyP *master_pub,
+ const char *wire_method,
+ struct GNUNET_TIME_Absolute contract_date,
+ struct TALER_Amount *wire_fee,
+ struct TALER_Amount *closing_fee,
+ struct GNUNET_TIME_Absolute *start_date,
+ struct GNUNET_TIME_Absolute *end_date,
+ struct TALER_MasterSignatureP *master_sig);
/**
@@ -1685,7 +1685,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_deposits_by_contract_and_coin)(
+ (*lookup_deposits_by_contract_and_coin)(
void *cls,
const char *instance_id,
const struct GNUNET_HashCode *h_contract_terms,
@@ -1713,7 +1713,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_transfer)(
+ (*lookup_transfer)(
void *cls,
const char *instance_id,
const char *exchange_url,
@@ -1737,7 +1737,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*set_transfer_status_to_verified)(
+ (*set_transfer_status_to_verified)(
void *cls,
const char *exchange_url,
const struct TALER_WireTransferIdentifierRawP *wtid);
@@ -1756,7 +1756,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_transfer_summary)(
+ (*lookup_transfer_summary)(
void *cls,
const char *exchange_url,
const struct TALER_WireTransferIdentifierRawP *wtid,
@@ -1777,7 +1777,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_transfer_details)(
+ (*lookup_transfer_details)(
void *cls,
const char *exchange_url,
const struct TALER_WireTransferIdentifierRawP *wtid,
@@ -1802,16 +1802,16 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_transfers)(void *cls,
- const char *instance_id,
- const char *payto_uri,
- struct GNUNET_TIME_Absolute before,
- struct GNUNET_TIME_Absolute after,
- int64_t limit,
- uint64_t offset,
- enum TALER_EXCHANGE_YesNoAll yna,
- TALER_MERCHANTDB_TransferCallback cb,
- void *cb_cls);
+ (*lookup_transfers)(void *cls,
+ const char *instance_id,
+ const char *payto_uri,
+ struct GNUNET_TIME_Absolute before,
+ struct GNUNET_TIME_Absolute after,
+ int64_t limit,
+ uint64_t offset,
+ enum TALER_EXCHANGE_YesNoAll yna,
+ TALER_MERCHANTDB_TransferCallback cb,
+ void *cb_cls);
/**
@@ -1830,7 +1830,7 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status code
*/
enum GNUNET_DB_QueryStatus
- (*store_wire_fee_by_exchange)(
+ (*store_wire_fee_by_exchange)(
void *cls,
const struct TALER_MasterPublicKeyP *exchange_pub,
const struct GNUNET_HashCode *h_wire_method,
@@ -1860,14 +1860,14 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT for success
*/
enum TALER_ErrorCode
- (*insert_reserve)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePrivateKeyP *reserve_priv,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const char *exchange_url,
- const char *payto_uri,
- const struct TALER_Amount *initial_balance,
- struct GNUNET_TIME_Absolute expiration);
+ (*insert_reserve)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePrivateKeyP *reserve_priv,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const char *exchange_url,
+ const char *payto_uri,
+ const struct TALER_Amount *initial_balance,
+ struct GNUNET_TIME_Absolute expiration);
/**
@@ -1884,10 +1884,10 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT for success
*/
enum GNUNET_DB_QueryStatus
- (*activate_reserve)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const struct TALER_Amount *initial_exchange_balance);
+ (*activate_reserve)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const struct TALER_Amount *initial_exchange_balance);
/**
@@ -1903,13 +1903,13 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_reserves)(void *cls,
- const char *instance_id,
- struct GNUNET_TIME_Absolute created_after,
- enum TALER_EXCHANGE_YesNoAll active,
- enum TALER_EXCHANGE_YesNoAll failures,
- TALER_MERCHANTDB_ReservesCallback cb,
- void *cb_cls);
+ (*lookup_reserves)(void *cls,
+ const char *instance_id,
+ struct GNUNET_TIME_Absolute created_after,
+ enum TALER_EXCHANGE_YesNoAll active,
+ enum TALER_EXCHANGE_YesNoAll failures,
+ TALER_MERCHANTDB_ReservesCallback cb,
+ void *cb_cls);
/**
@@ -1921,9 +1921,9 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_pending_reserves)(void *cls,
- TALER_MERCHANTDB_PendingReservesCallback cb,
- void *cb_cls);
+ (*lookup_pending_reserves)(void *cls,
+ TALER_MERCHANTDB_PendingReservesCallback cb,
+ void *cb_cls);
/**
@@ -1938,12 +1938,12 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_reserve)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- bool fetch_tips,
- TALER_MERCHANTDB_ReserveDetailsCallback cb,
- void *cb_cls);
+ (*lookup_reserve)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ bool fetch_tips,
+ TALER_MERCHANTDB_ReserveDetailsCallback cb,
+ void *cb_cls);
/**
@@ -1955,9 +1955,9 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*delete_reserve)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub);
+ (*delete_reserve)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub);
/**
* Purge all information about a reserve (including tips from it).
@@ -1968,9 +1968,9 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*purge_reserve)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub);
+ (*purge_reserve)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub);
/**
@@ -1998,14 +1998,14 @@ struct TALER_MERCHANTDB_Plugin
* #TALER_EC_NONE upon success
*/
enum TALER_ErrorCode
- (*authorize_tip)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const struct TALER_Amount *amount,
- const char *justification,
- const char *next_url,
- struct GNUNET_HashCode *tip_id,
- struct GNUNET_TIME_Absolute *expiration);
+ (*authorize_tip)(void *cls,
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const struct TALER_Amount *amount,
+ const char *justification,
+ const char *next_url,
+ struct GNUNET_HashCode *tip_id,
+ struct GNUNET_TIME_Absolute *expiration);
/**
@@ -2023,14 +2023,14 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_pickup)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *tip_id,
- const struct GNUNET_HashCode *pickup_id,
- char **exchange_url,
- struct TALER_ReservePrivateKeyP *reserve_priv,
- unsigned int sigs_length,
- struct GNUNET_CRYPTO_RsaSignature *sigs[]);
+ (*lookup_pickup)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *tip_id,
+ const struct GNUNET_HashCode *pickup_id,
+ char **exchange_url,
+ struct TALER_ReservePrivateKeyP *reserve_priv,
+ unsigned int sigs_length,
+ struct GNUNET_CRYPTO_RsaSignature *sigs[]);
/**
@@ -2047,14 +2047,14 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_tip)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *tip_id,
- struct TALER_Amount *total_authorized,
- struct TALER_Amount *total_picked_up,
- struct GNUNET_TIME_Absolute *expiration,
- char **exchange_url,
- struct TALER_ReservePrivateKeyP *reserve_priv);
+ (*lookup_tip)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *tip_id,
+ struct TALER_Amount *total_authorized,
+ struct TALER_Amount *total_picked_up,
+ struct GNUNET_TIME_Absolute *expiration,
+ char **exchange_url,
+ struct TALER_ReservePrivateKeyP *reserve_priv);
/**
@@ -2071,13 +2071,13 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_tips)(void *cls,
- const char *instance_id,
- enum TALER_EXCHANGE_YesNoAll expired,
- int64_t limit,
- uint64_t offset,
- TALER_MERCHANTDB_TipsCallback cb,
- void *cb_cls);
+ (*lookup_tips)(void *cls,
+ const char *instance_id,
+ enum TALER_EXCHANGE_YesNoAll expired,
+ int64_t limit,
+ uint64_t offset,
+ TALER_MERCHANTDB_TipsCallback cb,
+ void *cb_cls);
/**
@@ -2097,17 +2097,17 @@ struct TALER_MERCHANTDB_Plugin
* @return transaction status
*/
enum GNUNET_DB_QueryStatus
- (*lookup_tip_details)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *tip_id,
- bool fpu,
- struct TALER_Amount *total_authorized,
- struct TALER_Amount *total_picked_up,
- char **justification,
- struct GNUNET_TIME_Absolute *expiration,
- struct TALER_ReservePublicKeyP *reserve_pub,
- unsigned int *pickups_length,
- struct TALER_MERCHANTDB_PickupDetails **pickups);
+ (*lookup_tip_details)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *tip_id,
+ bool fpu,
+ struct TALER_Amount *total_authorized,
+ struct TALER_Amount *total_picked_up,
+ char **justification,
+ struct GNUNET_TIME_Absolute *expiration,
+ struct TALER_ReservePublicKeyP *reserve_pub,
+ unsigned int *pickups_length,
+ struct TALER_MERCHANTDB_PickupDetails **pickups);
/**
@@ -2129,12 +2129,12 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if @a credit_uuid already known
*/
enum GNUNET_DB_QueryStatus
- (*insert_pickup)(void *cls,
- const char *instance_id,
- const struct GNUNET_HashCode *tip_id,
- const struct TALER_Amount *total_picked_up,
- const struct GNUNET_HashCode *pickup_id,
- const struct TALER_Amount *total_requested);
+ (*insert_pickup)(void *cls,
+ const char *instance_id,
+ const struct GNUNET_HashCode *tip_id,
+ const struct TALER_Amount *total_picked_up,
+ const struct GNUNET_HashCode *pickup_id,
+ const struct TALER_Amount *total_requested);
/**
@@ -2150,7 +2150,7 @@ struct TALER_MERCHANTDB_Plugin
* #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if @a credit_uuid already known
*/
enum GNUNET_DB_QueryStatus
- (*insert_pickup_blind_signature)(
+ (*insert_pickup_blind_signature)(
void *cls,
const struct GNUNET_HashCode *pickup_id,
uint32_t offset,