commit ec196ace7cc6a8ebdf970f2561792594e7a12562 parent e1aa389c7c78250c00f81eadcf7848aeb3e8f0b7 Author: Christian Grothoff <christian@grothoff.org> Date: Wed, 4 Mar 2026 00:00:36 +0100 clean up include usage Diffstat:
677 files changed, 1060 insertions(+), 19360 deletions(-)
diff --git a/src/backend/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c @@ -18,14 +18,14 @@ * @brief Process that inquires with the exchange for deposits that should have been wired * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <pthread.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" #include <taler/taler_dbevents.h> /** diff --git a/src/backend/taler-merchant-donaukeyupdate.c b/src/backend/taler-merchant-donaukeyupdate.c @@ -19,17 +19,17 @@ * @author Bohdan Potuzhnyi * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #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" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchant_bank_lib.h" /** * Maximum frequency for the Donau interaction. diff --git a/src/backend/taler-merchant-exchangekeyupdate.c b/src/backend/taler-merchant-exchangekeyupdate.c @@ -18,7 +18,7 @@ * @brief Process that ensures our /keys data for all exchanges is current * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> @@ -28,11 +28,11 @@ struct Exchange; #define TALER_EXCHANGE_GET_KEYS_RESULT_CLOSURE struct Exchange #include <taler/taler-exchange/get-keys.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" -#include "taler_merchant_util.h" -#include "taler_merchant_bank_lib.h" -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_bank_lib.h" +#include "taler/taler_merchantdb_lib.h" /** * Maximum frequency for the exchange interaction. diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -22,13 +22,13 @@ * @author Florian Dold * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_dbevents.h> #include <taler/taler_bank_service.h> #include <taler/taler_mhd_lib.h> #include <taler/taler_templating_lib.h> #include <taler/taler_exchange_service.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include "taler-merchant-httpd_auth.h" #include "taler-merchant-httpd_dispatcher.h" #include "taler-merchant-httpd_helper.h" diff --git a/src/backend/taler-merchant-httpd.h b/src/backend/taler-merchant-httpd.h @@ -21,11 +21,11 @@ #ifndef TALER_MERCHANT_HTTPD_H #define TALER_MERCHANT_HTTPD_H -#include "platform.h" -#include "taler_merchantdb_lib.h" +#include "taler/platform.h" +#include "taler/taler_merchantdb_lib.h" #include <taler/taler_mhd_lib.h> #include <gnunet/gnunet_mhd_compat.h> -#include "taler_merchant_bank_lib.h" +#include "taler/taler_merchant_bank_lib.h" #include <regex.h> diff --git a/src/backend/taler-merchant-httpd_auth.c b/src/backend/taler-merchant-httpd_auth.c @@ -19,7 +19,7 @@ * @author Martin Schanzenbach * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_contract.c b/src/backend/taler-merchant-httpd_contract.c @@ -18,7 +18,7 @@ * @brief shared logic for contract terms handling * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <jansson.h> #include <stdint.h> diff --git a/src/backend/taler-merchant-httpd_contract.h b/src/backend/taler-merchant-httpd_contract.h @@ -24,7 +24,7 @@ #include "taler-merchant-httpd.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_time_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <jansson.h> diff --git a/src/backend/taler-merchant-httpd_dispatcher.c b/src/backend/taler-merchant-httpd_dispatcher.c @@ -18,7 +18,7 @@ * @brief map requested URL and method to the respective request handler * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_get-config.h" #include "taler-merchant-httpd_get-exchanges.h" #include "taler-merchant-httpd_dispatcher.h" diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c @@ -19,7 +19,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> #include "taler-merchant-httpd_exchanges.h" diff --git a/src/backend/taler-merchant-httpd_get-config.c b/src/backend/taler-merchant-httpd_get-config.c @@ -18,7 +18,7 @@ * @brief implement API for querying configuration data of the backend * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_get-exchanges.c b/src/backend/taler-merchant-httpd_get-exchanges.c @@ -18,7 +18,7 @@ * @brief implement API for querying exchange status * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c b/src/backend/taler-merchant-httpd_get-orders-ID.c @@ -19,7 +19,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <gnunet/gnunet_uri_lib.h> #include <gnunet/gnunet_common.h> @@ -34,7 +34,7 @@ #include "taler-merchant-httpd_qr.h" #include "taler/taler_error_codes.h" #include "taler/taler_util.h" -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** * How often do we retry DB transactions on serialization failures? diff --git a/src/backend/taler-merchant-httpd_get-products-HASH-image.c b/src/backend/taler-merchant-httpd_get-products-HASH-image.c @@ -18,7 +18,7 @@ * @brief implement GET /products/$HASH/image * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_get-products-HASH-image.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_error_codes.h> diff --git a/src/backend/taler-merchant-httpd_get-sessions-ID.c b/src/backend/taler-merchant-httpd_get-sessions-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /session/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_get-sessions-ID.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_get-templates-ID.c b/src/backend/taler-merchant-httpd_get-templates-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /templates/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_get-templates-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_get-webui.c b/src/backend/taler-merchant-httpd_get-webui.c @@ -18,11 +18,11 @@ * @brief logic to load the single page app (/) * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <taler/taler_util.h> #include <taler/taler_mhd_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include "taler-merchant-httpd_statics.h" #include "taler-merchant-httpd_get-webui.h" #include <gnunet/gnunet_mhd_compat.h> diff --git a/src/backend/taler-merchant-httpd_helper.c b/src/backend/taler-merchant-httpd_helper.c @@ -18,7 +18,7 @@ * @brief shared logic for various handlers * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_helper.h b/src/backend/taler-merchant-httpd_helper.h @@ -27,7 +27,7 @@ #include "taler-merchant-httpd.h" -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** * check @a accounts for well-formedness @@ -344,13 +344,13 @@ TMH_make_order_status_url (struct MHD_Connection *con, * @param hr a `TALER_EXCHANGE_HttpResponse` */ #define TMH_pack_exchange_reply(hr) \ - GNUNET_JSON_pack_uint64 ("exchange_code", (hr)->ec), \ - GNUNET_JSON_pack_uint64 ("exchange_http_status", (hr)->http_status), \ - GNUNET_JSON_pack_uint64 ("exchange_ec", (hr)->ec), /* LEGACY */ \ - GNUNET_JSON_pack_uint64 ("exchange_hc", (hr)->http_status), /* LEGACY */ \ - GNUNET_JSON_pack_allow_null ( \ - GNUNET_JSON_pack_object_incref ("exchange_reply", (json_t *) (hr)-> \ - reply)) + GNUNET_JSON_pack_uint64 ("exchange_code", (hr)->ec), \ + GNUNET_JSON_pack_uint64 ("exchange_http_status", (hr)->http_status), \ + GNUNET_JSON_pack_uint64 ("exchange_ec", (hr)->ec), /* LEGACY */ \ + GNUNET_JSON_pack_uint64 ("exchange_hc", (hr)->http_status), /* LEGACY */ \ + GNUNET_JSON_pack_allow_null ( \ + GNUNET_JSON_pack_object_incref ("exchange_reply", (json_t *) (hr)-> \ + reply)) /** diff --git a/src/backend/taler-merchant-httpd_mfa.c b/src/backend/taler-merchant-httpd_mfa.c @@ -22,7 +22,7 @@ * @brief internal APIs for multi-factor authentication (MFA) * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_mfa.h" diff --git a/src/backend/taler-merchant-httpd_mfa.h b/src/backend/taler-merchant-httpd_mfa.h @@ -26,7 +26,7 @@ #define TALER_MERCHANT_HTTPD_MFA_H #include "taler-merchant-httpd.h" -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/backend/taler-merchant-httpd_mhd.c b/src/backend/taler-merchant-httpd_mhd.c @@ -22,7 +22,7 @@ * @author Benedikt Mueller * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include "taler-merchant-httpd_mhd.h" diff --git a/src/backend/taler-merchant-httpd_post-challenge-ID-confirm.c b/src/backend/taler-merchant-httpd_post-challenge-ID-confirm.c @@ -22,7 +22,7 @@ * @brief endpoint to solve MFA challenge * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_mfa.h" #include "taler-merchant-httpd_post-challenge-ID-confirm.h" diff --git a/src/backend/taler-merchant-httpd_post-challenge-ID.c b/src/backend/taler-merchant-httpd_post-challenge-ID.c @@ -22,7 +22,7 @@ * @brief endpoint to trigger sending MFA challenge * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_mfa.h" #include "taler-merchant-httpd_post-challenge-ID.h" diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_json_lib.h> #include <taler/taler_exchange_service.h> #include "taler-merchant-httpd_exchanges.h" diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c @@ -23,7 +23,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_signatures.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-paid.c b/src/backend/taler-merchant-httpd_post-orders-ID-paid.c @@ -22,7 +22,7 @@ * @brief handling of POST /orders/$ID/paid requests * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_dbevents.h> #include <taler/taler_signatures.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -24,7 +24,7 @@ * @author Christian Grothoff * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_db_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -44,8 +44,8 @@ #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd_post-orders-ID-pay.h" #include "taler-merchant-httpd_private-get-orders.h" -#include "taler_merchant_util.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_plugin.h" #ifdef HAVE_DONAU_DONAU_SERVICE_H #include <donau/donau_service.h> diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_post-orders-ID-refund.c @@ -22,7 +22,7 @@ * @brief handling of POST /orders/$ID/refund requests * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_dbevents.h> #include <taler/taler_signatures.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-unclaim.c b/src/backend/taler-merchant-httpd_post-orders-ID-unclaim.c @@ -22,7 +22,7 @@ * @brief headers for POST /orders/$ID/unclaim handler * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_signatures.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_post-reports-ID.c b/src/backend/taler-merchant-httpd_post-reports-ID.c @@ -20,7 +20,7 @@ * @brief implementation of POST /reports/$REPORT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_dispatcher.h" #include "taler-merchant-httpd_post-reports-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_post-templates-ID.c b/src/backend/taler-merchant-httpd_post-templates-ID.c @@ -23,12 +23,12 @@ * @author Priscilla HUANG * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_post-templates-ID.h" #include "taler-merchant-httpd_private-post-orders.h" #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd_exchanges.h" -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <taler/taler_json_lib.h> #include <regex.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-account-ID.c b/src/backend/taler-merchant-httpd_private-delete-account-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /account/$H_WIRE * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-account-ID.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-categories-ID.c b/src/backend/taler-merchant-httpd_private-delete-categories-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /private/categories/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-categories-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-donau-instance-ID.c b/src/backend/taler-merchant-httpd_private-delete-donau-instance-ID.c @@ -20,7 +20,7 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-donau-instance-ID.h" #include <taler/taler_json_lib.h> #include <taler/taler_error_codes.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-group-ID.c b/src/backend/taler-merchant-httpd_private-delete-group-ID.c @@ -20,7 +20,7 @@ * @brief implementation of DELETE /private/groups/$GROUP_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-group-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-instances-ID-token.c b/src/backend/taler-merchant-httpd_private-delete-instances-ID-token.c @@ -22,7 +22,7 @@ * @brief implementing DELETE /instances/$ID/token request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-instances-ID-token.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-instances-ID.c b/src/backend/taler-merchant-httpd_private-delete-instances-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /instances/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-instances-ID.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-orders-ID.c b/src/backend/taler-merchant-httpd_private-delete-orders-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /orders/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-orders-ID.h" #include <stdint.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-otp-devices-ID.c b/src/backend/taler-merchant-httpd_private-delete-otp-devices-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /otp-devices/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-otp-devices-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-pot-ID.c b/src/backend/taler-merchant-httpd_private-delete-pot-ID.c @@ -20,7 +20,7 @@ * @brief implementation of DELETE /private/pots/$POT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-pot-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-products-ID.c b/src/backend/taler-merchant-httpd_private-delete-products-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /products/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-products-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-report-ID.c b/src/backend/taler-merchant-httpd_private-delete-report-ID.c @@ -20,7 +20,7 @@ * @brief implementation of DELETE /private/reports/$REPORT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-report-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-templates-ID.c b/src/backend/taler-merchant-httpd_private-delete-templates-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /templates/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-templates-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-token-families-SLUG.c b/src/backend/taler-merchant-httpd_private-delete-token-families-SLUG.c @@ -18,7 +18,7 @@ * @brief implement DELETE /tokenfamilies/$SLUG * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-token-families-SLUG.h" #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c b/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /transfers/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-transfers-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-delete-units-ID.c b/src/backend/taler-merchant-httpd_private-delete-units-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /private/units/$UNIT * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-units-ID.h" diff --git a/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-delete-webhooks-ID.c @@ -18,7 +18,7 @@ * @brief implement DELETE /webhooks/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-delete-webhooks-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-accounts-ID.c b/src/backend/taler-merchant-httpd_private-get-accounts-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /accounts/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-accounts-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-accounts.c b/src/backend/taler-merchant-httpd_private-get-accounts.c @@ -18,7 +18,7 @@ * @brief implement GET /accounts * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-accounts.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-categories-ID.c b/src/backend/taler-merchant-httpd_private-get-categories-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /private/categories/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-categories-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-categories.c b/src/backend/taler-merchant-httpd_private-get-categories.c @@ -18,7 +18,7 @@ * @brief implement GET /categories * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-categories.h" diff --git a/src/backend/taler-merchant-httpd_private-get-donau-instances.c b/src/backend/taler-merchant-httpd_private-get-donau-instances.c @@ -19,12 +19,12 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> -#include "taler_merchant_donau.h" -#include "taler_merchant_service.h" +#include "taler/taler_merchant_donau.h" +#include "taler/taler_merchant_service.h" #include "taler-merchant-httpd_private-get-donau-instances.h" diff --git a/src/backend/taler-merchant-httpd_private-get-groups.c b/src/backend/taler-merchant-httpd_private-get-groups.c @@ -20,7 +20,7 @@ * @brief implementation of GET /private/groups * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-groups.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-incoming-ID.c b/src/backend/taler-merchant-httpd_private-get-incoming-ID.c @@ -18,7 +18,7 @@ * @brief implement API for obtaining details about an expected incoming wire transfer * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_private-get-incoming-ID.h" diff --git a/src/backend/taler-merchant-httpd_private-get-incoming.c b/src/backend/taler-merchant-httpd_private-get-incoming.c @@ -18,7 +18,7 @@ * @brief implement API for obtaining a list of expected incoming wire transfers * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_private-get-incoming.h" diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c @@ -22,7 +22,7 @@ * @brief implementing GET /instances/$ID/kyc request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-instances-ID-kyc.h" #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd_exchanges.h" diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-tokens.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-tokens.c @@ -18,7 +18,7 @@ * @brief implement GET /tokens * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_auth.h" #include "taler-merchant-httpd_private-get-instances-ID-tokens.h" diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID.c b/src/backend/taler-merchant-httpd_private-get-instances-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /instances/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-instances-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-instances.c b/src/backend/taler-merchant-httpd_private-get-instances.c @@ -18,7 +18,7 @@ * @brief implement GET /instances * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-instances.h" /** diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c @@ -21,14 +21,14 @@ * @author Bohdan Potuzhnyi * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> #include <taler/taler_error_codes.h> #include <taler/taler_util.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd_private-get-orders.h" #include "taler-merchant-httpd_private-get-orders-ID.h" diff --git a/src/backend/taler-merchant-httpd_private-get-orders.c b/src/backend/taler-merchant-httpd_private-get-orders.c @@ -20,9 +20,9 @@ * * FIXME-cleanup: consider introducing phases / state machine */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-orders.h" -#include <taler_merchant_util.h> +#include <taler/taler_merchant_util.h> #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-get-otp-devices-ID.c b/src/backend/taler-merchant-httpd_private-get-otp-devices-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /otp-devices/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-otp-devices-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-otp-devices.c b/src/backend/taler-merchant-httpd_private-get-otp-devices.c @@ -18,7 +18,7 @@ * @brief implement GET /otp-devices * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-otp-devices.h" diff --git a/src/backend/taler-merchant-httpd_private-get-pos.c b/src/backend/taler-merchant-httpd_private-get-pos.c @@ -18,7 +18,7 @@ * @brief implement GET /private/pos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-pos.h" #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_helper.h" diff --git a/src/backend/taler-merchant-httpd_private-get-pot-ID.c b/src/backend/taler-merchant-httpd_private-get-pot-ID.c @@ -20,7 +20,7 @@ * @brief implementation of GET /private/pots/$POT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-pot-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-pots.c b/src/backend/taler-merchant-httpd_private-get-pots.c @@ -20,7 +20,7 @@ * @brief implementation of GET /private/pots * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-pots.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-products-ID.c b/src/backend/taler-merchant-httpd_private-get-products-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /products/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-products-ID.h" #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_helper.h" diff --git a/src/backend/taler-merchant-httpd_private-get-products.c b/src/backend/taler-merchant-httpd_private-get-products.c @@ -18,7 +18,7 @@ * @brief implement GET /products * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-products.h" diff --git a/src/backend/taler-merchant-httpd_private-get-report-ID.c b/src/backend/taler-merchant-httpd_private-get-report-ID.c @@ -20,7 +20,7 @@ * @brief implementation of GET /private/reports/$REPORT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-report-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-reports.c b/src/backend/taler-merchant-httpd_private-get-reports.c @@ -20,7 +20,7 @@ * @brief implementation of GET /private/reports * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-reports.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-get-statistics-amount-SLUG.c b/src/backend/taler-merchant-httpd_private-get-statistics-amount-SLUG.c @@ -18,7 +18,7 @@ * @brief implement GET /statistics-amount/$SLUG/ * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-statistics-amount-SLUG.h" #include <gnunet/gnunet_json_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-statistics-counter-SLUG.c b/src/backend/taler-merchant-httpd_private-get-statistics-counter-SLUG.c @@ -18,7 +18,7 @@ * @brief implement GET /statistics-counter/$SLUG/ * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-statistics-counter-SLUG.h" #include <gnunet/gnunet_json_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-statistics-report-transactions.c b/src/backend/taler-merchant-httpd_private-get-statistics-report-transactions.c @@ -18,7 +18,7 @@ * @brief implement GET /statistics-report/transactions * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-statistics-report-transactions.h" #include <gnunet/gnunet_json_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.c b/src/backend/taler-merchant-httpd_private-get-templates-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /templates/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-templates-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-templates.c b/src/backend/taler-merchant-httpd_private-get-templates.c @@ -18,7 +18,7 @@ * @brief implement GET /templates * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-templates.h" diff --git a/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c b/src/backend/taler-merchant-httpd_private-get-token-families-SLUG.c @@ -18,7 +18,7 @@ * @brief implement GET /tokenfamilies/$SLUG/ * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-token-families-SLUG.h" #include <gnunet/gnunet_json_lib.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-token-families.c b/src/backend/taler-merchant-httpd_private-get-token-families.c @@ -18,7 +18,7 @@ * @brief implement GET /tokenfamilies * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-token-families.h" diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c b/src/backend/taler-merchant-httpd_private-get-transfers.c @@ -19,7 +19,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_private-get-transfers.h" diff --git a/src/backend/taler-merchant-httpd_private-get-units-ID.c b/src/backend/taler-merchant-httpd_private-get-units-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /private/units/$UNIT * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-units-ID.h" @@ -72,7 +72,8 @@ TMH_private_get_units_ID (const struct TMH_RequestHandler *rh, "unit_name_short_i18n", ud.unit_name_short_i18n), GNUNET_JSON_pack_bool ("unit_allow_fraction", - ud.unit_allow_fraction), + ud.unit_allow_fraction + ), GNUNET_JSON_pack_uint64 ( "unit_precision_level", ud.unit_precision_level), diff --git a/src/backend/taler-merchant-httpd_private-get-units.c b/src/backend/taler-merchant-httpd_private-get-units.c @@ -18,7 +18,7 @@ * @brief implement GET /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-units.h" diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-get-webhooks-ID.c @@ -18,7 +18,7 @@ * @brief implement GET /webhooks/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-webhooks-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-get-webhooks.c b/src/backend/taler-merchant-httpd_private-get-webhooks.c @@ -18,7 +18,7 @@ * @brief implement GET /webhooks * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-get-webhooks.h" diff --git a/src/backend/taler-merchant-httpd_private-patch-accounts-ID.c b/src/backend/taler-merchant-httpd_private-patch-accounts-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /accounts/$ID request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-accounts-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-categories-ID.c b/src/backend/taler-merchant-httpd_private-patch-categories-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /categories/$ID request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-categories-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-group-ID.c b/src/backend/taler-merchant-httpd_private-patch-group-ID.c @@ -20,7 +20,7 @@ * @brief implementation of PATCH /private/groups/$GROUP_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-group-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-instances-ID.c b/src/backend/taler-merchant-httpd_private-patch-instances-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /instances/$ID request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-instances-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c b/src/backend/taler-merchant-httpd_private-patch-orders-ID-forget.c @@ -21,7 +21,7 @@ * @brief implementing PATCH /orders/$ORDER_ID/forget request handling * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-orders-ID-forget.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-otp-devices-ID.c b/src/backend/taler-merchant-httpd_private-patch-otp-devices-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /otp-devices/$ID request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-otp-devices-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> @@ -46,7 +46,7 @@ TMH_private_patch_otp_devices_ID (const struct TMH_RequestHandler *rh, GNUNET_JSON_spec_uint64 ("otp_ctr", &tp.otp_ctr), NULL), - GNUNET_JSON_spec_mark_optional( + GNUNET_JSON_spec_mark_optional ( TALER_JSON_spec_otp_key ("otp_key", (const char **) &tp.otp_key), diff --git a/src/backend/taler-merchant-httpd_private-patch-pot-ID.c b/src/backend/taler-merchant-httpd_private-patch-pot-ID.c @@ -20,7 +20,7 @@ * @brief implementation of PATCH /private/pots/$POT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-pot-ID.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-products-ID.c b/src/backend/taler-merchant-httpd_private-patch-products-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /products/$ID request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-products-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-report-ID.c b/src/backend/taler-merchant-httpd_private-patch-report-ID.c @@ -20,7 +20,7 @@ * @brief implementation of PATCH /private/reports/$REPORT_ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-report-ID.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.c b/src/backend/taler-merchant-httpd_private-patch-templates-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /templates/$ID request handling * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-templates-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-token-families-SLUG.c b/src/backend/taler-merchant-httpd_private-patch-token-families-SLUG.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /tokenfamilies/$SLUG request handling * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-token-families-SLUG.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-units-ID.c b/src/backend/taler-merchant-httpd_private-patch-units-ID.c @@ -18,7 +18,7 @@ * @brief implement PATCH /private/units/$UNIT * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-units-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c @@ -22,7 +22,7 @@ * @brief implementing PATCH /webhooks/$ID request handling * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-patch-webhooks-ID.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-account.c b/src/backend/taler-merchant-httpd_private-post-account.c @@ -22,10 +22,10 @@ * @brief implementing POST /private/accounts request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-account.h" #include "taler-merchant-httpd_helper.h" -#include "taler_merchant_bank_lib.h" +#include "taler/taler_merchant_bank_lib.h" #include <taler/taler_dbevents.h> #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_mfa.h" diff --git a/src/backend/taler-merchant-httpd_private-post-categories.c b/src/backend/taler-merchant-httpd_private-post-categories.c @@ -21,7 +21,7 @@ * @brief implementing POST /private/categories request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-categories.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-donau-instance.c b/src/backend/taler-merchant-httpd_private-post-donau-instance.c @@ -20,12 +20,12 @@ * @author Vlada Svirsh * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include "donau/donau_service.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "taler-merchant-httpd_private-post-donau-instance.h" /** diff --git a/src/backend/taler-merchant-httpd_private-post-groups.c b/src/backend/taler-merchant-httpd_private-post-groups.c @@ -20,7 +20,7 @@ * @brief implementation of POST /private/groups * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-groups.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c b/src/backend/taler-merchant-httpd_private-post-instances-ID-auth.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-instances-ID-auth.h" #include "taler-merchant-httpd_auth.h" #include "taler-merchant-httpd_helper.h" diff --git a/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c b/src/backend/taler-merchant-httpd_private-post-instances-ID-token.c @@ -22,7 +22,7 @@ * @brief implementing POST /instances/$ID/token request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-instances-ID-token.h" #include "taler-merchant-httpd_auth.h" #include "taler-merchant-httpd_helper.h" diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c b/src/backend/taler-merchant-httpd_private-post-instances.c @@ -22,13 +22,13 @@ * @brief implementing POST /instances request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-instances.h" #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_auth.h" #include "taler-merchant-httpd_mfa.h" -#include "taler_merchant_bank_lib.h" +#include "taler/taler_merchant_bank_lib.h" #include <taler/taler_dbevents.h> #include <taler/taler_json_lib.h> #include <regex.h> diff --git a/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c b/src/backend/taler-merchant-httpd_private-post-orders-ID-refund.c @@ -19,7 +19,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_dbevents.h> #include <taler/taler_signatures.h> diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c b/src/backend/taler-merchant-httpd_private-post-orders.c @@ -24,7 +24,7 @@ * @author Marcello Stanisci * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_db_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -37,7 +37,7 @@ #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> #include <taler/taler_util.h> -#include <taler_merchant_util.h> +#include <taler/taler_merchant_util.h> #include <time.h> #include "taler-merchant-httpd.h" #include "taler-merchant-httpd_private-post-orders.h" @@ -46,7 +46,7 @@ #include "taler-merchant-httpd_helper.h" #include "taler-merchant-httpd_private-get-orders.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backend/taler-merchant-httpd_private-post-otp-devices.c b/src/backend/taler-merchant-httpd_private-post-otp-devices.c @@ -22,7 +22,7 @@ * @brief implementing POST /otp-devices request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-otp-devices.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-pots.c b/src/backend/taler-merchant-httpd_private-post-pots.c @@ -20,7 +20,7 @@ * @brief implementation of POST /private/pots * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-pots.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c b/src/backend/taler-merchant-httpd_private-post-products-ID-lock.c @@ -22,7 +22,7 @@ * @brief implementing POST /products/$ID/lock request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-products-ID-lock.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-products.c b/src/backend/taler-merchant-httpd_private-post-products.c @@ -22,7 +22,7 @@ * @brief implementing POST /products request handling * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-products.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-reports.c b/src/backend/taler-merchant-httpd_private-post-reports.c @@ -20,7 +20,7 @@ * @brief implementation of POST /private/reports * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-reports.h" #include <taler/taler_json_lib.h> #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c b/src/backend/taler-merchant-httpd_private-post-templates.c @@ -22,7 +22,7 @@ * @brief implementing POST /templates request handling * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-templates.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-token-families.c b/src/backend/taler-merchant-httpd_private-post-token-families.c @@ -22,7 +22,7 @@ * @brief implementing POST /tokenfamilies request handling * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-token-families.h" #include "taler-merchant-httpd_helper.h" #include <gnunet/gnunet_time_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-transfers.c b/src/backend/taler-merchant-httpd_private-post-transfers.c @@ -19,7 +19,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_signatures.h> #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-units.c b/src/backend/taler-merchant-httpd_private-post-units.c @@ -18,7 +18,7 @@ * @brief implement POST /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-units.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_private-post-webhooks.c b/src/backend/taler-merchant-httpd_private-post-webhooks.c @@ -22,7 +22,7 @@ * @brief implementing POST /webhooks request handling * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler-merchant-httpd_private-post-webhooks.h" #include "taler-merchant-httpd_helper.h" #include <taler/taler_json_lib.h> diff --git a/src/backend/taler-merchant-httpd_qr.c b/src/backend/taler-merchant-httpd_qr.c @@ -18,7 +18,7 @@ * @brief logic to create QR codes in HTML * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <qrencode.h> #include <taler-merchant-httpd_qr.h> diff --git a/src/backend/taler-merchant-httpd_statics.c b/src/backend/taler-merchant-httpd_statics.c @@ -18,9 +18,9 @@ * @brief logic to load and return static resource files by client language preference * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <taler/taler_util.h> #include <taler/taler_mhd_lib.h> #include <taler/taler_templating_lib.h> diff --git a/src/backend/taler-merchant-kyccheck.c b/src/backend/taler-merchant-kyccheck.c @@ -18,7 +18,7 @@ * @brief Process that check the KYC status of our bank accounts at all exchanges * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> @@ -27,10 +27,10 @@ #include <taler/taler_dbevents.h> #include <taler/taler_json_lib.h> #include <taler/taler_exchange_service.h> -#include "taler_merchant_util.h" -#include "taler_merchant_bank_lib.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_bank_lib.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" /** * Timeout for the exchange interaction. Rather long as we should do diff --git a/src/backend/taler-merchant-reconciliation.c b/src/backend/taler-merchant-reconciliation.c @@ -18,16 +18,16 @@ * @brief Process that reconciles information about incoming bank transfers with orders by asking the exchange * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <pthread.h> #include <taler/taler_dbevents.h> -#include "taler_merchant_util.h" -#include "taler_merchant_bank_lib.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_bank_lib.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" /** * Timeout for the exchange interaction. Rather long as we should do diff --git a/src/backend/taler-merchant-report-generator.c b/src/backend/taler-merchant-report-generator.c @@ -19,17 +19,17 @@ * @brief Service for fetching and transmitting merchant reports * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include <taler_merchant_util.h> +#include <taler/taler_merchant_util.h> #include <taler/taler_curl_lib.h> #include <taler/taler_dbevents.h> #include <taler/taler_error_codes.h> -#include "taler_merchantdb_plugin.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchant_service.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchant_service.h" #include <microhttpd.h> #include <curl/curl.h> diff --git a/src/backend/taler-merchant-webhook.c b/src/backend/taler-merchant-webhook.c @@ -18,14 +18,14 @@ * @brief Process that runs webhooks triggered by the merchant backend * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <pthread.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" #include <taler/taler_dbevents.h> diff --git a/src/backend/taler-merchant-wirewatch.c b/src/backend/taler-merchant-wirewatch.c @@ -18,16 +18,16 @@ * @brief Process that imports information about incoming bank transfers into the merchant backend * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <pthread.h> #include <taler/taler_dbevents.h> -#include "taler_merchant_util.h" -#include "taler_merchant_bank_lib.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_bank_lib.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/merchantdb_helper.c b/src/backenddb/merchantdb_helper.c @@ -19,9 +19,9 @@ * @author Christian Grothoff * @author Priscilla Huang */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_lib.h" void diff --git a/src/backenddb/merchantdb_plugin.c b/src/backenddb/merchantdb_plugin.c @@ -19,11 +19,11 @@ * @author Christian Grothoff * @author Sree Harsha Totakura <sreeharsha@totakura.in> */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_plugin.h" -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_lib.h" #include <ltdl.h> diff --git a/src/backenddb/pg_account_kyc_get_outdated.c b/src/backenddb/pg_account_kyc_get_outdated.c @@ -18,7 +18,7 @@ * @brief Implementation of the account_kyc_get_outdated function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_account_kyc_get_outdated.h b/src/backenddb/pg_account_kyc_get_outdated.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Find accounts requiring KYC checks. diff --git a/src/backenddb/pg_account_kyc_get_status.c b/src/backenddb/pg_account_kyc_get_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the account_kyc_get_status function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_account_kyc_get_status.h b/src/backenddb/pg_account_kyc_get_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Check an instance's account's KYC status. Triggers diff --git a/src/backenddb/pg_account_kyc_set_failed.c b/src/backenddb/pg_account_kyc_set_failed.c @@ -18,7 +18,7 @@ * @brief Implementation of the account_kyc_set_failed function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_account_kyc_set_failed.h b/src/backenddb/pg_account_kyc_set_failed.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_account_kyc_set_status.c b/src/backenddb/pg_account_kyc_set_status.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_account_kyc_set_status.h b/src/backenddb/pg_account_kyc_set_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update an instance's account's KYC status. diff --git a/src/backenddb/pg_activate_account.c b/src/backenddb/pg_activate_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the activate_account function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_activate_account.h b/src/backenddb/pg_activate_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Set an instance's account in our database to "active". diff --git a/src/backenddb/pg_check_donau_instance.c b/src/backenddb/pg_check_donau_instance.c @@ -18,7 +18,7 @@ * @brief Implementation of the check_donau_instance function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_check_donau_instance.h b/src/backenddb/pg_check_donau_instance.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_check_money_pots.c b/src/backenddb/pg_check_money_pots.c @@ -18,7 +18,7 @@ * @brief Implementation of the check_money_pots function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_check_money_pots.h b/src/backenddb/pg_check_money_pots.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_check_report.c b/src/backenddb/pg_check_report.c @@ -18,7 +18,7 @@ * @brief Implementation of the check_report function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_check_report.h b/src/backenddb/pg_check_report.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_check_transfer_exists.c b/src/backenddb/pg_check_transfer_exists.c @@ -18,7 +18,7 @@ * @brief Implementation of the check_transfer_exists function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_check_transfer_exists.h b/src/backenddb/pg_check_transfer_exists.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Check if information about a transfer exists with the diff --git a/src/backenddb/pg_create_mfa_challenge.c b/src/backenddb/pg_create_mfa_challenge.c @@ -18,7 +18,7 @@ * @brief Implementation of the create_mfa_challenge function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_create_mfa_challenge.h b/src/backenddb/pg_create_mfa_challenge.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_category.c b/src/backenddb/pg_delete_category.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_category function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_category.h b/src/backenddb/pg_delete_category.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a product category. diff --git a/src/backenddb/pg_delete_contract_terms.c b/src/backenddb/pg_delete_contract_terms.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_contract_terms function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_contract_terms.h b/src/backenddb/pg_delete_contract_terms.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a contract. Note that the transaction must diff --git a/src/backenddb/pg_delete_donau_instance.c b/src/backenddb/pg_delete_donau_instance.c @@ -19,7 +19,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_donau_instance.h b/src/backenddb/pg_delete_donau_instance.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete an existing Donau charity instance from the database. diff --git a/src/backenddb/pg_delete_exchange_accounts.c b/src/backenddb/pg_delete_exchange_accounts.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_exchange_accounts function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_exchange_accounts.h b/src/backenddb/pg_delete_exchange_accounts.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_instance_private_key.c b/src/backenddb/pg_delete_instance_private_key.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_instance_private_key function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_instance_private_key.h b/src/backenddb/pg_delete_instance_private_key.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete private key of an instance from our database. diff --git a/src/backenddb/pg_delete_login_token.c b/src/backenddb/pg_delete_login_token.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_login_token function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_login_token.h b/src/backenddb/pg_delete_login_token.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete login token from database by serial. diff --git a/src/backenddb/pg_delete_money_pot.c b/src/backenddb/pg_delete_money_pot.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_money_pot function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_money_pot.h b/src/backenddb/pg_delete_money_pot.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a money pot. diff --git a/src/backenddb/pg_delete_order.c b/src/backenddb/pg_delete_order.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_order function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_order.h b/src/backenddb/pg_delete_order.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about an order. Note that the transaction must diff --git a/src/backenddb/pg_delete_otp.c b/src/backenddb/pg_delete_otp.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_otp function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_otp.h b/src/backenddb/pg_delete_otp.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_pending_webhook.c b/src/backenddb/pg_delete_pending_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_pending_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_pending_webhook.h b/src/backenddb/pg_delete_pending_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete a webhook in the pending webhook after the diff --git a/src/backenddb/pg_delete_product.c b/src/backenddb/pg_delete_product.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_product function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_product.h b/src/backenddb/pg_delete_product.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a product. Note that the transaction must diff --git a/src/backenddb/pg_delete_product_group.c b/src/backenddb/pg_delete_product_group.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_product_group function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_product_group.h b/src/backenddb/pg_delete_product_group.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_report.c b/src/backenddb/pg_delete_report.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_report function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_report.h b/src/backenddb/pg_delete_report.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_template.c b/src/backenddb/pg_delete_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_template function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -52,4 +52,3 @@ TMH_PG_delete_template (void *cls, "delete_template", params); } - diff --git a/src/backenddb/pg_delete_template.h b/src/backenddb/pg_delete_template.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_delete_token_family.c b/src/backenddb/pg_delete_token_family.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_token_family function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_token_family.h b/src/backenddb/pg_delete_token_family.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a token family. diff --git a/src/backenddb/pg_delete_transfer.c b/src/backenddb/pg_delete_transfer.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_transfer function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_transfer.h b/src/backenddb/pg_delete_transfer.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a transfer. Note that transfers diff --git a/src/backenddb/pg_delete_unit.c b/src/backenddb/pg_delete_unit.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_unit function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_unit.h b/src/backenddb/pg_delete_unit.h @@ -21,7 +21,7 @@ #ifndef PG_DELETE_UNIT_H #define PG_DELETE_UNIT_H -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete a measurement unit. diff --git a/src/backenddb/pg_delete_webhook.c b/src/backenddb/pg_delete_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the delete_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_delete_webhook.h b/src/backenddb/pg_delete_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Delete information about a webhook. diff --git a/src/backenddb/pg_expire_locks.c b/src/backenddb/pg_expire_locks.c @@ -18,7 +18,7 @@ * @brief Implementation of the expire_locks function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_expire_locks.h b/src/backenddb/pg_expire_locks.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Release all expired product locks, including diff --git a/src/backenddb/pg_finalize_transfer_status.c b/src/backenddb/pg_finalize_transfer_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the finalize_transfer_status function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_finalize_transfer_status.h b/src/backenddb/pg_finalize_transfer_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_gc.c b/src/backenddb/pg_gc.c @@ -18,7 +18,7 @@ * @brief Implementation of the gc function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_gc.h b/src/backenddb/pg_gc.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Garbage collect database. Removes unnecessary data. diff --git a/src/backenddb/pg_get_kyc_limits.c b/src/backenddb/pg_get_kyc_limits.c @@ -18,7 +18,7 @@ * @brief Implementation of the get_kyc_limits function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_get_kyc_limits.h b/src/backenddb/pg_get_kyc_limits.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Check an account's KYC limits at an exchange. diff --git a/src/backenddb/pg_get_kyc_status.c b/src/backenddb/pg_get_kyc_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the get_kyc_status function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_get_kyc_status.h b/src/backenddb/pg_get_kyc_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_helper.c b/src/backenddb/pg_helper.c @@ -18,7 +18,7 @@ * @brief shared internal definitions for postgres DB plugin * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "pg_helper.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_pq_lib.h> diff --git a/src/backenddb/pg_inactivate_account.c b/src/backenddb/pg_inactivate_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the inactivate_account function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_inactivate_account.h b/src/backenddb/pg_inactivate_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Set an instance's account in our database to "inactive". diff --git a/src/backenddb/pg_increase_refund.c b/src/backenddb/pg_increase_refund.c @@ -18,7 +18,7 @@ * @brief Implementation of the increase_refund function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_increase_refund.h b/src/backenddb/pg_increase_refund.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_increment_money_pots.c b/src/backenddb/pg_increment_money_pots.c @@ -18,7 +18,7 @@ * @brief Implementation of the increment_money_pots function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_increment_money_pots.h b/src/backenddb/pg_increment_money_pots.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Increment amounts in money pots. If a money pot does not exist, diff --git a/src/backenddb/pg_insert_account.c b/src/backenddb/pg_insert_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_account function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_account.h b/src/backenddb/pg_insert_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert information about an instance's account into our database. diff --git a/src/backenddb/pg_insert_category.c b/src/backenddb/pg_insert_category.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_category function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_category.h b/src/backenddb/pg_insert_category.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert new product category. diff --git a/src/backenddb/pg_insert_contract_terms.c b/src/backenddb/pg_insert_contract_terms.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_contract_terms function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_contract_terms.h b/src/backenddb/pg_insert_contract_terms.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Store contract terms given its @a order_id. Note that some attributes are diff --git a/src/backenddb/pg_insert_deposit.c b/src/backenddb/pg_insert_deposit.c @@ -19,7 +19,7 @@ * @author Christian Grothoff * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_deposit.h b/src/backenddb/pg_insert_deposit.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert payment confirmation from the exchange into the database. diff --git a/src/backenddb/pg_insert_deposit_confirmation.c b/src/backenddb/pg_insert_deposit_confirmation.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_deposit_confirmation function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_deposit_confirmation.h b/src/backenddb/pg_insert_deposit_confirmation.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert deposit confirmation from the exchange into the database. diff --git a/src/backenddb/pg_insert_deposit_to_transfer.c b/src/backenddb/pg_insert_deposit_to_transfer.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_deposit_to_transfer function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_deposit_to_transfer.h b/src/backenddb/pg_insert_deposit_to_transfer.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_donau_instance.c b/src/backenddb/pg_insert_donau_instance.c @@ -19,7 +19,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_donau_instance.h b/src/backenddb/pg_insert_donau_instance.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #include "donau/donau_service.h" /** diff --git a/src/backenddb/pg_insert_exchange_account.c b/src/backenddb/pg_insert_exchange_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_exchange_account function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_exchange_account.h b/src/backenddb/pg_insert_exchange_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert information about a wire account of an exchange. diff --git a/src/backenddb/pg_insert_exchange_keys.c b/src/backenddb/pg_insert_exchange_keys.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_exchange_keys function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_exchange_keys.h b/src/backenddb/pg_insert_exchange_keys.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_exchange_signkey.c b/src/backenddb/pg_insert_exchange_signkey.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_exchange_signkey function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_exchange_signkey.h b/src/backenddb/pg_insert_exchange_signkey.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert an exchange signing key into our database. diff --git a/src/backenddb/pg_insert_instance.c b/src/backenddb/pg_insert_instance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_instance.h b/src/backenddb/pg_insert_instance.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert information about an instance into our database. diff --git a/src/backenddb/pg_insert_issued_token.c b/src/backenddb/pg_insert_issued_token.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_issued_token function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_issued_token.h b/src/backenddb/pg_insert_issued_token.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** @@ -35,8 +35,11 @@ */ enum GNUNET_DB_QueryStatus TMH_PG_insert_issued_token (void *cls, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_TokenIssuePublicKeyHashP *h_issue_pub, - const struct TALER_BlindedTokenIssueSignature *blind_sig); + const struct TALER_PrivateContractHashP * + h_contract_terms, + const struct TALER_TokenIssuePublicKeyHashP * + h_issue_pub, + const struct TALER_BlindedTokenIssueSignature * + blind_sig); #endif diff --git a/src/backenddb/pg_insert_login_token.c b/src/backenddb/pg_insert_login_token.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_login_token function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_login_token.h b/src/backenddb/pg_insert_login_token.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_money_pot.c b/src/backenddb/pg_insert_money_pot.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_money_pot function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_money_pot.h b/src/backenddb/pg_insert_money_pot.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert details about a particular pot. diff --git a/src/backenddb/pg_insert_order.c b/src/backenddb/pg_insert_order.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_order.h b/src/backenddb/pg_insert_order.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert order into the DB. diff --git a/src/backenddb/pg_insert_order_blinded_sigs.c b/src/backenddb/pg_insert_order_blinded_sigs.c @@ -18,7 +18,7 @@ * @brief implementation of insert_order_blinded_sigs() for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_pq_lib.h> #include "pg_insert_order_blinded_sigs.h" diff --git a/src/backenddb/pg_insert_order_blinded_sigs.h b/src/backenddb/pg_insert_order_blinded_sigs.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_order_lock.c b/src/backenddb/pg_insert_order_lock.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_order_lock function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_order_lock.h b/src/backenddb/pg_insert_order_lock.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lock inventory stock to a particular order. diff --git a/src/backenddb/pg_insert_otp.c b/src/backenddb/pg_insert_otp.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_otp function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_otp.h b/src/backenddb/pg_insert_otp.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_pending_webhook.c b/src/backenddb/pg_insert_pending_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_pending_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_pending_webhook.h b/src/backenddb/pg_insert_pending_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert webhook in the pending webhook. diff --git a/src/backenddb/pg_insert_product.c b/src/backenddb/pg_insert_product.c @@ -19,7 +19,7 @@ * @author Christian Grothoff * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_product.h b/src/backenddb/pg_insert_product.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert details about a particular product. diff --git a/src/backenddb/pg_insert_product_group.c b/src/backenddb/pg_insert_product_group.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_product_group function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_product_group.h b/src/backenddb/pg_insert_product_group.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_refund_proof.c b/src/backenddb/pg_insert_refund_proof.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_refund_proof function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_refund_proof.h b/src/backenddb/pg_insert_refund_proof.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert refund proof data from the exchange into the database. @@ -38,6 +38,7 @@ enum GNUNET_DB_QueryStatus TMH_PG_insert_refund_proof (void *cls, uint64_t refund_serial, const struct TALER_ExchangeSignatureP *exchange_sig, - const struct TALER_ExchangePublicKeyP *exchange_pub); + const struct TALER_ExchangePublicKeyP *exchange_pub) +; #endif diff --git a/src/backenddb/pg_insert_report.c b/src/backenddb/pg_insert_report.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_report function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_report.h b/src/backenddb/pg_insert_report.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_spent_token.c b/src/backenddb/pg_insert_spent_token.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_spent_token function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_spent_token.h b/src/backenddb/pg_insert_spent_token.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_template.c b/src/backenddb/pg_insert_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_template function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_template.h b/src/backenddb/pg_insert_template.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_token_family.c b/src/backenddb/pg_insert_token_family.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_token_family function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_token_family.h b/src/backenddb/pg_insert_token_family.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** @@ -37,7 +37,7 @@ enum GNUNET_DB_QueryStatus TMH_PG_insert_token_family (void *cls, const char *instance_id, const char *token_family_slug, - const struct TALER_MERCHANTDB_TokenFamilyDetails *details); + const struct TALER_MERCHANTDB_TokenFamilyDetails * + details); #endif - diff --git a/src/backenddb/pg_insert_token_family_key.c b/src/backenddb/pg_insert_token_family_key.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_token_family_key function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_pq_lib.h> #include <taler/taler_error_codes.h> diff --git a/src/backenddb/pg_insert_token_family_key.h b/src/backenddb/pg_insert_token_family_key.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_transfer.c b/src/backenddb/pg_insert_transfer.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_transfer function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_transfer.h b/src/backenddb/pg_insert_transfer.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert information about a wire transfer the merchant has received. diff --git a/src/backenddb/pg_insert_transfer_details.c b/src/backenddb/pg_insert_transfer_details.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_transfer_details function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_transfer_details.h b/src/backenddb/pg_insert_transfer_details.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_insert_unclaim_signature.c b/src/backenddb/pg_insert_unclaim_signature.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_unclaim_signature function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_unclaim_signature.h b/src/backenddb/pg_insert_unclaim_signature.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert unclaim signature into DB and unclaim the order. diff --git a/src/backenddb/pg_insert_unit.c b/src/backenddb/pg_insert_unit.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_unit function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_unit.h b/src/backenddb/pg_insert_unit.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert a measurement unit definition. diff --git a/src/backenddb/pg_insert_webhook.c b/src/backenddb/pg_insert_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_insert_webhook.h b/src/backenddb/pg_insert_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Insert details about a particular webhook. diff --git a/src/backenddb/pg_lock_product.c b/src/backenddb/pg_lock_product.c @@ -18,7 +18,7 @@ * @brief Implementation of the lock_product function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lock_product.h b/src/backenddb/pg_lock_product.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lock stocks of a particular product. Note that the transaction must diff --git a/src/backenddb/pg_lookup_account.c b/src/backenddb/pg_lookup_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_account function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_account.h b/src/backenddb/pg_lookup_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup account serial by payto URI. diff --git a/src/backenddb/pg_lookup_all_products.c b/src/backenddb/pg_lookup_all_products.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_all_products function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_all_products.h b/src/backenddb/pg_lookup_all_products.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the products the given instance has configured. diff --git a/src/backenddb/pg_lookup_categories.c b/src/backenddb/pg_lookup_categories.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_categories function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_categories.h b/src/backenddb/pg_lookup_categories.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the product categories the given instance has configured. diff --git a/src/backenddb/pg_lookup_categories_by_ids.c b/src/backenddb/pg_lookup_categories_by_ids.c @@ -18,7 +18,7 @@ * @brief Lookup product categories by ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_categories_by_ids.h b/src/backenddb/pg_lookup_categories_by_ids.h @@ -21,7 +21,7 @@ #ifndef PG_LOOKUP_CATEGORIES_BY_IDS_H #define PG_LOOKUP_CATEGORIES_BY_IDS_H -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup product categories by ID. diff --git a/src/backenddb/pg_lookup_contract_terms.c b/src/backenddb/pg_lookup_contract_terms.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_contract_terms.h b/src/backenddb/pg_lookup_contract_terms.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve contract terms given its @a order_id diff --git a/src/backenddb/pg_lookup_contract_terms2.c b/src/backenddb/pg_lookup_contract_terms2.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_contract_terms2 function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_contract_terms2.h b/src/backenddb/pg_lookup_contract_terms2.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve contract terms given its @a order_id diff --git a/src/backenddb/pg_lookup_contract_terms3.c b/src/backenddb/pg_lookup_contract_terms3.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <sys/types.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> diff --git a/src/backenddb/pg_lookup_contract_terms3.h b/src/backenddb/pg_lookup_contract_terms3.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve contract terms given its @a order_id diff --git a/src/backenddb/pg_lookup_custom_units_by_names.c b/src/backenddb/pg_lookup_custom_units_by_names.c @@ -18,7 +18,7 @@ * @brief Lookup custom measurement units by name * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_custom_units_by_names.h b/src/backenddb/pg_lookup_custom_units_by_names.h @@ -22,7 +22,7 @@ #define PG_LOOKUP_CUSTOM_UNITS_BY_NAMES_H #include <taler/taler_util.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup custom measurement units by name. diff --git a/src/backenddb/pg_lookup_deposits.c b/src/backenddb/pg_lookup_deposits.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_deposits function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_deposits.h b/src/backenddb/pg_lookup_deposits.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup information about coins that were successfully deposited for a diff --git a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_deposits_by_contract_and_coin function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.h b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup information about coin payments by @a h_contract_terms and @@ -40,9 +40,14 @@ enum GNUNET_DB_QueryStatus TMH_PG_lookup_deposits_by_contract_and_coin (void *cls, const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - TALER_MERCHANTDB_CoinDepositCallback cb, + const struct + TALER_PrivateContractHashP * + h_contract_terms, + const struct + TALER_CoinSpendPublicKeyP *coin_pub + , + TALER_MERCHANTDB_CoinDepositCallback + cb, void *cb_cls); #endif diff --git a/src/backenddb/pg_lookup_deposits_by_order.c b/src/backenddb/pg_lookup_deposits_by_order.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_deposits_by_order function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_deposits_by_order.h b/src/backenddb/pg_lookup_deposits_by_order.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve details about coins that were deposited for an order. diff --git a/src/backenddb/pg_lookup_donau_keys.c b/src/backenddb/pg_lookup_donau_keys.c @@ -19,7 +19,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_donau_keys.h b/src/backenddb/pg_lookup_donau_keys.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #include "donau/donau_service.h" /** diff --git a/src/backenddb/pg_lookup_expected_transfer.c b/src/backenddb/pg_lookup_expected_transfer.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_expected_transfer function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_expected_transfer.h b/src/backenddb/pg_lookup_expected_transfer.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Obtain information about an expected incoming wire transfer. diff --git a/src/backenddb/pg_lookup_expected_transfers.c b/src/backenddb/pg_lookup_expected_transfers.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_expected_transfers function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_expected_transfers.h b/src/backenddb/pg_lookup_expected_transfers.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_instance_auth.c b/src/backenddb/pg_lookup_instance_auth.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_instance_auth function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_instance_auth.h b/src/backenddb/pg_lookup_instance_auth.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup authentication data of an instance. diff --git a/src/backenddb/pg_lookup_instances.c b/src/backenddb/pg_lookup_instances.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_instances function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_instances.h" diff --git a/src/backenddb/pg_lookup_instances.h b/src/backenddb/pg_lookup_instances.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_inventory_products.c b/src/backenddb/pg_lookup_inventory_products.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_inventory_products function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_inventory_products.h b/src/backenddb/pg_lookup_inventory_products.h @@ -21,7 +21,7 @@ #ifndef PG_LOOKUP_INVENTORY_PRODUCTS_H #define PG_LOOKUP_INVENTORY_PRODUCTS_H -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup inventory details for all products of an instance. diff --git a/src/backenddb/pg_lookup_inventory_products_filtered.c b/src/backenddb/pg_lookup_inventory_products_filtered.c @@ -18,7 +18,7 @@ * @brief Lookup inventory product details for templates (filtered) * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_inventory_products_filtered.h b/src/backenddb/pg_lookup_inventory_products_filtered.h @@ -21,7 +21,7 @@ #ifndef PG_LOOKUP_INVENTORY_PRODUCTS_FILTERED_H #define PG_LOOKUP_INVENTORY_PRODUCTS_FILTERED_H -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup inventory details for a subset of products. diff --git a/src/backenddb/pg_lookup_login_tokens.c b/src/backenddb/pg_lookup_login_tokens.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_login_tokens function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_login_tokens.h b/src/backenddb/pg_lookup_login_tokens.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the tokens the given instance has configured. diff --git a/src/backenddb/pg_lookup_mfa_challenge.c b/src/backenddb/pg_lookup_mfa_challenge.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_mfa_challenge function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_mfa_challenge.h b/src/backenddb/pg_lookup_mfa_challenge.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_order.c b/src/backenddb/pg_lookup_order.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_order function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order.h b/src/backenddb/pg_lookup_order.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve order given its @a order_id and the @a instance_id. diff --git a/src/backenddb/pg_lookup_order_by_fulfillment.c b/src/backenddb/pg_lookup_order_by_fulfillment.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_order_by_fulfillment function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_by_fulfillment.h b/src/backenddb/pg_lookup_order_by_fulfillment.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve the order ID that was used to pay for a resource within a session. diff --git a/src/backenddb/pg_lookup_order_charity.c b/src/backenddb/pg_lookup_order_charity.c @@ -24,7 +24,7 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_charity.h b/src/backenddb/pg_lookup_order_charity.h @@ -27,7 +27,7 @@ #ifndef PG_LOOKUP_ORDER_CHARITY_H #define PG_LOOKUP_ORDER_CHARITY_H -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_status.c b/src/backenddb/pg_lookup_order_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_order_status function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_status.h b/src/backenddb/pg_lookup_order_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve contract terms given its @a order_id diff --git a/src/backenddb/pg_lookup_order_status_by_serial.c b/src/backenddb/pg_lookup_order_status_by_serial.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_order_status_by_serial function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_status_by_serial.h b/src/backenddb/pg_lookup_order_status_by_serial.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve contract terms given its @a order_serial diff --git a/src/backenddb/pg_lookup_order_summary.c b/src/backenddb/pg_lookup_order_summary.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_order_summary function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_order_summary.h b/src/backenddb/pg_lookup_order_summary.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve order summary given its @a order_id and the @a instance_id. diff --git a/src/backenddb/pg_lookup_orders.c b/src/backenddb/pg_lookup_orders.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_orders.h b/src/backenddb/pg_lookup_orders.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve orders given the @a instance_id. diff --git a/src/backenddb/pg_lookup_otp_devices.c b/src/backenddb/pg_lookup_otp_devices.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_otp_devices function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_otp_devices.h b/src/backenddb/pg_lookup_otp_devices.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_pending_deposits.c b/src/backenddb/pg_lookup_pending_deposits.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_pending_deposits function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_pending_deposits.h b/src/backenddb/pg_lookup_pending_deposits.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_pending_webhooks.c b/src/backenddb/pg_lookup_pending_webhooks.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_pending_webhooks function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_pending_webhooks.h b/src/backenddb/pg_lookup_pending_webhooks.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup the webhook that need to be send in priority. diff --git a/src/backenddb/pg_lookup_product.c b/src/backenddb/pg_lookup_product.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_product function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_product.h b/src/backenddb/pg_lookup_product.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup details about a particular product. diff --git a/src/backenddb/pg_lookup_product_image.c b/src/backenddb/pg_lookup_product_image.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_product_image_by_hash function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_product_image.h" diff --git a/src/backenddb/pg_lookup_products.c b/src/backenddb/pg_lookup_products.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_products function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_products.h b/src/backenddb/pg_lookup_products.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the products the given instance has configured. diff --git a/src/backenddb/pg_lookup_reconciliation_details.c b/src/backenddb/pg_lookup_reconciliation_details.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_reconciliation_details function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_reconciliation_details.h b/src/backenddb/pg_lookup_reconciliation_details.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_refund_proof.c b/src/backenddb/pg_lookup_refund_proof.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_refund_proof function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_refund_proof.h b/src/backenddb/pg_lookup_refund_proof.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup refund proof data. diff --git a/src/backenddb/pg_lookup_refunds.c b/src/backenddb/pg_lookup_refunds.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_refunds function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_refunds.h b/src/backenddb/pg_lookup_refunds.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Obtain refunds associated with a contract. diff --git a/src/backenddb/pg_lookup_refunds_detailed.c b/src/backenddb/pg_lookup_refunds_detailed.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_refunds_detailed function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -124,7 +124,8 @@ lookup_refunds_detailed_cb (void *cls, enum GNUNET_DB_QueryStatus TMH_PG_lookup_refunds_detailed (void *cls, const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, + const struct TALER_PrivateContractHashP * + h_contract_terms, TALER_MERCHANTDB_RefundDetailCallback rc, void *rc_cls) { diff --git a/src/backenddb/pg_lookup_refunds_detailed.h b/src/backenddb/pg_lookup_refunds_detailed.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Obtain detailed refund data associated with a contract. diff --git a/src/backenddb/pg_lookup_reports_pending.c b/src/backenddb/pg_lookup_reports_pending.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_reports_pending function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_reports_pending.h b/src/backenddb/pg_lookup_reports_pending.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the reports pending for the given backend. diff --git a/src/backenddb/pg_lookup_spent_tokens_by_order.c b/src/backenddb/pg_lookup_spent_tokens_by_order.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_spent_tokens_by_order function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_spent_tokens_by_order.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Closure for lookup_spent_tokens_by_order_cb(). diff --git a/src/backenddb/pg_lookup_spent_tokens_by_order.h b/src/backenddb/pg_lookup_spent_tokens_by_order.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve details about tokens that were used for an order. @@ -41,5 +41,4 @@ TMH_PG_lookup_spent_tokens_by_order (void *cls, void *cb_cls); - #endif diff --git a/src/backenddb/pg_lookup_statistics_amount_by_bucket.c b/src/backenddb/pg_lookup_statistics_amount_by_bucket.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_statistics_amount_by_bucket function for Postgres * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_statistics_amount_by_bucket.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_amount_by_bucket.h b/src/backenddb/pg_lookup_statistics_amount_by_bucket.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup statistics where the values are amounts. diff --git a/src/backenddb/pg_lookup_statistics_amount_by_bucket2.c b/src/backenddb/pg_lookup_statistics_amount_by_bucket2.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_statistics_amount_by_bucket2 function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_statistics_amount_by_bucket2.h b/src/backenddb/pg_lookup_statistics_amount_by_bucket2.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_amount_by_interval.c b/src/backenddb/pg_lookup_statistics_amount_by_interval.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_statistics_amount_by_interval function for Postgres * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_statistics_amount_by_interval.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_amount_by_interval.h b/src/backenddb/pg_lookup_statistics_amount_by_interval.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup statistics where the values are amounts. diff --git a/src/backenddb/pg_lookup_statistics_counter_by_bucket.c b/src/backenddb/pg_lookup_statistics_counter_by_bucket.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_statistics_counter_by_bucket function for Postgres * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_statistics_counter_by_bucket.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_counter_by_bucket.h b/src/backenddb/pg_lookup_statistics_counter_by_bucket.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup statistics where the values are counters. diff --git a/src/backenddb/pg_lookup_statistics_counter_by_bucket2.c b/src/backenddb/pg_lookup_statistics_counter_by_bucket2.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_statistics_counter_by_bucket2 function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_statistics_counter_by_bucket2.h b/src/backenddb/pg_lookup_statistics_counter_by_bucket2.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_counter_by_interval.c b/src/backenddb/pg_lookup_statistics_counter_by_interval.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_statistics_counter_by_interval function for Postgres * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_statistics_counter_by_interval.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_statistics_counter_by_interval.h b/src/backenddb/pg_lookup_statistics_counter_by_interval.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup statistics where the values are counters. diff --git a/src/backenddb/pg_lookup_template.c b/src/backenddb/pg_lookup_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_template function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_template.h b/src/backenddb/pg_lookup_template.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_templates.c b/src/backenddb/pg_lookup_templates.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_templates function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_templates.h b/src/backenddb/pg_lookup_templates.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_token_families.c b/src/backenddb/pg_lookup_token_families.c @@ -18,13 +18,13 @@ * @brief Implementation of the lookup_token_families function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_lookup_token_families.h" #include "pg_helper.h" -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_token_families.h b/src/backenddb/pg_lookup_token_families.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the token families the given instance has configured. diff --git a/src/backenddb/pg_lookup_token_family.c b/src/backenddb/pg_lookup_token_family.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_token_family function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_token_family.h b/src/backenddb/pg_lookup_token_family.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup details about a particular token family. @@ -39,6 +39,7 @@ enum GNUNET_DB_QueryStatus TMH_PG_lookup_token_family (void *cls, const char *instance_id, const char *token_family_slug, - struct TALER_MERCHANTDB_TokenFamilyDetails *details); + struct TALER_MERCHANTDB_TokenFamilyDetails *details) +; #endif diff --git a/src/backenddb/pg_lookup_token_family_key.c b/src/backenddb/pg_lookup_token_family_key.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_token_family_key function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_pq_lib.h> #include <gnunet/gnunet_time_lib.h> #include <string.h> diff --git a/src/backenddb/pg_lookup_token_family_key.h b/src/backenddb/pg_lookup_token_family_key.h @@ -24,7 +24,7 @@ #include <gnunet/gnunet_common.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup details about a particular token family key. The valid_after field diff --git a/src/backenddb/pg_lookup_token_family_keys.c b/src/backenddb/pg_lookup_token_family_keys.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_token_family_keys function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_token_family_keys.h b/src/backenddb/pg_lookup_token_family_keys.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_lookup_transfer_details.c b/src/backenddb/pg_lookup_transfer_details.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_transfer_details function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_transfer_details.h b/src/backenddb/pg_lookup_transfer_details.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup transfer details. @@ -38,7 +38,8 @@ enum GNUNET_DB_QueryStatus TMH_PG_lookup_transfer_details (void *cls, const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_WireTransferIdentifierRawP * + wtid, TALER_MERCHANTDB_TransferDetailsCallback cb, void *cb_cls); diff --git a/src/backenddb/pg_lookup_transfer_details_by_order.c b/src/backenddb/pg_lookup_transfer_details_by_order.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_transfer_details_by_order function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_transfer_details_by_order.h b/src/backenddb/pg_lookup_transfer_details_by_order.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Retrieve wire transfer details for all deposits associated with @@ -38,7 +38,8 @@ enum GNUNET_DB_QueryStatus TMH_PG_lookup_transfer_details_by_order (void *cls, uint64_t order_serial, - TALER_MERCHANTDB_OrderTransferDetailsCallback cb, + TALER_MERCHANTDB_OrderTransferDetailsCallback + cb, void *cb_cls); #endif diff --git a/src/backenddb/pg_lookup_transfer_summary.c b/src/backenddb/pg_lookup_transfer_summary.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_transfer_summary function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_transfer_summary.h b/src/backenddb/pg_lookup_transfer_summary.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup transfer summary. @@ -38,7 +38,8 @@ enum GNUNET_DB_QueryStatus TMH_PG_lookup_transfer_summary (void *cls, const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, + const struct TALER_WireTransferIdentifierRawP * + wtid, TALER_MERCHANTDB_TransferSummaryCallback cb, void *cb_cls); diff --git a/src/backenddb/pg_lookup_transfers.c b/src/backenddb/pg_lookup_transfers.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_transfers function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_transfers.h b/src/backenddb/pg_lookup_transfers.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup transfers. Note that filtering by @a verified status is done diff --git a/src/backenddb/pg_lookup_units.c b/src/backenddb/pg_lookup_units.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_units function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_units.h b/src/backenddb/pg_lookup_units.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all measurement units for an instance. diff --git a/src/backenddb/pg_lookup_webhook.c b/src/backenddb/pg_lookup_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_webhook.h b/src/backenddb/pg_lookup_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup details about a particular webhook. diff --git a/src/backenddb/pg_lookup_webhook_by_event.c b/src/backenddb/pg_lookup_webhook_by_event.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_webhook_by_event function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -109,6 +109,7 @@ lookup_webhook_by_event_cb (void *cls, } } + enum GNUNET_DB_QueryStatus TMH_PG_lookup_webhook_by_event (void *cls, const char *instance_id, diff --git a/src/backenddb/pg_lookup_webhook_by_event.h b/src/backenddb/pg_lookup_webhook_by_event.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup webhook by event diff --git a/src/backenddb/pg_lookup_webhooks.c b/src/backenddb/pg_lookup_webhooks.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_webhooks function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_webhooks.h b/src/backenddb/pg_lookup_webhooks.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the webhooks the given instance has configured. diff --git a/src/backenddb/pg_lookup_wire_fee.c b/src/backenddb/pg_lookup_wire_fee.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_wire_fee function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_lookup_wire_fee.h b/src/backenddb/pg_lookup_wire_fee.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Obtain information about wire fees charged by an exchange, diff --git a/src/backenddb/pg_mark_contract_paid.c b/src/backenddb/pg_mark_contract_paid.c @@ -18,7 +18,7 @@ * @brief Implementation of the mark_contract_paid function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_mark_contract_paid.h b/src/backenddb/pg_mark_contract_paid.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Mark contract as paid and store the current @a session_id diff --git a/src/backenddb/pg_mark_order_wired.c b/src/backenddb/pg_mark_order_wired.c @@ -18,7 +18,7 @@ * @brief Implementation of the mark_order_wired function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_mark_order_wired.h b/src/backenddb/pg_mark_order_wired.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Set 'wired' status for an order to 'true'. diff --git a/src/backenddb/pg_purge_instance.c b/src/backenddb/pg_purge_instance.c @@ -18,7 +18,7 @@ * @brief Implementation of the purge_instance function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_purge_instance.h b/src/backenddb/pg_purge_instance.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Purge an instance and all associated information from our database. diff --git a/src/backenddb/pg_refund_coin.c b/src/backenddb/pg_refund_coin.c @@ -18,7 +18,7 @@ * @brief Implementation of the refund_coin function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_refund_coin.h b/src/backenddb/pg_refund_coin.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Function called during aborts to refund a coin. Marks the diff --git a/src/backenddb/pg_select_account.c b/src/backenddb/pg_select_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_account function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_account.h b/src/backenddb/pg_select_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_account_by_uri.c b/src/backenddb/pg_select_account_by_uri.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_account_by_uri function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_account_by_uri.h b/src/backenddb/pg_select_account_by_uri.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_accounts.c b/src/backenddb/pg_select_accounts.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_accounts function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_accounts.h b/src/backenddb/pg_select_accounts.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_accounts_by_exchange.c b/src/backenddb/pg_select_accounts_by_exchange.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_accounts_by_exchange function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_accounts_by_exchange.h b/src/backenddb/pg_select_accounts_by_exchange.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_all_donau_instances.c b/src/backenddb/pg_select_all_donau_instances.c @@ -20,12 +20,11 @@ * @author Vlada Svirsh * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_select_all_donau_instances.h" -#include "taler_merchant_donau.h" #include "pg_helper.h" /** diff --git a/src/backenddb/pg_select_all_donau_instances.h b/src/backenddb/pg_select_all_donau_instances.h @@ -24,8 +24,8 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchant_donau.h" /** * Select all Donau instances from the database, regardless diff --git a/src/backenddb/pg_select_category.c b/src/backenddb/pg_select_category.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_category function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_category.h b/src/backenddb/pg_select_category.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_category_by_name.c b/src/backenddb/pg_select_category_by_name.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_category_by_name function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_category_by_name.h b/src/backenddb/pg_select_category_by_name.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_donau_instance_by_serial.c b/src/backenddb/pg_select_donau_instance_by_serial.c @@ -19,12 +19,11 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_select_donau_instance_by_serial.h" -#include "taler_merchant_donau.h" #include "pg_helper.h" diff --git a/src/backenddb/pg_select_donau_instance_by_serial.h b/src/backenddb/pg_select_donau_instance_by_serial.h @@ -24,8 +24,8 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchant_donau.h" #include "donau/donau_util.h" /** diff --git a/src/backenddb/pg_select_donau_instances.c b/src/backenddb/pg_select_donau_instances.c @@ -19,12 +19,11 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_select_donau_instances.h" -#include "taler_merchant_donau.h" #include "pg_helper.h" /** diff --git a/src/backenddb/pg_select_donau_instances.h b/src/backenddb/pg_select_donau_instances.h @@ -24,8 +24,8 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchant_donau.h" /** * Select Donau instances from the database. diff --git a/src/backenddb/pg_select_donau_instances_filtered.c b/src/backenddb/pg_select_donau_instances_filtered.c @@ -19,12 +19,11 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> #include "pg_select_donau_instances_filtered.h" -#include "taler_merchant_donau.h" #include "pg_helper.h" /** diff --git a/src/backenddb/pg_select_donau_instances_filtered.h b/src/backenddb/pg_select_donau_instances_filtered.h @@ -24,8 +24,8 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchantdb_plugin.h" +#include "taler/taler_merchant_donau.h" #include "donau/donau_util.h" /** diff --git a/src/backenddb/pg_select_exchange_keys.c b/src/backenddb/pg_select_exchange_keys.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_exchange_keys function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_exchange_keys.h b/src/backenddb/pg_select_exchange_keys.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_exchanges.c b/src/backenddb/pg_select_exchanges.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_exchanges function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_exchanges.h b/src/backenddb/pg_select_exchanges.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Call @a cb on each exchange we have in the database. diff --git a/src/backenddb/pg_select_login_token.c b/src/backenddb/pg_select_login_token.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_login_token function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_login_token.h b/src/backenddb/pg_select_login_token.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_money_pot.c b/src/backenddb/pg_select_money_pot.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_money_pot function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_money_pot.h b/src/backenddb/pg_select_money_pot.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_money_pots.c b/src/backenddb/pg_select_money_pots.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_money_pots function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_money_pots.h b/src/backenddb/pg_select_money_pots.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_open_transfers.c b/src/backenddb/pg_select_open_transfers.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_open_transfers function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_open_transfers.h b/src/backenddb/pg_select_open_transfers.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_order_blinded_sigs.c b/src/backenddb/pg_select_order_blinded_sigs.c @@ -18,7 +18,7 @@ * @brief Implementation of the select blinded sigs by order_id function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_order_blinded_sigs.h b/src/backenddb/pg_select_order_blinded_sigs.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_otp.c b/src/backenddb/pg_select_otp.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_otp function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -88,4 +88,3 @@ TMH_PG_select_otp (void *cls, return qs; } } - diff --git a/src/backenddb/pg_select_otp.h b/src/backenddb/pg_select_otp.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_otp_serial.c b/src/backenddb/pg_select_otp_serial.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_otp_serial function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_otp_serial.h b/src/backenddb/pg_select_otp_serial.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_product_groups.c b/src/backenddb/pg_select_product_groups.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_product_groups function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_product_groups.h b/src/backenddb/pg_select_product_groups.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the product groups the given instance has configured. diff --git a/src/backenddb/pg_select_report.c b/src/backenddb/pg_select_report.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_report function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_report.h b/src/backenddb/pg_select_report.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_select_reports.c b/src/backenddb/pg_select_reports.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_reports function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_reports.h b/src/backenddb/pg_select_reports.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup all of the reports the given instance has configured. diff --git a/src/backenddb/pg_select_unit.c b/src/backenddb/pg_select_unit.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_unit function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_unit.h b/src/backenddb/pg_select_unit.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Lookup a measurement unit by identifier. diff --git a/src/backenddb/pg_select_wirewatch_accounts.c b/src/backenddb/pg_select_wirewatch_accounts.c @@ -18,7 +18,7 @@ * @brief Implementation of the select_wirewatch_accounts function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_select_wirewatch_accounts.h b/src/backenddb/pg_select_wirewatch_accounts.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_solve_mfa_challenge.c b/src/backenddb/pg_solve_mfa_challenge.c @@ -18,7 +18,7 @@ * @brief Implementation of the solve_mfa_challenge function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_solve_mfa_challenge.h b/src/backenddb/pg_solve_mfa_challenge.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Attempt to solve new multi-factor authorization (MFA) challenge. diff --git a/src/backenddb/pg_store_wire_fee_by_exchange.c b/src/backenddb/pg_store_wire_fee_by_exchange.c @@ -18,7 +18,7 @@ * @brief Implementation of the store_wire_fee_by_exchange function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -41,9 +41,9 @@ TMH_PG_store_wire_fee_by_exchange ( GNUNET_PQ_query_param_auto_from_type (master_pub), GNUNET_PQ_query_param_auto_from_type (h_wire_method), TALER_PQ_query_param_amount_with_currency (pg->conn, - &fees->wire), + &fees->wire), TALER_PQ_query_param_amount_with_currency (pg->conn, - &fees->closing), + &fees->closing), GNUNET_PQ_query_param_timestamp (&start_date), GNUNET_PQ_query_param_timestamp (&end_date), GNUNET_PQ_query_param_auto_from_type (master_sig), diff --git a/src/backenddb/pg_store_wire_fee_by_exchange.h b/src/backenddb/pg_store_wire_fee_by_exchange.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_template.c b/src/backenddb/pg_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the template function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_template.h b/src/backenddb/pg_template.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #endif diff --git a/src/backenddb/pg_unlock_inventory.c b/src/backenddb/pg_unlock_inventory.c @@ -18,7 +18,7 @@ * @brief Implementation of the unlock_inventory function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_unlock_inventory.h b/src/backenddb/pg_unlock_inventory.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Release an inventory lock by UUID. Releases ALL stocks locked under diff --git a/src/backenddb/pg_update_account.c b/src/backenddb/pg_update_account.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_account function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_account.h b/src/backenddb/pg_update_account.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_category.c b/src/backenddb/pg_update_category.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_category function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_category.h b/src/backenddb/pg_update_category.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_contract_session.c b/src/backenddb/pg_update_contract_session.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_contract_session function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_contract_session.h b/src/backenddb/pg_update_contract_session.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update session associated with a contract and return diff --git a/src/backenddb/pg_update_contract_terms.c b/src/backenddb/pg_update_contract_terms.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_contract_terms function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_contract_terms.h b/src/backenddb/pg_update_contract_terms.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update the contract terms stored for @a order_id. Note that some attributes are diff --git a/src/backenddb/pg_update_deposit_confirmation_status.c b/src/backenddb/pg_update_deposit_confirmation_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_deposit_confirmation_status function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_deposit_confirmation_status.h b/src/backenddb/pg_update_deposit_confirmation_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_donau_instance.c b/src/backenddb/pg_update_donau_instance.c @@ -19,7 +19,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_donau_instance.h b/src/backenddb/pg_update_donau_instance.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #include "donau/donau_service.h" /** diff --git a/src/backenddb/pg_update_donau_instance_receipts_amount.c b/src/backenddb/pg_update_donau_instance_receipts_amount.c @@ -20,7 +20,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_donau_instance_receipts_amount.h b/src/backenddb/pg_update_donau_instance_receipts_amount.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update information about a Donau charity instance. diff --git a/src/backenddb/pg_update_instance.c b/src/backenddb/pg_update_instance.c @@ -19,7 +19,7 @@ * @author Christian Grothoff * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_instance.h b/src/backenddb/pg_update_instance.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update information about an instance into our database. diff --git a/src/backenddb/pg_update_instance_auth.c b/src/backenddb/pg_update_instance_auth.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_instance_auth function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_instance_auth.h b/src/backenddb/pg_update_instance_auth.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update information about an instance's authentication settings diff --git a/src/backenddb/pg_update_mfa_challenge.c b/src/backenddb/pg_update_mfa_challenge.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_mfa_challenge function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_mfa_challenge.h b/src/backenddb/pg_update_mfa_challenge.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_money_pot.c b/src/backenddb/pg_update_money_pot.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_money_pot function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_money_pot.h b/src/backenddb/pg_update_money_pot.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update details about a particular money pot. diff --git a/src/backenddb/pg_update_otp.c b/src/backenddb/pg_update_otp.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_otp function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_otp.h b/src/backenddb/pg_update_otp.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_pending_webhook.c b/src/backenddb/pg_update_pending_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_pending_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_pending_webhook.h b/src/backenddb/pg_update_pending_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update the pending webhook. It is use if the webhook can't be send. diff --git a/src/backenddb/pg_update_product.c b/src/backenddb/pg_update_product.c @@ -19,7 +19,7 @@ * @author Christian Grothoff * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_product.h b/src/backenddb/pg_update_product.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update details about a particular product. Note that the diff --git a/src/backenddb/pg_update_product_group.c b/src/backenddb/pg_update_product_group.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_product_group function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_product_group.h b/src/backenddb/pg_update_product_group.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_report.c b/src/backenddb/pg_update_report.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_report function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_report.h b/src/backenddb/pg_update_report.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_report_status.c b/src/backenddb/pg_update_report_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_report_status function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_report_status.h b/src/backenddb/pg_update_report_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update transmission status about a particular report. diff --git a/src/backenddb/pg_update_template.c b/src/backenddb/pg_update_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_template function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_template.h b/src/backenddb/pg_update_template.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_token_family.c b/src/backenddb/pg_update_token_family.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_token_family function for Postgres * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_token_family.h b/src/backenddb/pg_update_token_family.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update details about a particular token family. @@ -39,6 +39,7 @@ enum GNUNET_DB_QueryStatus TMH_PG_update_token_family (void *cls, const char *instance_id, const char *token_family_slug, - const struct TALER_MERCHANTDB_TokenFamilyDetails *details); + const struct TALER_MERCHANTDB_TokenFamilyDetails * + details); #endif diff --git a/src/backenddb/pg_update_transfer_status.c b/src/backenddb/pg_update_transfer_status.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_transfer_status function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_transfer_status.h b/src/backenddb/pg_update_transfer_status.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_update_unit.c b/src/backenddb/pg_update_unit.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_unit function for Postgres * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_unit.h b/src/backenddb/pg_update_unit.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update an existing measurement unit definition. diff --git a/src/backenddb/pg_update_webhook.c b/src/backenddb/pg_update_webhook.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_webhook function for Postgres * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_webhook.h b/src/backenddb/pg_update_webhook.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** * Update details about a particular webhook. diff --git a/src/backenddb/pg_update_wirewatch_progress.c b/src/backenddb/pg_update_wirewatch_progress.c @@ -18,7 +18,7 @@ * @brief Implementation of the update_wirewatch_progress function for Postgres * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_update_wirewatch_progress.h b/src/backenddb/pg_update_wirewatch_progress.h @@ -23,7 +23,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" /** diff --git a/src/backenddb/pg_upsert_donau_keys.c b/src/backenddb/pg_upsert_donau_keys.c @@ -19,7 +19,7 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/backenddb/pg_upsert_donau_keys.h b/src/backenddb/pg_upsert_donau_keys.h @@ -24,7 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #include "donau/donau_service.h" /** diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -22,14 +22,14 @@ * @author Priscilla Huang * @author Iván Ávalos */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_pq_lib.h> #include <taler/taler_util.h> #include <taler/taler_pq_lib.h> #include <taler/taler_json_lib.h> #include <taler/taler_mhd_lib.h> -#include "taler_merchantdb_plugin.h" +#include "taler/taler_merchantdb_plugin.h" #include "pg_helper.h" #include "pg_gc.h" #include "pg_insert_otp.h" diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c @@ -20,13 +20,13 @@ * @author Christian Grothoff * @author Pricilla Huang */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <taler/taler_util.h> #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" /** diff --git a/src/bank/mb_common.c b/src/bank/mb_common.c @@ -19,7 +19,7 @@ * @brief Common functions for the bank API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "mb_common.h" diff --git a/src/bank/mb_common.h b/src/bank/mb_common.h @@ -25,7 +25,7 @@ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_bank_lib.h" +#include "taler/taler_merchant_bank_lib.h" #include <taler/taler_json_lib.h> diff --git a/src/bank/mb_credit.c b/src/bank/mb_credit.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include "mb_common.h" #include <microhttpd.h> /* just for HTTP status codes */ diff --git a/src/bank/mb_parse.c b/src/bank/mb_parse.c @@ -19,8 +19,8 @@ * @brief Convenience function to parse authentication configuration * @author Christian Grothoff */ -#include "platform.h" -#include "taler_merchant_bank_lib.h" +#include "taler/platform.h" +#include "taler/taler_merchant_bank_lib.h" #include <gnunet/gnunet_json_lib.h> @@ -87,7 +87,8 @@ TALER_MERCHANT_BANK_auth_parse_cfg ( GNUNET_CONFIGURATION_get_value_string (cfg, section, "USERNAME", - &auth->details.basic.username)) + &auth->details.basic.username + )) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, @@ -100,7 +101,8 @@ TALER_MERCHANT_BANK_auth_parse_cfg ( GNUNET_CONFIGURATION_get_value_string (cfg, section, "PASSWORD", - &auth->details.basic.password)) + &auth->details.basic.password + )) { GNUNET_free (auth->details.basic.username); auth->details.basic.username = NULL; diff --git a/src/include/Makefile.am b/src/include/Makefile.am @@ -1,19 +1,7 @@ # This Makefile.am is in the public domain -EXTRA_DIST = \ - platform.h gettext.h +SUBDIRS = taler . talerincludedir = $(includedir)/taler talerinclude_HEADERS = \ - taler_merchant_bank_lib.h \ - taler_merchantdb_lib.h \ - taler_merchantdb_plugin.h \ - taler_merchant_util.h \ - taler_merchant_service.h \ - taler_merchant_pay_service.h \ - taler_merchant_testing_lib.h - -if HAVE_DONAU -talerinclude_HEADERS += \ - taler_merchant_donau.h -endif + gettext.h diff --git a/src/include/platform.h b/src/include/platform.h @@ -1,334 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014, 2015, 2016, 2021 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ - -/** - * @file src/include/platform.h - * @brief This file contains the includes and definitions which are used by the - * rest of the modules - * @author Sree Harsha Totakura <sreeharsha@totakura.in> - */ - -#ifndef PLATFORM_H_ -#define PLATFORM_H_ - -/* Include our configuration header */ -#ifndef HAVE_USED_CONFIG_H -#define HAVE_USED_CONFIG_H -#ifdef HAVE_CONFIG_H -#include "taler_merchant_config.h" -#endif -#endif - - -#if (GNUNET_EXTRA_LOGGING >= 1) -#define VERBOSE(cmd) cmd -#else -#define VERBOSE(cmd) do { break; } while (0) -#endif - -/* Include the features available for GNU source */ -#define _GNU_SOURCE - - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#ifdef __clang__ -#undef HAVE_STATIC_ASSERT -#endif - -/** - * These may be expensive, but good for debugging... - */ -#define ALLOW_EXTRA_CHECKS GNUNET_YES - -/** - * For strptime (glibc2 needs this). - */ -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE 499 -#endif - -#ifndef _REENTRANT -#define _REENTRANT -#endif - -/* configuration options */ - -#define VERBOSE_STATS 0 - -#include <netdb.h> -#include <sys/socket.h> -#include <sys/un.h> -#if HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#if HAVE_NETINET_IN_SYSTM_H -#include <netinet/in_systm.h> -#endif -#if HAVE_NETINET_IP_H -#include <netinet/ip.h> /* superset of previous */ -#endif -#include <arpa/inet.h> -#include <netinet/tcp.h> -#include <pwd.h> -#include <sys/ioctl.h> -#include <sys/wait.h> -#include <grp.h> - -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdint.h> -#include <stdarg.h> -#include <stdbool.h> -#include <errno.h> -#include <signal.h> -#include <libgen.h> -#ifdef HAVE_MALLOC_H -#include <malloc.h> /* for mallinfo on GNU */ -#endif -#include <unistd.h> /* KLB_FIX */ -#include <sys/stat.h> -#include <sys/types.h> -#include <dirent.h> /* KLB_FIX */ -#include <fcntl.h> -#include <math.h> -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#include <time.h> -#ifdef BSD -#include <net/if.h> -#endif -#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__) -#include <semaphore.h> -#endif -#ifdef DARWIN -#include <dlfcn.h> -#include <semaphore.h> -#include <net/if.h> -#endif -#if defined(__linux__) || defined(GNU) -#include <net/if.h> -#endif -#ifdef SOLARIS -#include <sys/sockio.h> -#include <sys/filio.h> -#include <sys/loadavg.h> -#include <semaphore.h> -#endif -#if HAVE_UCRED_H -#include <ucred.h> -#endif -#if HAVE_SYS_UCRED_H -#include <sys/ucred.h> -#endif -#if HAVE_IFADDRS_H -#include <ifaddrs.h> -#endif -#include <errno.h> -#include <limits.h> - -#if HAVE_VFORK_H -#include <vfork.h> -#endif - -#include <ctype.h> -#if HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif - -#if HAVE_ENDIAN_H -#include <endian.h> -#endif -#if HAVE_SYS_ENDIAN_H -#include <sys/endian.h> -#endif - -#define DIR_SEPARATOR '/' -#define DIR_SEPARATOR_STR "/" -#define PATH_SEPARATOR ':' -#define PATH_SEPARATOR_STR ":" -#define NEWLINE "\n" - -#include <locale.h> -#include "gettext.h" -/** - * GNU gettext support macro. - */ -#define _(String) dgettext (PACKAGE, String) -#define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor" - -#include <sys/mman.h> - -/* FreeBSD_kernel is not defined on the now discontinued kFreeBSD */ -#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__) -#define __BYTE_ORDER BYTE_ORDER -#define __BIG_ENDIAN BIG_ENDIAN -#endif - -#ifdef DARWIN -#define __BYTE_ORDER BYTE_ORDER -#define __BIG_ENDIAN BIG_ENDIAN -/* not available on darwin, override configure */ -#undef HAVE_STAT64 -#undef HAVE_MREMAP -#endif - -#if ! HAVE_ATOLL -long long -atoll (const char *nptr); - -#endif - -#if ENABLE_NLS -#include "langinfo.h" -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t) (-1)) -#endif - -#ifndef O_LARGEFILE -#define O_LARGEFILE 0 -#endif - -/** - * AI_NUMERICSERV not defined in windows. Then we just do without. - */ -#ifndef AI_NUMERICSERV -#define AI_NUMERICSERV 0 -#endif - - -#if defined(__sparc__) -#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, &(val), \ - sizeof((val))); \ - __tmp; }) -#else -#define MAKE_UNALIGNED(val) val -#endif - -/** - * The termination signal - */ -#define GNUNET_TERM_SIG SIGTERM - - -#ifndef PATH_MAX -/** - * Assumed maximum path length. - */ -#define PATH_MAX 4096 -#endif - -#if HAVE_THREAD_LOCAL_GCC -#define TALER_THREAD_LOCAL __thread -#else -#define TALER_THREAD_LOCAL -#endif - - -/** - * clang et al do not have such an attribute - */ -#if __has_attribute (__nonstring__) -# define __nonstring __attribute__((__nonstring__)) -#else -# define __nonstring -#endif - -/* Do not use shortcuts for gcrypt mpi */ -#define GCRYPT_NO_MPI_MACROS 1 - -/* Do not use deprecated functions from gcrypt */ -#define GCRYPT_NO_DEPRECATED 1 - -/* Ignore MHD deprecations for now as we want to be compatible - to "ancient" MHD releases. */ -#define MHD_NO_DEPRECATION 1 - - -/** - * Required prefix for the authorization header as per RFC 8959. - * (Follows RFC 6750 albeit technically violates RFC 7235, but - * Mark Nottingham thinks this should be fixed by revising HTTP - * spec (https://github.com/httpwg/http-core/issues/733)) - */ -#define RFC_8959_PREFIX "secret-token:" - -/* LSB-style exit status codes */ -#ifndef EXIT_INVALIDARGUMENT -/** - * Command-line arguments are invalid. - * Restarting useless. - */ -#define EXIT_INVALIDARGUMENT 2 -#endif - -#ifndef EXIT_NOTIMPLEMENTED -/** - * The requested operation is not implemented. - * Restarting useless. - */ -#define EXIT_NOTIMPLEMENTED 3 -#endif - -#ifndef EXIT_NOPERMISSION -/** - * Permissions needed to run are not available. - * Restarting useless. - */ -#define EXIT_NOPERMISSION 4 -#endif - -#ifndef EXIT_NOTINSTALLED -/** - * Key resources are not installed. - * Restarting useless. - */ -#define EXIT_NOTINSTALLED 5 -#endif - -#ifndef EXIT_NOTCONFIGURED -/** - * Key configuration settings are missing or invalid. - * Restarting useless. - */ -#define EXIT_NOTCONFIGURED 6 -#endif - -#ifndef EXIT_NOTRUNNING -#define EXIT_NOTRUNNING 7 -#endif - -#ifndef EXIT_NO_RESTART -/** - * Exit code from 'main' if we do not want to be restarted, - * except by manual intervention (hard failure). - */ -#define EXIT_NO_RESTART 9 -#endif - - -#endif /* PLATFORM_H_ */ - -/* end of platform.h */ diff --git a/src/include/taler_merchant_bank_lib.h b/src/include/taler_merchant_bank_lib.h @@ -1,263 +0,0 @@ -/* - This file is part of GNU Taler - Copyright (C) 2021-2023 Taler Systems SA - - Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License along with - Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file include/taler_merchant_bank_lib.h - * @brief C interface to access the Taler merchant facade of LibEuFin - * See https://docs.taler.net/TBD - * @author Christian Grothoff - */ -#ifndef TALER_MERCHANT_BANK_LIB_H -#define TALER_MERCHANT_BANK_LIB_H - -#include <taler/taler_error_codes.h> -#include <jansson.h> -#include <gnunet/gnunet_curl_lib.h> -#include <taler/taler_util.h> - - -/** - * Authentication method types. - */ -enum TALER_MERCHANT_BANK_AuthenticationMethod -{ - - /** - * No authentication. - */ - TALER_MERCHANT_BANK_AUTH_NONE, - - /** - * Basic authentication with cleartext username and password. - */ - TALER_MERCHANT_BANK_AUTH_BASIC, - - /** - * Bearer token authentication. - */ - TALER_MERCHANT_BANK_AUTH_BEARER, -}; - - -/** - * Information used to authenticate to the bank. - */ -struct TALER_MERCHANT_BANK_AuthenticationData -{ - - /** - * Base URL we use to talk to the wire gateway, - * which talks to the bank for us. - */ - char *wire_gateway_url; - - /** - * Which authentication method should we use? - */ - enum TALER_MERCHANT_BANK_AuthenticationMethod method; - - /** - * Further details as per @e method. - */ - union - { - - /** - * Details for #TALER_MERCHANT_BANK_AUTH_BASIC. - */ - struct - { - /** - * Username to use. - */ - char *username; - - /** - * Password to use. - */ - char *password; - } basic; - - /** - * Details for #TALER_MERCHANT_BANK_AUTH_BASIC. - */ - struct - { - /** - * Token to use. - */ - char *token; - } bearer; - - } details; - -}; - - -/* ********************* /history/incoming *********************** */ - -/** - * Handle for querying the bank for transactions - * made to the exchange. - */ -struct TALER_MERCHANT_BANK_CreditHistoryHandle; - -/** - * Details about a wire transfer to the exchange. - */ -struct TALER_MERCHANT_BANK_CreditDetails -{ - /** - * Amount that was transferred - */ - struct TALER_Amount amount; - - /** - * Time of the the transfer - */ - struct GNUNET_TIME_Timestamp execution_date; - - /** - * The wire transfer subject. - */ - const char *wire_subject; - - /** - * payto://-URL of the source account that - * send the funds. - */ - struct TALER_FullPayto debit_account_uri; - - /** - * payto://-URL of the target account that - * received the funds. - */ - struct TALER_FullPayto credit_account_uri; -}; - - -/** - * Callbacks of this type are used to serve the result of asking - * the bank for the credit transaction history. - * - * @param cls closure - * @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful status request - * 0 if the bank's reply is bogus (fails to follow the protocol), - * #MHD_HTTP_NO_CONTENT if there are no more results; on success the - * last callback is always of this status (even if `abs(num_results)` were - * already returned). - * @param ec detailed error code - * @param serial_id monotonically increasing counter corresponding to the transaction - * @param details details about the wire transfer - * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration - */ -typedef enum GNUNET_GenericReturnValue -(*TALER_MERCHANT_BANK_CreditHistoryCallback)( - void *cls, - unsigned int http_status, - enum TALER_ErrorCode ec, - uint64_t serial_id, - const struct TALER_MERCHANT_BANK_CreditDetails *details); - - -/** - * Request the wire credit history of an exchange's bank account. - * - * @param ctx curl context for the event loop - * @param auth authentication data to use - * @param start_row from which row on do we want to get results, use UINT64_MAX for the latest; exclusive - * @param num_results how many results do we want; negative numbers to go into the past, - * positive numbers to go into the future starting at @a start_row; - * must not be zero. - * @param timeout how long the client is willing to wait for more results - * (only useful if @a num_results is positive) - * @param hres_cb the callback to call with the transaction history - * @param hres_cb_cls closure for the above callback - * @return NULL - * if the inputs are invalid (i.e. zero value for @e num_results). - * In this case, the callback is not called. - */ -struct TALER_MERCHANT_BANK_CreditHistoryHandle * -TALER_MERCHANT_BANK_credit_history ( - struct GNUNET_CURL_Context *ctx, - const struct TALER_MERCHANT_BANK_AuthenticationData *auth, - uint64_t start_row, - int64_t num_results, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_BANK_CreditHistoryCallback hres_cb, - void *hres_cb_cls); - - -/** - * Cancel an history request. This function cannot be used on a request - * handle if the last response (anything with a status code other than - * 200) is already served for it. - * - * @param hh the history request handle - */ -void -TALER_MERCHANT_BANK_credit_history_cancel ( - struct TALER_MERCHANT_BANK_CreditHistoryHandle *hh); - - -/* ******************** Convenience functions **************** */ - - -/** - * Convenience method for parsing configuration section with bank - * authentication data. - * - * @param cfg configuration to parse - * @param section the section with the configuration data - * @param[out] auth set to the configuration data found - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_BANK_auth_parse_cfg ( - const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - struct TALER_MERCHANT_BANK_AuthenticationData *auth); - - -/** - * Convenience method for parsing JSON with bank - * authentication data. - * - * @param cred configuration to parse - * @param backend_url URL of the backend (not in the JSON) - * @param[out] auth set to the configuration data found - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_BANK_auth_parse_json ( - const json_t *cred, - const char *backend_url, - struct TALER_MERCHANT_BANK_AuthenticationData *auth); - - -/** - * Free memory inside of @a auth (but not @a auth itself). - * Dual to #TALER_MERCHANT_BANK_auth_parse_cfg(). - * - * @param auth authentication data to free - */ -void -TALER_MERCHANT_BANK_auth_free ( - struct TALER_MERCHANT_BANK_AuthenticationData *auth); - - -#endif -/* _TALER_MERCHANT_BANK_LIB_H */ diff --git a/src/include/taler_merchant_donau.h b/src/include/taler_merchant_donau.h @@ -1,397 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014-2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file taler_merchant_donau.h - * @brief Structs to interact with the donau. - * @author Bohdan Potuzhnyi - * @author Vlada Svirsh - */ -#ifndef _TALER_MERCHANT_DONAU_H -#define _TALER_MERCHANT_DONAU_H - -#include <taler/taler_util.h> -#include <taler/taler_error_codes.h> -#include <taler/taler_exchange_service.h> -#include "taler_merchant_service.h" -#include <donau/donau_service.h> -#include <donau/donau_util.h> -#include <donau/donaudb_plugin.h> - -/** - * Structure to hold charity details for the Donau service. - */ -struct TALER_MERCHANT_DONAU_Charity -{ - /** - * name of the charity - */ - const char *name; - - /** - * charity url - */ - const char *charity_url; - - /** - * public key of the charity - */ - struct DONAU_CharityPublicKeyP charity_pub; - - /** - * Max donation amount for this charitiy and @e current_year. - */ - struct TALER_Amount max_per_year; - - /** - * Current amount of donation receipts for @e current_year. - */ - struct TALER_Amount receipts_to_date; - - /** - * current year - */ - uint64_t current_year; - - /** - * The unique identifier of the charity. - */ - uint64_t charity_id; -}; - - -/** - * Structure to hold Donau instance details from the database. - */ -struct TALER_MERCHANTDB_DonauInstance -{ - /** - * Donau instance serial - */ - uint64_t donau_instance_serial; - - /** - * The URL for the Donau instance. - */ - char *donau_url; - - /** - * The name of the charity associated with the Donau instance. - */ - char *charity_name; - - /** - * Pointer to the public key of the charity, used for cryptographic operations. - * This is represented as an EDDSA public key structure. - */ - struct DONAU_CharityPublicKeyP *charity_pub_key; - - /** - * A unique identifier for the charity in the Donau instance. - */ - uint64_t charity_id; - - /** - * The maximum allowable amount for donations to this charity in the current year. - * This is tracked for regulatory or internal business constraints. - */ - struct TALER_Amount charity_max_per_year; - - /** - * The total amount of donations received by the charity in the current year. - * This field helps track progress toward the yearly donation limit. - */ - struct TALER_Amount charity_receipts_to_date; - - /** - * The current year being tracked for donations. - * This is used to differentiate donation data between years. - */ - int64_t current_year; - - /** - * A JSON object containing key information specific to the Donau instance, - * such as cryptographic keys or other relevant details. - */ - json_t *donau_keys_json; -}; - - -/** - * Callback function typically used by `select_donau_instances` to handle - * the details of each Donau instance retrieved from the database. - * - * @param cls Closure to pass additional context or data to the callback function. - * @param donau_instance_serial Serial number of the Donau instance in the merchant database. - * @param donau_url The URL of the Donau instance. - * @param charity_name The name of the charity associated with the Donau instance. - * @param charity_pub_key Pointer to the charity's public key used for cryptographic operations. - * @param charity_id The unique identifier for the charity within the Donau instance. - * @param charity_max_per_year Maximum allowed donations to the charity for the current year. - * @param charity_receipts_to_date Total donations received by the charity so far in the current year. - * @param current_year The year for which the donation data is being tracked. - * @param donau_keys_json JSON object containing additional key-related information for the Donau instance, NULL if not (yet) available. - */ -typedef void -(*TALER_MERCHANTDB_DonauInstanceCallback)( - void *cls, - uint64_t donau_instance_serial, - const char *donau_url, - const char *charity_name, - const struct DONAU_CharityPublicKeyP *charity_pub_key, - uint64_t charity_id, - const struct TALER_Amount *charity_max_per_year, - const struct TALER_Amount *charity_receipts_to_date, - int64_t current_year, - const json_t *donau_keys_json - ); - -/** - * Callback function typically used by `select_donau_instances` to handle - * the details of each Donau instance retrieved from the database. - * - * @param cls Closure to pass additional context or data to the callback function. - * @param donau_url The URL of the Donau instance. - */ -typedef void -(*TALER_MERCHANTDB_DonauInstanceFilteredCallback)( - void *cls, - const char *donau_url - ); - -/** - * SPECIFICATION FOR REQUESTS /donau - */ - -/** - * Handle for a GET /donau operation. - */ -struct TALER_MERCHANT_DonauInstanceGetHandle; - -/** - * Individual Donau instance details. - */ -struct TALER_MERCHANT_DonauInstanceEntry -{ - /** - * Serial number of the Donau instance in merchant database. - */ - uint64_t donau_instance_serial; - - /** - * The URL of the Donau service. - */ - const char *donau_url; - - /** - * Name of the charity associated with the Donau instance. - */ - const char *charity_name; - - /** - * Public key of the charity. - */ - struct DONAU_CharityPublicKeyP charity_pub_key; - - /** - * ID of the charity on Donau. - */ - uint64_t charity_id; - - /** - * Maximum donation amount per year allowed for the charity. - */ - struct TALER_Amount charity_max_per_year; - - /** - * Total donations received by the charity in the current year. - */ - struct TALER_Amount charity_receipts_to_date; - - /** - * The current year being tracked for donations. - */ - int64_t current_year; - - /** - * Additional key information related to the Donau instance. - */ - const struct DONAU_Keys *donau_keys; -}; - -/** - * Response for a GET /donau request. - */ -struct TALER_MERCHANT_DonauInstanceGetResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on the HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - /** - * Length of the @e donau_instances array. - */ - unsigned int donau_instances_length; - - /** - * Details about the Donau instance. - */ - struct TALER_MERCHANT_DonauInstanceEntry *donau_instances; - } ok; - } details; -}; - -/** - * Function called with the result of the GET /donau operation. - * - * @param cls closure - * @param dir response details - */ -typedef void -(*TALER_MERCHANT_DonauInstanceGetCallback)( - void *cls, - const struct TALER_MERCHANT_DonauInstanceGetResponse *dir); - -/** - * Initiate the GET /donau request. - * - * @param ctx CURL context - * @param backend_url base URL for the backend - * @param cb callback function to handle the response - * @param cb_cls closure for the callback function - * @return the handle for the operation, or NULL on error - */ -struct TALER_MERCHANT_DonauInstanceGetHandle * -TALER_MERCHANT_donau_instances_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_DonauInstanceGetCallback cb, - void *cb_cls); - - -/** - * Cancel the GET /donau instances operation. - * - * @param dgh request to cancel. - */ -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 auth_token the authentication token for the operation - * @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); - -/** - * Handle for a DELETE /donau/$charity_id operation. - */ -struct TALER_MERCHANT_DonauInstanceDeleteHandle; - -/** - * Callback for DELETE /donau/$charity_id operation. - * - * @param cls Closure to pass context. - * @param hr HTTP response data. - */ -typedef void -(*TALER_MERCHANT_DonauInstanceDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - -/** - * Initiates the DELETE /donau/$charity_id operation. - * - * @param ctx CURL context - * @param backend_url Base URL for the backend - * @param charity_id The ID of the charity to delete - * @param cb Callback function to handle the response - * @param cb_cls Closure for @a cb - * @return the handle for the operation, or NULL on error - */ -struct TALER_MERCHANT_DonauInstanceDeleteHandle * -TALER_MERCHANT_donau_instance_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - uint64_t charity_id, - TALER_MERCHANT_DonauInstanceDeleteCallback cb, - void *cb_cls); - -/** - * Cancel the DELETE /donau/$charity_id operation. - * - * @param ddh Handle for the operation to cancel. - */ -void -TALER_MERCHANT_donau_instance_delete_cancel ( - struct TALER_MERCHANT_DonauInstanceDeleteHandle *ddh); - -#endif diff --git a/src/include/taler_merchant_pay_service.h b/src/include/taler_merchant_pay_service.h @@ -1,610 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014-2024 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file taler_merchant_pay_service.h - * @brief Payment‑specific interface extracted from taler_merchant_service.h - * **Only** declarations and helper‑macros live here – the actual - * implementation must be provided in the accompanying *.c file. - * This header can be included by both merchant front‑ends and wallets - * that want to create or proxy /orders/$ID/pay requests. - */ -#ifndef TALER_MERCHANT_PAY_SERVICE_H -#define TALER_MERCHANT_PAY_SERVICE_H - -#include <taler/taler_util.h> -#include <taler/taler_signatures.h> -#include <taler/taler_error_codes.h> -#include <taler/taler_exchange_service.h> -#include "taler_merchant_service.h" -#include <gnunet/gnunet_time_lib.h> - - -#ifndef TALER_MERCHANT_ORDER_PAY_CALLBACK_CLOSURE_TYPE -#define TALER_MERCHANT_ORDER_PAY_CALLBACK_CLOSURE_TYPE void -#endif - -/** - * Opaque handle returned by the payment helper APIs declared below. - */ -struct TALER_MERCHANT_OrderPayHandle; - -/** - * Which option is being supplied to #TALER_MERCHANT_order_pay_set_options(). - */ -enum TALER_MERCHANT_OrderPayOptionType -{ - TALER_MERCHANT_OrderPayOptionType_END = 0, - TALER_MERCHANT_OrderPayOptionType_MERCHANT_URL, - TALER_MERCHANT_OrderPayOptionType_SESSION_ID, - TALER_MERCHANT_OrderPayOptionType_H_CONTRACT, - TALER_MERCHANT_OrderPayOptionType_CHOICE_INDEX, - TALER_MERCHANT_OrderPayOptionType_AMOUNT, - TALER_MERCHANT_OrderPayOptionType_MAX_FEE, - TALER_MERCHANT_OrderPayOptionType_MERCHANT_PUB, - TALER_MERCHANT_OrderPayOptionType_TIMESTAMP, - TALER_MERCHANT_OrderPayOptionType_REFUND_DEADLINE, - TALER_MERCHANT_OrderPayOptionType_PAY_DEADLINE, - TALER_MERCHANT_OrderPayOptionType_H_WIRE, - TALER_MERCHANT_OrderPayOptionType_ORDER_ID, - TALER_MERCHANT_OrderPayOptionType_COINS, - TALER_MERCHANT_OrderPayOptionType_INPUT_TOKENS, - TALER_MERCHANT_OrderPayOptionType_OUTPUT_TOKENS, - TALER_MERCHANT_OrderPayOptionType_WALLET_DATA, // Used privately so no #define is present for it - TALER_MERCHANT_OrderPayOptionType_DONAU_URL, - TALER_MERCHANT_OrderPayOptionType_DONAU_YEAR, - TALER_MERCHANT_OrderPayOptionType_DONAU_BUDIS, - /*New objects go in here*/ - TALER_MERCHANT_OrderPayOptionType_LENGTH -}; - -/** - * Container describing *one* option for a payment request. - * - * Applications should typically not use this struct directly, - * only through respective TALER_MERCHANT_ORDER_PAY_OPTION_-macros - */ -struct TALER_MERCHANT_OrderPayOption -{ - /** - * Type of the option being supplied. - */ - enum TALER_MERCHANT_OrderPayOptionType ot; - - union - { - const char *merchant_url; - const char *session_id; - const struct TALER_PrivateContractHashP *h_contract; - int choice_index; - struct TALER_Amount amount; - struct TALER_Amount max_fee; - struct TALER_MerchantPublicKeyP merchant_pub; - struct GNUNET_TIME_Timestamp timestamp; - struct GNUNET_TIME_Timestamp refund_deadline; - struct GNUNET_TIME_Timestamp pay_deadline; - struct TALER_MerchantWireHashP h_wire; - const char *order_id; - struct - { - unsigned int num_coins; - const struct TALER_MERCHANT_PayCoin *coins; - } coins; - struct - { - unsigned int num_tokens; - const struct TALER_MERCHANT_UseToken *tokens; - } input_tokens; - struct - { - unsigned int num_output_tokens; - const struct TALER_MERCHANT_OutputToken *output_tokens; - } output_tokens; - const char *donau_url; - uint64_t donau_year; - json_t *donau_budis_json; - } details; -}; - - -/** - * Status codes returned from #TALER_MERCHANT_order_pay_set_options() and - * #TALER_MERCHANT_order_pay_start(). - */ -enum TALER_MERCHANT_OrderPayErrorCode -{ - TALER_MERCHANT_OPOEC_OK = 0, /**< everything fine */ - TALER_MERCHANT_OPOEC_UNKNOWN_OPTION, /**< unrecognised option kind */ - TALER_MERCHANT_OPOEC_DUPLICATE_OPTION, /**< option given more than once */ - TALER_MERCHANT_OPOEC_INVALID_VALUE, /**< semantic/format error in value */ - TALER_MERCHANT_OPOEC_MISSING_MANDATORY, /**< required field missing at start */ - TALER_MERCHANT_OPOEC_URL_FAILURE, /**< failed to build request URL */ - TALER_MERCHANT_OPOEC_CURL_FAILURE /**< failed to init/schedule CURL */ -}; - - -/** - * Terminate the list of payment options. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_END \ - } - - -/** - * Specify the merchant’s URL for the payment request. - * - * @param _url NULL-terminated string holding the merchant endpoint. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_URL("https://shop.example/pay"), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_URL(_url) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_MERCHANT_URL, \ - .details.merchant_url = (_url) \ - } - - -/** - * Supply the session identifier for this payment. - * - * @param _sid session ID string. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_SESSION_ID("ABC123"), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_SESSION_ID(_sid) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_SESSION_ID, \ - .details.session_id = (_sid) \ - } - - -/** - * Supply a private contract hash for the order. - * - * @param _h pointer to a TALER_PrivateContractHashP. - * - * @par Example - * \code - * struct TALER_PrivateContractHashP *h = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_H_CONTRACT(h), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_H_CONTRACT(_h) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_H_CONTRACT, \ - .details.h_contract = (_h) \ - } - - -/** - * Supply which choice index the customer(wallet) selected. - * from contract terms. - * - * @param _idx choice index. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_CHOICE_INDEX(2), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_CHOICE_INDEX(_idx) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_CHOICE_INDEX, \ - .details.choice_index = (_idx) \ - } - - -/** - * Specify the amount to be paid. - * - * @param _amt pointer to a TALER_Amount struct. - * - * @par Example - * \code - * struct TALER_Amount amt = ...; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_AMOUNT(&amt), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_AMOUNT(_amt) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_AMOUNT, \ - .details.amount = *(_amt) \ - } - - -/** - * Set the maximum acceptable fee. - * - * @param _fee pointer to a TALER_Amount struct for the fee cap. - * - * @par Example - * \code - * struct TALER_Amount fee = ...; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_MAX_FEE(&fee), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_MAX_FEE(_fee) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_MAX_FEE, \ - .details.max_fee = *(_fee) \ - } - - -/** - * Provide the merchant’s public key. - * - * @param _mpub pointer to a TALER_MerchantPublicKeyP. - * - * @par Example - * \code - * struct TALER_MerchantPublicKeyP *mp = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_PUB(mp), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_PUB(_mpub) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_MERCHANT_PUB, \ - .details.merchant_pub = *(_mpub) \ - } - - -/** - * Stamp the request with a specific time. - * - * @param _ts GNUNET_TIME_Timestamp value. - * - * @par Example - * \code - * struct GNUNET_TIME_Timestamp now = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_TIMESTAMP(now), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_TIMESTAMP(_ts) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_TIMESTAMP, \ - .details.timestamp = (_ts) \ - } - - -/** - * Set a deadline by which refunds may be issued. - * - * @param _ts GNUNET_TIME_Timestamp for the refund deadline. - * - * @par Example - * \code - * struct GNUNET_TIME_Timestamp rd = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_REFUND_DEADLINE(rd), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_REFUND_DEADLINE(_ts) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_REFUND_DEADLINE, \ - .details.refund_deadline = (_ts) \ - } - - -/** - * Set a deadline by which payment must be completed. - * - * @param _ts GNUNET_TIME_Timestamp for the payment deadline. - * - * @par Example - * \code - * struct GNUNET_TIME_Timestamp pd = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_PAY_DEADLINE(pd), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_PAY_DEADLINE(_ts) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_PAY_DEADLINE, \ - .details.pay_deadline = (_ts) \ - } - - -/** - * Supply the merchant wire transaction hash. - * - * @param _hwire pointer to a TALER_MerchantWireHashP. - * - * @par Example - * \code - * struct TALER_MerchantWireHashP *wh = …; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_H_WIRE(wh), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_H_WIRE(_hwire) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_H_WIRE, \ - .details.h_wire = *(_hwire) \ - } - - -/** - * Provide the unique order identifier. - * - * @param _oid NULL-terminated string of the order ID. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_ORDER_ID("order-42"), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_ORDER_ID(_oid) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_ORDER_ID, \ - .details.order_id = (_oid) \ - } - - -/** - * Include a list of pay coins. - * - * @param _num number of coins in the array - * @param _coins pointer to array of TALER_MERCHANT_PayCoin. - * - * @par Example - * \code - * const struct TALER_MERCHANT_PayCoin coins[2] = { … }; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_COINS(2, coins), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_COINS(_num,_coins) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_COINS, \ - .details.coins = { .num_coins = (_num), \ - .coins = (_coins) } \ - } - - -/** - * Include a list of input tokens. - * - * @param _num number of tokens - * @param _tokens pointer to array of TALER_MERCHANT_UseToken. - * - * @par Example - * \code - * const struct TALER_MERCHANT_UseToken toks[1] = { … }; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_INPUT_TOKENS(1, toks), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ - -#define TALER_MERCHANT_ORDER_PAY_OPTION_INPUT_TOKENS(_num,_tokens) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_INPUT_TOKENS, \ - .details.input_tokens = { .num_tokens = (_num), \ - .tokens = (_tokens) } \ - } - - -/** - * Include a list of output tokens. - * - * @param _num number of output tokens - * @param _otokens pointer to array of TALER_MERCHANT_OutputToken. - * - * @par Example - * \code - * const struct TALER_MERCHANT_OutputToken ots[3] = { … }; - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_OUTPUT_TOKENS(3, ots), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_OUTPUT_TOKENS(_num,_otokens) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_OUTPUT_TOKENS, \ - .details.output_tokens = { .num_output_tokens = (_num), \ - .output_tokens = (_otokens) } \ - } - - -/** - * Supply the Donau service URL. - * - * @param _u NULL-terminated string of the Donau endpoint. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_URL("https://donau.example"), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_URL(_u) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_DONAU_URL, \ - .details.donau_url = (_u) \ - } - - -/** - * Specify the Donau “year” parameter. - * - * @param _y 64-bit unsigned integer for the Donau year. - * - * @par Example - * \code - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_YEAR(2025), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_YEAR(_y) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_DONAU_YEAR, \ - .details.donau_year = (_y) \ - } - - -/** - * Supply the Donau “budis” JSON structure. - * - * @param _js pointer to a json_t* holding the budis data. - * - * @par Example - * \code - * json_t *budis = json_pack("{s:i}", "quota", 100); - * struct TALER_MERCHANT_OrderPayOption opts[] = { - * TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_BUDIS(budis), - * TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE() - * }; - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_OPTION_DONAU_BUDIS(_js) \ - (struct TALER_MERCHANT_OrderPayOption){ \ - .ot = TALER_MERCHANT_OrderPayOptionType_DONAU_BUDIS, \ - .details.donau_budis_json = (_js) \ - } - - -/** - * Helper to call TALER_MERCHANT_order_pay_set_options() - * with a compound‐literal array terminated by TERMINATE(). - * - * @param ph the payment handle - * @param ... a comma-separated list of `_OPTION_*()` macros - * - * @par Example - * \code - * TALER_MERCHANT_ORDER_PAY_SET_OPTIONS(handle, - * TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_URL("https://…"), - * TALER_MERCHANT_ORDER_PAY_OPTION_AMOUNT(&amt), - * TALER_MERCHANT_ORDER_PAY_OPTION_MAX_FEE(&fee) - * ); - * \endcode - */ -#define TALER_MERCHANT_ORDER_PAY_SET_OPTIONS(ph,...) \ - MHD_NOWARN_COMPOUND_LITERALS_ \ - TALER_MERCHANT_order_pay_set_options ( \ - daemon, \ - ((const struct TALER_MERCHANT_OrderPayHandle[]) \ - {__VA_ARGS__, TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE ()}), \ - MHD_OPTIONS_ARRAY_MAX_SIZE) \ - - -/** - * @brief Create and initialize a new payment handle. - * - * @param ctx GNUNET CURL context used for HTTP operations - * @param pay_cb callback to invoke when the payment completes or fails - * @param pay_cb_cls closure data passed back to @a pay_cb - * @return pointer to a newly allocated handle, or NULL on error - */ -struct TALER_MERCHANT_OrderPayHandle * -TALER_MERCHANT_order_pay_create (struct GNUNET_CURL_Context *ctx, - TALER_MERCHANT_OrderPayCallback pay_cb, - TALER_MERCHANT_ORDER_PAY_CALLBACK_CLOSURE_TYPE - *pay_cb_cls); - - -/** - * @brief Configure payment options on a handle. - * - * @param ph payment handle to configure - * @param options NULL-terminated array of options (use - * TALER_MERCHANT_ORDER_PAY_OPTION_* macros) - * @param max_options maximum number of options in the @a options array - * @return #TALER_MERCHANT_OPOEC_OK on success; - * error code otherwise - */ -enum TALER_MERCHANT_OrderPayErrorCode -TALER_MERCHANT_order_pay_set_options (struct TALER_MERCHANT_OrderPayHandle *ph, - const struct TALER_MERCHANT_OrderPayOption - options[], - size_t max_options); - - -/** - * @brief Start processing the payment request. - * - * @param ph fully configured payment handle - * @return #TALER_MERCHANT_OPOEC_OK on successful dispatch; - * error code on validation or dispatch failure - */ -enum TALER_MERCHANT_OrderPayErrorCode -TALER_MERCHANT_order_pay_start (struct TALER_MERCHANT_OrderPayHandle *ph); - - -/** - * @brief Cancel an in-flight or pending payment. - * - * @param ph payment handle to cancel and free - */ -void -TALER_MERCHANT_order_pay_cancel1 (struct TALER_MERCHANT_OrderPayHandle *ph); - -#endif /* TALER_MERCHANT_PAY_SERVICE_H */ diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h @@ -1,6704 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014-2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file taler_merchant_service.h - * @brief C interface of libtalermerchant, a C library to use merchant's HTTP API - * This library is not thread-safe, all APIs must only be used from a single thread. - * This library calls abort() if it runs out of memory. Be aware of these limitations. - * @author Christian Grothoff - * @author Marcello Stanisci - * @author Priscilla HUANG - */ -#ifndef _TALER_MERCHANT_SERVICE_H -#define _TALER_MERCHANT_SERVICE_H - -#include <taler/taler_util.h> -#include <taler/taler_error_codes.h> -#include <taler/taler_exchange_service.h> -#include <gnunet/gnunet_curl_lib.h> -#include <jansson.h> - -/** - * Library version (in hex) for compatibility tests. - */ -#define TALER_MERCHANT_SERVICE_VERSION 0x00100001 - - -/** - * General information about the HTTP response we obtained - * from the merchant for a request. - */ -struct TALER_MERCHANT_HttpResponse -{ - - /** - * The complete JSON reply. NULL if we failed to parse the - * reply (too big, invalid JSON). - */ - const json_t *reply; - - /** - * The complete JSON reply from the exchange, if we generated an error in - * response to an exchange error. Usually set if @e http_status is - * #MHD_HTTP_FAILED_DEPENDENCY or #MHD_HTTP_SERVICE_UNAVAILABLE. NULL if we - * failed to obtain a JSON reply from the exchange or if we did not receive - * an error from the exchange. - */ - const json_t *exchange_reply; - - /** - * Set to the human-readable 'hint' that is optionally - * provided by the exchange together with errors. NULL - * if no hint was provided or if there was no error. - */ - const char *hint; - - /** - * The error hint from the exchange, if we generated an error in - * response to an exchange error. Usually set if @e http_status is - * #MHD_HTTP_FAILED_DEPENDENCY or #MHD_HTTP_SERVICE_UNAVAILABLE. NULL if we - * failed to obtain a hint from the exchange or if we did not receive - * an error from the exchange. - */ - const char *exchange_hint; - - /** - * HTTP status code for the response. 0 if the - * HTTP request failed and we did not get any answer, or - * if the answer was invalid and we set @a ec to a - * client-side error code. - */ - unsigned int http_status; - - /** - * The HTTP status code from the exchange, if we generated an error in - * response to an exchange error. Usually set if @e http_status is - * #MHD_HTTP_FAILED_DEPENDENCY or #MHD_HTTP_SERVICE_UNAVAILABLE. 0 if we - * failed to obtain a JSON reply from the exchange or if we did not receive - * an error from the exchange. - */ - unsigned int exchange_http_status; - - /** - * Taler error code. #TALER_EC_NONE if everything was - * OK. Usually set to the "code" field of an error - * response, but may be set to values created at the - * client side, for example when the response was - * not in JSON format or was otherwise ill-formed. - */ - enum TALER_ErrorCode ec; - - /** - * The error code from the reply from the exchange, if we generated an error in - * response to an exchange error. Usually set if @e http_status is - * #MHD_HTTP_FAILED_DEPENDENCY or #MHD_HTTP_SERVICE_UNAVAILABLE. NULL if we - * failed to obtain a error code from the exchange or if we did not receive - * an error from the exchange. - */ - enum TALER_ErrorCode exchange_code; - -}; - - -/** - * Contains information gathered from parsing a taler://pay URI. - */ -struct TALER_MERCHANT_PayUriData -{ - /** - * Hostname (and possibly port) of the merchant. - */ - char *merchant_host; - - /** - * Prefix to the base url of the merchant backend. May be NULL. - */ - char *merchant_prefix_path; - - /** - * The id of the order to pay. - */ - char *order_id; - - /** - * Session id to use when paying the order. May be NULL. - */ - char *session_id; - - /** - * Claim token to use when claiming the order. May be NULL. - */ - struct TALER_ClaimTokenP *claim_token; - - /** - * A WLAN SSID that the wallet can use to connect to the internet in order to - * to pay. May be NULL. - */ - char *ssid; - - /** - * true if the URI used taler+http. - */ - bool use_http; -}; - - -/** - * Extracts information from a taler://pay URI. - * - * @param pay_uri the URI to parse. - * @param[out] parse_data data extracted from the URI. Must be free'd. - * @return #GNUNET_SYSERR if @e pay_uri is malformed, #GNUNET_OK otherwise. - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_parse_pay_uri (const char *pay_uri, - struct TALER_MERCHANT_PayUriData *parse_data); - - -/** - * Frees data contained in the result of parsing a taler://pay URI. - * - * @param[in] parse_data the data to free. - */ -void -TALER_MERCHANT_parse_pay_uri_free ( - struct TALER_MERCHANT_PayUriData *parse_data); - - -/** - * Contains information gathered from parsing a taler://refund URI. - */ -struct TALER_MERCHANT_RefundUriData -{ - /** - * Hostname (and possibly port) of the merchant. - */ - char *merchant_host; - - /** - * Prefix to the base url of the merchant backend. May be NULL. - */ - char *merchant_prefix_path; - - /** - * The id of the order to pay. - */ - char *order_id; - - /** - * A WLAN SSID that the wallet can use to connect to the internet in order to - * to pay. May be NULL. - */ - char *ssid; - - /** - * true if the URI used taler+http. - */ - bool use_http; -}; - - -/** - * Extracts information from a taler://refund URI. - * - * @param refund_uri the URI to parse. - * @param[out] parse_data data extracted from the URI. Must be free'd. - * @return #GNUNET_SYSERR if @e refund_uri is malformed, #GNUNET_OK otherwise. - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_parse_refund_uri ( - const char *refund_uri, - struct TALER_MERCHANT_RefundUriData *parse_data); - - -/** - * Frees data contained in the result of parsing a taler://refund URI. - * - * @param parse_data the data to free. - */ -void -TALER_MERCHANT_parse_refund_uri_free ( - struct TALER_MERCHANT_RefundUriData *parse_data); - - -/* ********************* /public/config ****************** */ - - -/** - * How compatible are the protocol version of the auditor and this - * client? The bits (1,2,4) can be used to test if the auditor's - * version is incompatible, older or newer respectively. - */ -enum TALER_MERCHANT_VersionCompatibility -{ - - /** - * The auditor runs exactly the same protocol version. - */ - TALER_MERCHANT_VC_MATCH = 0, - - /** - * The auditor is too old or too new to be compatible with this - * implementation (bit) - */ - TALER_MERCHANT_VC_INCOMPATIBLE = 1, - - /** - * The auditor is older than this implementation (bit) - */ - TALER_MERCHANT_VC_OLDER = 2, - - /** - * The auditor is too old to be compatible with - * this implementation. - */ - TALER_MERCHANT_VC_INCOMPATIBLE_OUTDATED - = TALER_MERCHANT_VC_INCOMPATIBLE - | TALER_MERCHANT_VC_OLDER, - - /** - * The auditor is more recent than this implementation (bit). - */ - TALER_MERCHANT_VC_NEWER = 4, - - /** - * The auditor is too recent for this implementation. - */ - TALER_MERCHANT_VC_INCOMPATIBLE_NEWER - = TALER_MERCHANT_VC_INCOMPATIBLE - | TALER_MERCHANT_VC_NEWER, - - /** - * We could not even parse the version data. - */ - TALER_MERCHANT_VC_PROTOCOL_ERROR = 8 - -}; - - -/** - * @brief Config information we get from the backend. - */ -struct TALER_MERCHANT_ConfigInformation -{ - /** - * Default currency of the merchant. See cspecs - * for all currencies supported by the merchant. - */ - const char *currency; - - /** - * Supported Taler protocol version by the merchant. - * String in the format current:revision:age using the - * semantics of GNU libtool. See - * https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning - */ - const char *version; - -}; - - -/** - * Information about an exchange the merchant backend trusts. - */ -struct TALER_MERCHANT_ExchangeConfigInfo -{ - /** - * Base URL of the exchange REST API. - */ - const char *base_url; - - /** - * Currency for which the merchant is configured to - * trust the exchange. - */ - const char *currency; - - /** - * Master public key of the exchange. - */ - struct TALER_MasterPublicKeyP master_pub; - -}; - -/** - * Response to /config request. - */ -struct TALER_MERCHANT_ConfigResponse -{ - /** - * HTTP response. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Status-dependent details. - */ - union - { - /** - * Information returned on #MHD_HTTP_OK. - */ - struct - { - - /** - * basic information about the merchant - */ - struct TALER_MERCHANT_ConfigInformation ci; - - /** - * protocol compatibility information - */ - enum TALER_MERCHANT_VersionCompatibility compat; - - /** - * Length of the @e cspecs array. - */ - unsigned int num_cspecs; - - /** - * Array with rendering specifications for the currencies - * supported by this merchant backend. - */ - const struct TALER_CurrencySpecification *cspecs; - - /** - * Length of the @e exchanges array. - */ - unsigned int num_exchanges; - - /** - * Array details about exchanges trusted - * by this merchant backend. - */ - const struct TALER_MERCHANT_ExchangeConfigInfo *exchanges; - - } ok; - } details; -}; - - -/** - * Function called with information about the merchant. - * - * @param cls closure - * @param cr response data - */ -typedef void -(*TALER_MERCHANT_ConfigCallback) ( - void *cls, - const struct TALER_MERCHANT_ConfigResponse *cr); - - -/** - * Handle for a #TALER_MERCHANT_config_get() operation. - */ -struct TALER_MERCHANT_ConfigGetHandle; - - -/** - * Get the config data of a merchant. Will connect to the merchant backend - * and obtain information about the backend. The respective information will - * be passed to the @a config_cb once available. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param config_cb function to call with the - * backend's config information - * @param config_cb_cls closure for @a config_cb - * @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); - - -/** - * Cancel /config request. Must not be called by clients after - * the callback was invoked. - * - * @param[in] vgh request to cancel. - */ -void -TALER_MERCHANT_config_get_cancel (struct TALER_MERCHANT_ConfigGetHandle *vgh); - - -/* ********************* /instances *********************** */ - - -/** - * @brief Information about a merchant instance. - */ -struct TALER_MERCHANT_InstanceInformation -{ - /** - * Id of this instance. This $ID can be used to construct the URL of the - * instance, by combining it using "$MERCHANT_BASEURL/instances/$ID/". - */ - const char *id; - - /** - * Legal name of the merchant/instance. - */ - const char *name; - - /** - * Public key of the instance. - */ - struct TALER_MerchantPublicKeyP merchant_pub; - - /** - * JSON array of payment targets (strings) supported by this backend - * instance. - */ - const json_t *payment_targets; - -}; - - -/** - * Handle for a GET /instances operation. - */ -struct TALER_MERCHANT_InstancesGetHandle; - - -/** - * Response to a GET /instances request. - */ -struct TALER_MERCHANT_InstancesGetResponse -{ - /** - * HTTP response data - */ - struct TALER_MERCHANT_HttpResponse hr; - - union - { - /** - * Data returned on #MHD_HTTP_OK status. - */ - struct - { - /** - * length of the @e iis array - */ - unsigned int iis_length; - - /** - * array with instance information of length @e iis_length - */ - const struct TALER_MERCHANT_InstanceInformation *iis; - } ok; - } details; - -}; - - -/** - * Function called with the result of the GET /instances operation. - * - * @param cls closure - * @param igr response data - */ -typedef void -(*TALER_MERCHANT_InstancesGetCallback)( - void *cls, - const struct TALER_MERCHANT_InstancesGetResponse *igr); - - -/** - * Get the instance data of a backend. Will connect to the merchant backend - * and obtain information about the instances. The respective information will - * be passed to the @a instances_cb once available. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instances_cb function to call with the - * backend's instances information - * @param instances_cb_cls closure for @a config_cb - * @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); - - -/** - * Cancel /instances request. Must not be called by clients after - * the callback was invoked. - * - * @param igh request to cancel. - */ -void -TALER_MERCHANT_instances_get_cancel ( - struct TALER_MERCHANT_InstancesGetHandle *igh); - - -/** - * Handle for a POST /instances/$ID operation. - */ -struct TALER_MERCHANT_InstancesPostHandle; - - -/** - * Function called with the result of the POST /instances/$ID operation. - * - * @param cls closure - * @param hr HTTP response data - */ -typedef void -(*TALER_MERCHANT_InstancesPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Setup an new instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instance_id identity of the instance to get information about - * @param name name of the merchant instance - * @param address physical address of the merchant instance - * @param jurisdiction jurisdiction of the merchant instance - * @param use_stefan use STEFAN curve for acceptable fees - * @param default_wire_transfer_delay default wire transfer delay merchant will ask for - * @param default_pay_delay default validity period for offers merchant makes - * @param default_refund_delay default refund period - * @param auth_token authentication token to use for access control, NULL for external auth; MUST follow RFC 8959 - * @param cb function to call with the - * backend's instances information - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstancesPostHandle * -TALER_MERCHANT_instances_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - const char *name, - const json_t *address, - const json_t *jurisdiction, - bool use_stefan, - struct GNUNET_TIME_Relative default_wire_transfer_delay, - struct GNUNET_TIME_Relative default_pay_delay, - struct GNUNET_TIME_Relative default_refund_delay, - const char *auth_token, - TALER_MERCHANT_InstancesPostCallback cb, - void *cb_cls); - - -/** - * Cancel /instances request. Must not be called by clients after - * the callback was invoked. - * - * @param iph request to cancel. - */ -void -TALER_MERCHANT_instances_post_cancel ( - struct TALER_MERCHANT_InstancesPostHandle *iph); - - -/** - * Handle for a PATCH /instances/$ID operation. - */ -struct TALER_MERCHANT_InstancePatchHandle; - - -/** - * Function called with the result of the GET /instances/$ID operation. - * - * @param cls closure - * @param hr HTTP response data - */ -typedef void -(*TALER_MERCHANT_InstancePatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Modify an existing instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend (top-level "default" instance - * or base URL of an instance if @a instance_id is NULL) - * @param instance_id identity of the instance to modify information about; NULL - * if the instance is identified as part of the @a backend_url - * @param name name of the merchant instance - * @param address physical address of the merchant instance - * @param jurisdiction jurisdiction of the merchant instance - * @param use_stefan use STEFAN curve for acceptable fees - * @param default_wire_transfer_delay default wire transfer delay merchant will ask for - * @param default_pay_delay default validity period for offers merchant makes - * @param default_refund_delay default refund period - * @param cb function to call with the - * backend's instances information - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstancePatchHandle * -TALER_MERCHANT_instance_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - const char *name, - const json_t *address, - const json_t *jurisdiction, - bool use_stefan, - struct GNUNET_TIME_Relative default_wire_transfer_delay, - struct GNUNET_TIME_Relative default_pay_delay, - struct GNUNET_TIME_Relative default_refund_delay, - TALER_MERCHANT_InstancePatchCallback cb, - void *cb_cls); - - -/** - * Cancel /instances request. Must not be called by clients after - * the callback was invoked. - * - * @param iph request to cancel. - */ -void -TALER_MERCHANT_instance_patch_cancel ( - struct TALER_MERCHANT_InstancePatchHandle *iph); - - -/** - * Handle for an operation to modify authentication settings. - */ -struct TALER_MERCHANT_InstanceAuthPostHande; - - -/** - * Function called with the result of the GET /instances/$ID operation. - * - * @param cls closure - * @param hr HTTP response data - */ -typedef void -(*TALER_MERCHANT_InstanceAuthPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Modify authentication for an existing instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend (top-level "default" instance - * or base URL of an instance if @a instance_id is NULL) - * @param instance_id identity of the instance to patch the authentication for; NULL - * if the instance is identified as part of the @a backend_url - * @param auth_token authorization token needed to access the instance, can be NULL - * to switch to no (or external) authentication; MUST follow RFC 8959 - * @param cb function to call with the backend's response - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstanceAuthPostHandle * -TALER_MERCHANT_instance_auth_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - const char *auth_token, - TALER_MERCHANT_InstanceAuthPostCallback cb, - void *cb_cls); - - -/** - * Cancel /private/auth request. Must not be called by clients after - * the callback was invoked. Afterwards, the authentication may or - * may not have been updated. - * - * @param iaph request to cancel. - */ -void -TALER_MERCHANT_instance_auth_post_cancel ( - struct TALER_MERCHANT_InstanceAuthPostHandle *iaph); - -/** - * Handle for an operation to get access token. - */ -struct TALER_MERCHANT_InstanceTokenPostHande; - - -/** - * Function called with the result of the GET /instances/$ID/private/token - * operation. - * - * @param cls closure - * @param hr HTTP response data - */ -typedef void -(*TALER_MERCHANT_InstanceTokenPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - -/** - * Get access token for an existing instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend (top-level "default" instance - * or base URL of an instance if @a instance_id is NULL) - * @param instance_id identity of the instance to patch the authentication for; NULL - * if the instance is identified as part of the @a backend_url - * @param scope authorization scope for token needed to access the instance, can be NULL - * @param duration requested authorization duration - * @param refreshable requesting a refreshable token or not - * @param cb function to call with the backend's response - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstanceTokenPostHandle * -TALER_MERCHANT_instance_token_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - const char *scope, - struct GNUNET_TIME_Relative duration, - bool refreshable, - TALER_MERCHANT_InstanceTokenPostCallback cb, - void *cb_cls); - - -/** - * Cancel /private/token request. Must not be called by clients after - * the callback was invoked. Afterwards, the authentication may or - * may not have been updated. - * - * @param itph request to cancel. - */ -void -TALER_MERCHANT_instance_token_post_cancel ( - struct TALER_MERCHANT_InstanceTokenPostHandle *itph); - -/** - * Handle for a DELETE /instances/$ID/private/token operation. - */ -struct TALER_MERCHANT_InstanceTokenDeleteHandle; - - -/** - * Function called with the result of the DELETE /instances/$ID/private/token operation. - * - * @param cls closure - * @param hr response data - */ -typedef void -(*TALER_MERCHANT_InstanceTokenDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Remove token instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instance_id identity of the instance to patch the authentication for; NULL - * if the instance is identified as part of the @a backend_url - * @param cb function to call with the response - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstanceTokenDeleteHandle * -TALER_MERCHANT_instance_token_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - TALER_MERCHANT_InstanceTokenDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE token request. Must not be called by clients after - * the callback was invoked. - * - * @param tdh request to cancel. - */ -void -TALER_MERCHANT_instance_token_delete_cancel ( - struct TALER_MERCHANT_InstanceTokenDeleteHandle *tdh); - - -/** - * Handle for a GET /instances/$ID operation. - */ -struct TALER_MERCHANT_InstanceGetHandle; - - -/** - * Details about an instance. - */ -struct TALER_MERCHANT_InstanceDetails -{ - /** - * Name of the merchant instance - */ - const char *name; - - /** - * public key of the merchant instance - */ - struct TALER_MerchantPublicKeyP merchant_pub; - - /** - * physical address of the merchant instance - */ - const json_t *address; - - /** - * jurisdiction of the merchant instance - */ - const json_t *jurisdiction; - - /** - * Are we using STEFAN curves to determine acceptable - * fees? - */ - bool use_stefan; - - /** - * default wire transfer delay merchant will ask for - */ - struct GNUNET_TIME_Relative default_wire_transfer_delay; - - /** - * default validity period for offers merchant makes - */ - struct GNUNET_TIME_Relative default_pay_delay; - - /** - * default refund period for offers merchant makes - */ - struct GNUNET_TIME_Relative default_refund_delay; - - /** - * Default interval by which we round up wire transfer deadlines - * computed using the @e default_wire_transfer_delay. - */ - enum GNUNET_TIME_RounderInterval default_wire_transfer_rounding_interval; - -}; - - -struct TALER_MERCHANT_InstanceGetResponse -{ - /** - * HTTP response data - */ - struct TALER_MERCHANT_HttpResponse hr; - - union - { - - /** - * Data returned on #MHD_HTTP_OK. - */ - struct - { - /** - * Details about the instance. - */ - struct TALER_MERCHANT_InstanceDetails details; - - } ok; - } - details; -}; - - -/** - * Function called with the result of the GET /instances/$ID operation. - * - * @param cls closure - * @param igr response details - */ -typedef void -(*TALER_MERCHANT_InstanceGetCallback)( - void *cls, - const struct TALER_MERCHANT_InstanceGetResponse *igr); - - -/** - * Get the details on one of the instances of a backend. Will connect to the - * merchant backend and obtain information about the instance. The respective - * information will be passed to the @a cb once available. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instance_id identity of the instance to get information about - * @param cb function to call with the - * backend's instances information - * @param cb_cls closure for @a config_cb - * @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); - - -/** - * Cancel /instances request. Must not be called by clients after - * the callback was invoked. - * - * @param igh request to cancel. - */ -void -TALER_MERCHANT_instance_get_cancel ( - struct TALER_MERCHANT_InstanceGetHandle *igh); - - -/** - * Handle for a DELETE /instances operation. - */ -struct TALER_MERCHANT_InstanceDeleteHandle; - - -/** - * Function called with the result of the DELETE /instances operation. - * - * @param cls closure - * @param hr HTTP response data - */ -typedef void -(*TALER_MERCHANT_InstanceDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Delete the private key of an instance of a backend, thereby disabling the - * instance for future requests. Will preserve the other instance data - * (i.e. for taxation). - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend (top-level "default" instance - * or base URL of an instance if @a instance_id is NULL) - * @param instance_id identity of the instance to modify information about; NULL - * if the instance is identified as part of the @a backend_url - * @param instances_cb function to call with the - * backend's return - * @param instances_cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstanceDeleteHandle * -TALER_MERCHANT_instance_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - TALER_MERCHANT_InstanceDeleteCallback instances_cb, - void *instances_cb_cls); - - -/** - * Purge all data associated with an instance. Use with - * extreme caution. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instance_id which instance should be deleted - * @param instances_cb function to call with the - * backend's return - * @param instances_cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_InstanceDeleteHandle * -TALER_MERCHANT_instance_purge ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - TALER_MERCHANT_InstanceDeleteCallback instances_cb, - void *instances_cb_cls); - - -/** - * Cancel /instances DELETE request. Must not be called by clients after - * the callback was invoked. - * - * @param idh request to cancel. - */ -void -TALER_MERCHANT_instance_delete_cancel ( - struct TALER_MERCHANT_InstanceDeleteHandle *idh); - - -/** - * Cancel /instances DELETE request. Must not be called by clients after - * the callback was invoked. - * - * @param arg request to cancel. - */ -#define TALER_MERCHANT_instance_purge_cancel(arg) \ - TALER_MERCHANT_instance_delete_cancel (arg) - - -/* *************** Accounts **************** */ - -/** - * Handle for a POST /instances/$ID/accounts operation. - */ -struct TALER_MERCHANT_AccountsPostHandle; - - -/** - * Response for a POST /instances/$ID/account operation. - */ -struct TALER_MERCHANT_AccountsPostResponse -{ - /** - * HTTP response data - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - - /** - * Details returned on #MHD_HTTP_OK. - */ - struct - { - - /** - * Hash of @e payto_uri and @e salt. - */ - struct TALER_MerchantWireHashP h_wire; - - /** - * salt used to compute h_wire - */ - struct TALER_WireSaltP salt; - } ok; - - } details; -}; - - -/** - * Function called with the result of the POST /instances/$ID/accounts operation. - * - * @param cls closure - * @param par response data - */ -typedef void -(*TALER_MERCHANT_AccountsPostCallback)( - void *cls, - const struct TALER_MERCHANT_AccountsPostResponse *par); - - -/** - * Setup an new account for an instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param payto_uri URI of the bank account as per RFC 8905 - * @param credit_facade_url credit facade for the account, can be NULL - * @param credit_facade_credentials credentials for credit facade, can be NULL - * @param cb function to call with the response - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_AccountsPostHandle * -TALER_MERCHANT_accounts_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - struct TALER_FullPayto payto_uri, - const char *credit_facade_url, - const json_t *credit_facade_credentials, - TALER_MERCHANT_AccountsPostCallback cb, - void *cb_cls); - - -/** - * Cancel POST /accounts request. Must not be called by clients after - * the callback was invoked. - * - * @param pah request to cancel. - */ -void -TALER_MERCHANT_accounts_post_cancel ( - struct TALER_MERCHANT_AccountsPostHandle *pah); - - -/** - * Handle for a GET /accounts/$ID operation. - */ -struct TALER_MERCHANT_AccountGetHandle; - - -/** - * Details about a merchant's bank account. - */ -struct TALER_MERCHANT_AccountDetails -{ - /** - * salt used to compute h_wire - */ - struct TALER_WireSaltP salt; - - /** - * payto:// URI of the account. - */ - struct TALER_FullPayto payto_uri; - - /** - * Credit facade URL of the account. - */ - const char *credit_facade_url; - - /** - * Hash of @e payto_uri and @e salt. - */ - struct TALER_MerchantWireHashP h_wire; - - /** - * true if the account is active, - * false if it is historic. - */ - bool active; -}; - - -/** - * Response returned with details about an account. - */ -struct TALER_MERCHANT_AccountGetResponse -{ - /** - * HTTP response data - */ - struct TALER_MERCHANT_HttpResponse hr; - - union - { - - /** - * Data returned on #MHD_HTTP_OK. - */ - struct - { - - /** - * bank accounts of the merchant instance - */ - struct TALER_MERCHANT_AccountDetails ad; - - } ok; - } - details; -}; - - -/** - * Function called with the result of the GET /instances/$ID/accounts/$H_WIRE operation. - * - * @param cls closure - * @param igr response details - */ -typedef void -(*TALER_MERCHANT_AccountGetCallback)( - void *cls, - const struct TALER_MERCHANT_AccountGetResponse *igr); - - -/** - * Get the details on one of the accounts of an instance. Will connect to the - * merchant backend and obtain information about the account. The respective - * information will be passed to the @a cb once available. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param instance_id identity of the instance to get information about - * @param h_wire hash of the wire details - * @param cb function to call with the - * backend's instances information - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_AccountGetHandle * -TALER_MERCHANT_account_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *instance_id, - const struct TALER_MerchantWireHashP *h_wire, - TALER_MERCHANT_AccountGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /accounts/$H_WIRE request. Must not be called by clients after - * the callback was invoked. - * - * @param igh request to cancel. - */ -void -TALER_MERCHANT_account_get_cancel ( - struct TALER_MERCHANT_AccountGetHandle *igh); - - -/** - * Handle for a GET /accounts operation. - */ -struct TALER_MERCHANT_AccountsGetHandle; - -/** - * Individual account (minimal information - * returned via GET /accounts). - */ -struct TALER_MERCHANT_AccountEntry -{ - /** - * account payto URI. - */ - struct TALER_FullPayto payto_uri; - - /** - * Hash of @e payto_uri and salt. - */ - struct TALER_MerchantWireHashP h_wire; - -}; - - -/** - * Response to a GET /accounts operation. - */ -struct TALER_MERCHANT_AccountsGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @e accounts array - */ - unsigned int accounts_length; - - /** - * array of accounts the requested instance offers - */ - const struct TALER_MERCHANT_AccountEntry *accounts; - } ok; - } details; -}; - - -/** - * Function called with the result of the GET /accounts operation. - * - * @param cls closure - * @param tgr response details - */ -typedef void -(*TALER_MERCHANT_AccountsGetCallback)( - void *cls, - const struct TALER_MERCHANT_AccountsGetResponse *tgr); - - -/** - * Make a GET /accounts request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_AccountsGetHandle * -TALER_MERCHANT_accounts_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_AccountsGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /accounts operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_accounts_get_cancel ( - struct TALER_MERCHANT_AccountsGetHandle *tgh); - - -/** - * Handle for a PATCH /account operation. - */ -struct TALER_MERCHANT_AccountPatchHandle; - - -/** - * Function called with the result of the PATCH /account operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_AccountPatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a PATCH /accounts/$H_WIRE request to update account details. Cannot be used to change the payto URI or the salt. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param h_wire identifies the account to patch - * @param credit_facade_url credit facade for the account, can be NULL - * @param credit_facade_credentials credentials for credit facade, can be NULL - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_AccountPatchHandle * -TALER_MERCHANT_account_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const struct TALER_MerchantWireHashP *h_wire, - const char *credit_facade_url, - const json_t *credit_facade_credentials, - TALER_MERCHANT_AccountPatchCallback cb, - void *cb_cls); - - -/** - * Cancel PATCH /accounts/$H_WIRE operation. - * - * @param[in] tph operation to cancel - */ -void -TALER_MERCHANT_account_patch_cancel ( - struct TALER_MERCHANT_AccountPatchHandle *tph); - - -/** - * Handle for a DELETE /instances/$ID/account/$H_WIRE operation. - */ -struct TALER_MERCHANT_AccountDeleteHandle; - - -/** - * Response for a DELETE /instances/$ID/account operation. - */ -struct TALER_MERCHANT_AccountDeleteResponse -{ - /** - * HTTP response data - */ - struct TALER_MERCHANT_HttpResponse hr; -}; - - -/** - * Function called with the result of the DELETE /instances/$ID/account/$H_WIRE operation. - * - * @param cls closure - * @param par response data - */ -typedef void -(*TALER_MERCHANT_AccountDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_AccountDeleteResponse *par); - - -/** - * Remove bank account from an instance in the backend. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param h_wire wire hash of the bank accounts to delete - * @param cb function to call with the response - * @param cb_cls closure for @a config_cb - * @return the instances handle; NULL upon error - */ -struct TALER_MERCHANT_AccountDeleteHandle * -TALER_MERCHANT_account_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const struct TALER_MerchantWireHashP *h_wire, - TALER_MERCHANT_AccountDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel /account request. Must not be called by clients after - * the callback was invoked. - * - * @param pah request to cancel. - */ -void -TALER_MERCHANT_account_delete_cancel ( - struct TALER_MERCHANT_AccountDeleteHandle *pah); - - -/* ********************* /products *********************** */ - - -/** - * Handle for a GET /products operation. - */ -struct TALER_MERCHANT_ProductsGetHandle; - -/** - * Individual product from the inventory (minimal information - * returned via GET /products). - */ -struct TALER_MERCHANT_InventoryEntry -{ - /** - * Product identifier. - */ - const char *product_id; - - /** - * Serial ID of the product. - */ - uint64_t product_serial; -}; - - -/** - * Response to a GET /products request. - */ -struct TALER_MERCHANT_GetProductsResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - union - { - struct - { - - /** - * length of the @a products array - */ - unsigned int products_length; - - /** - * array of products the requested instance offers - */ - const struct TALER_MERCHANT_InventoryEntry *products; - } ok; - - } details; -}; - - -/** - * Function called with the result of the GET /products operation. - * - * @param cls closure - * @param gpr response details - */ -typedef void -(*TALER_MERCHANT_ProductsGetCallback)( - void *cls, - const struct TALER_MERCHANT_GetProductsResponse *gpr); - - -/** - * Make a GET /products request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend's inventory information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductsGetHandle * -TALER_MERCHANT_products_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_ProductsGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /products operation. - * - * @param pgh operation to cancel - */ -void -TALER_MERCHANT_products_get_cancel ( - struct TALER_MERCHANT_ProductsGetHandle *pgh); - - -/** - * Handle for a GET /product/$ID operation. Gets details - * about a single product. Do not confused with a - * `struct TALER_MERCHANT_ProductsGetHandle`, which - * obtains a list of all products. - */ -struct TALER_MERCHANT_ProductGetHandle; - - -/** - * Response to GET /product/$ID operation. - */ -struct TALER_MERCHANT_ProductGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - - /** - * description of the product - */ - const char *description; - - /** - * Map from IETF BCP 47 language tags to localized descriptions - */ - const json_t *description_i18n; - - /** - * unit in which the product is measured (liters, kilograms, packages, etc.) - */ - const char *unit; - - /** - * the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is - * not fixed and must be supplied by the front-end. If - * non-zero, price must include applicable taxes. - */ - struct TALER_Amount price; - - /** - * Optional list of price tiers as provided by the backend. - */ - const struct TALER_Amount *unit_price; - - /** - * Size of unit_price array - */ - size_t unit_price_len; - - /** - * base64-encoded product image, can be NULL if none is set. - */ - const char *image; - - /** - * list of taxes paid by the merchant, can be NULL if no taxes were specified. - */ - const json_t *taxes; - - /** - * total_stock in @e units, -1 to indicate "infinite" (i.e. electronic - * books), does NOT indicate remaining stocks, to get remaining stocks, - * subtract @e total_sold and @e total_lost. Note that this still does - * not then say how many of the remaining inventory are locked. - */ - int64_t total_stock; - - /** - * Set to true if fractional quantities are allowed for this product. - */ - bool unit_allow_fraction; - - /** - * Suggested fractional precision for fractional quantities. - */ - uint32_t unit_precision_level; - - /** - * Stock level encoded as a decimal string. Preferred source of truth for fractional stock. - */ - const char *unit_total_stock; - - /** - * in @e units, total number of @e unit of product sold - */ - uint64_t total_sold; - - /** - * in @e units, total number of @e unit of product lost from inventory - */ - uint64_t total_lost; - - /** - * where the product is in stock, can be NULL if no location was given. - */ - const json_t *location; - - /** - * when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for 'never'. - */ - struct GNUNET_TIME_Timestamp next_restock; - - /** - * name of the product - */ - const char *product_name; - } ok; - - } details; - -}; - - -/** - * Function called with the result of the GET /products operation. - * - * @param cls closure - * @param pgr response details - */ -typedef void -(*TALER_MERCHANT_ProductGetCallback)( - void *cls, - const struct TALER_MERCHANT_ProductGetResponse *pgr); - - -/** - * Make a GET /product/$ID request to get details about an - * individual product. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier of the product to inquire about - * @param cb function to call with the backend's product information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductGetHandle * -TALER_MERCHANT_product_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - TALER_MERCHANT_ProductGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /products/$ID operation. - * - * @param pgh operation to cancel - */ -void -TALER_MERCHANT_product_get_cancel ( - struct TALER_MERCHANT_ProductGetHandle *pgh); - - -/* ********************* /products/$HASH/image *********************** */ - - -/** - * Handle for a GET /products/$HASH/image operation. - */ -struct TALER_MERCHANT_ProductImageGetHandle; - - -/** - * Response to GET /products/$HASH/image operation. - */ -struct TALER_MERCHANT_ProductImageGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - /** - * Base64-encoded data URL containing the product image. - */ - const char *image; - } ok; - } details; -}; - - -/** - * Function called with the result of the GET /products/$HASH/image operation. - * - * @param cls closure - * @param pir response details - */ -typedef void -(*TALER_MERCHANT_ProductImageGetCallback)( - void *cls, - const struct TALER_MERCHANT_ProductImageGetResponse *pir); - - -/** - * Make a GET /products/$HASH/image request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param image_hash the image hash to fetch - * @param cb function to call with the backend's response - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductImageGetHandle * -TALER_MERCHANT_product_image_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *image_hash, - TALER_MERCHANT_ProductImageGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /products/$HASH/image operation. - * - * @param pigh operation to cancel - */ -void -TALER_MERCHANT_product_image_get_cancel ( - struct TALER_MERCHANT_ProductImageGetHandle *pigh); - - -/** - * Handle for a POST /products operation. - */ -struct TALER_MERCHANT_ProductsPostHandle; - - -/** - * Function called with the result of the POST /products operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_ProductsPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /products request to add a product to the - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier to use for the product - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books) - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for 'never'. - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductsPostHandle * -TALER_MERCHANT_products_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *price, - const char *image, - const json_t *taxes, - int64_t total_stock, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - TALER_MERCHANT_ProductsPostCallback cb, - void *cb_cls); - - -/** - * Make a POST /products request to add a product to the - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier to use for the product - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books) - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for 'never'. - * @param minimum_age minimum age the buyer must have - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductsPostHandle * -TALER_MERCHANT_products_post2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *price, - const char *image, - const json_t *taxes, - int64_t total_stock, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - uint32_t minimum_age, - TALER_MERCHANT_ProductsPostCallback cb, - void *cb_cls); - - -/** - * Make a POST /products request to add a product to the - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier to use for the product - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books) - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for 'never'. - * @param minimum_age minimum age the buyer must have - * @param num_cats length of the @a cats array - * @param cats array of categories the product is in - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductsPostHandle * -TALER_MERCHANT_products_post3 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *price, - const char *image, - const json_t *taxes, - int64_t total_stock, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - uint32_t minimum_age, - unsigned int num_cats, - const uint64_t *cats, - TALER_MERCHANT_ProductsPostCallback cb, - void *cb_cls); - - -/** - * Make a POST /products request to add a product to the - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier to use for the product - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param unit_prices array of price tiers (at least one entry) - * @param unit_price_len length of @a unit_prices - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock integer quantity to use when @a unit_allow_fraction is false; - * set to -1 for unlimited stock - * @param total_stock_frac fractional component (0-#TALER_MERCHANT_UNIT_FRAC_BASE) to use when - * @a unit_allow_fraction is true; ignored otherwise. Clients should use 0 - * when there is no fractional part or when @a total_stock is -1 (unlimited). - * @param unit_allow_fraction whether fractional quantity purchases are allowed - * @param unit_precision_level optional override for the fractional precision; pass NULL to use the default derived from @a unit - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown - * @param minimum_age minimum age the buyer must have - * @param num_cats length of the @a cats array - * @param cats array of categories the product is in - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductsPostHandle * -TALER_MERCHANT_products_post4 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *unit_prices, - size_t unit_price_len, - const char *image, - const json_t *taxes, - int64_t total_stock, - uint32_t total_stock_frac, - bool unit_allow_fraction, - const uint32_t *unit_precision_level, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - uint32_t minimum_age, - unsigned int num_cats, - const uint64_t *cats, - TALER_MERCHANT_ProductsPostCallback cb, - void *cb_cls); - -/** - * Response from a POST /private/categories request. - */ -struct TALER_MERCHANT_CategoriesPostResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Category id on success. - */ - uint64_t category_id; -}; - -/** - * Callback for POST /private/categories. - * - * @param cls closure - * @param cpr response details - */ -typedef void -(*TALER_MERCHANT_CategoriesPostCallback)( - void *cls, - const struct TALER_MERCHANT_CategoriesPostResponse *cpr); - -/** - * Handle for a POST /private/categories operation. - */ -struct TALER_MERCHANT_CategoriesPostHandle; - -/** - * Make a POST /private/categories request to add a category. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param name category name - * @param name_i18n Map from IETF BCP 47 language tags to localized names - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_CategoriesPostHandle * -TALER_MERCHANT_categories_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *name, - const json_t *name_i18n, - TALER_MERCHANT_CategoriesPostCallback cb, - void *cb_cls); - -/** - * Cancel POST /private/categories operation. - * - * @param cph operation to cancel - */ -void -TALER_MERCHANT_categories_post_cancel ( - struct TALER_MERCHANT_CategoriesPostHandle *cph); - - -/** - * Cancel POST /products operation. - * - * @param pph operation to cancel - */ -void -TALER_MERCHANT_products_post_cancel ( - struct TALER_MERCHANT_ProductsPostHandle *pph); - - -/** - * Handle for a PATCH /products operation. - */ -struct TALER_MERCHANT_ProductPatchHandle; - - -/** - * Function called with the result of the PATCH /products operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_ProductPatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a PATCH /products request to update product details in the - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier to use for the product; the product must exist, - * or the transaction will fail with a #MHD_HTTP_NOT_FOUND - * HTTP status code - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books), - * must be larger than previous values - * @param total_lost in @a units, must be larger than previous values, and may - * not exceed total_stock minus total_sold; if it does, the transaction - * will fail with a #MHD_HTTP_CONFLICT HTTP status code - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductPatchHandle * -TALER_MERCHANT_product_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *price, - const char *image, - const json_t *taxes, - int64_t total_stock, - uint64_t total_lost, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - TALER_MERCHANT_ProductPatchCallback cb, - void *cb_cls); - - -/** - * Make a PATCH /products request to update a product using the - * extended inventory fields. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier of the product to modify - * @param description description of the product - * @param description_i18n localized descriptions - * @param unit sales unit - * @param unit_prices array of price tiers (at least one entry) - * @param unit_price_len number of entries in @a unit_prices - * @param image base64-encoded image - * @param taxes list of taxes - * @param total_stock integer quantity when @a unit_allow_fraction is false - * @param total_stock_frac fractional quantity component (0-#TALER_MERCHANT_UNIT_FRAC_BASE) when - * @a unit_allow_fraction is true; ignored otherwise - * @param unit_allow_fraction whether fractional quantity purchases are allowed - * @param unit_precision_level optional override for the fractional precision; pass NULL to use the default derived from @a unit - * @param total_lost stock lost so far - * @param address inventory address - * @param next_restock expected restock date - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductPatchHandle * -TALER_MERCHANT_product_patch2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *description, - const json_t *description_i18n, - const char *unit, - const struct TALER_Amount *unit_prices, - size_t unit_price_len, - const char *image, - const json_t *taxes, - int64_t total_stock, - uint32_t total_stock_frac, - bool unit_allow_fraction, - const uint32_t *unit_precision_level, - uint64_t total_lost, - const json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - TALER_MERCHANT_ProductPatchCallback cb, - void *cb_cls); - - -/** - * Cancel PATCH /products operation. - * - * @param pph operation to cancel - */ -void -TALER_MERCHANT_product_patch_cancel ( - struct TALER_MERCHANT_ProductPatchHandle *pph); - - -/** - * Handle for a POST /products/$ID/lock operation. - */ -struct TALER_MERCHANT_ProductLockHandle; - - -/** - * Function called with the result of the POST /product/$ID/lock operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_ProductLockCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /products/$ID/lock request to reserve a certain - * amount of product in inventory to a reservation UUID. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier of the product - * @param uuid UUID that identifies the client holding the lock - * @param duration how long should the lock be held - * @param quantity how much product should be locked (integer part) - * @param quantity_frac fractional component to lock when - * @a use_fractional_quantity is true; value is expressed in units of - * 1/1000000 of the base unit - * @param use_fractional_quantity set to true when @a quantity_frac is used - * @param cb function to call with the backend's lock status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductLockHandle * -TALER_MERCHANT_product_lock2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *uuid, - struct GNUNET_TIME_Relative duration, - uint64_t quantity, - uint32_t quantity_frac, - bool use_fractional_quantity, - TALER_MERCHANT_ProductLockCallback cb, - void *cb_cls); - - -/** - * Legacy helper that locks products using integer quantities only. - * Prefer using #TALER_MERCHANT_product_lock2 for fractional quantities. - */ -struct TALER_MERCHANT_ProductLockHandle * -TALER_MERCHANT_product_lock ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - const char *uuid, - struct GNUNET_TIME_Relative duration, - uint32_t quantity, - TALER_MERCHANT_ProductLockCallback cb, - void *cb_cls); - - -/** - * Cancel POST /products/$ID/lock operation. Note that the - * lock may or may not be acquired despite the cancellation. - * - * @param plh operation to cancel - */ -void -TALER_MERCHANT_product_lock_cancel ( - struct TALER_MERCHANT_ProductLockHandle *plh); - - -/** - * Handle for a DELETE /products/$ID operation. - */ -struct TALER_MERCHANT_ProductDeleteHandle; - - -/** - * Function called with the result of the DELETE /product/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_ProductDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a DELETE /products/$ID request to delete a product from our - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param product_id identifier of the product - * @param cb function to call with the backend's deletion status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_ProductDeleteHandle * -TALER_MERCHANT_product_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *product_id, - TALER_MERCHANT_ProductDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE /products/$ID operation. - * - * @param pdh operation to cancel - */ -void -TALER_MERCHANT_product_delete_cancel ( - struct TALER_MERCHANT_ProductDeleteHandle *pdh); - - -/* ********************* /tokenfamilies ************************** */ - -/** - * Handle for a GET /tokenfamilies/$SLUG operation. - */ -struct TALER_MERCHANT_TokenFamilyGetHandle; - - -/** - * Response to GET /tokenfamilies/$SLUG operation. - */ -struct TALER_MERCHANT_TokenFamilyGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - - /** - * Identifier for the token family consisting of unreserved characters - * according to RFC 3986. - */ - const char *slug; - - /** - * Human-readable name for the token family. - */ - const char *name; - - /** - * description of the token family - */ - const char *description; - - /** - * Optional map from IETF BCP 47 language tags to localized descriptions. - */ - const json_t *description_i18n; - - /** - * Additional data about the token family (such as expected_domains). - */ - const json_t *extra_data; - - /** - * Start time of the token family's validity period. - */ - struct GNUNET_TIME_Timestamp valid_after; - - /** - * End time of the token family's validity period. - */ - struct GNUNET_TIME_Timestamp valid_before; - - /** - * Validity duration of an issued token. - */ - struct GNUNET_TIME_Relative duration; - - /** - * Granularity of the validity periods of the token. - */ - struct GNUNET_TIME_Relative validity_granularity; - - /** - * Offset subtracted from the rounded start time to determine - * the actual start time. - */ - struct GNUNET_TIME_Relative start_offset; - - /** - * Kind of token family, "subscription" or "discount". - */ - const char *kind; - - /** - * How many tokens have been issued for this family. - */ - uint64_t issued; - - /** - * How many tokens have been used for this family. - */ - uint64_t used; - } ok; - - } details; - -}; - -/** - * Cancel GET /tokenfamilies/$SLUG operation. - * - * @param handle operation to cancel - */ -void -TALER_MERCHANT_token_family_get_cancel ( - struct TALER_MERCHANT_TokenFamilyGetHandle *handle); - - -/** - * Function called with the result of the GET /tokenfamilies/$SLUG operation. - * - * @param cls closure - * @param pgr response details - */ -typedef void -(*TALER_MERCHANT_TokenFamilyGetCallback)( - void *cls, - const struct TALER_MERCHANT_TokenFamilyGetResponse *pgr); - -/** - * Handle for a POST /tokenfamilies operation. - */ -struct TALER_MERCHANT_TokenFamiliesPostHandle; - - -/** - * Function called with the result of the POST /tokenfamilies operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TokenFamiliesPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /tokenfamilies request to add a token family to the - * merchant instance. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param slug short, url-safe identifier for the token family - * @param name human-readable name for the token family - * @param description description of the token family - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param extra_data additional meta-data about the token family - * @param valid_after when the token family becomes valid - * @param valid_before when the token family expires - * @param duration how long tokens issued by this token family are valid for - * @param validity_granularity rounding duration of token family - * @param start_offset time to subtract after rounding down to get - * the actual start time for each round - * @param kind kind of token family, "subscription" or "discount" - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TokenFamiliesPostHandle * -TALER_MERCHANT_token_families_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *slug, - const char *name, - const char *description, - const json_t *description_i18n, - const json_t *extra_data, - struct GNUNET_TIME_Timestamp valid_after, - struct GNUNET_TIME_Timestamp valid_before, - struct GNUNET_TIME_Relative duration, - struct GNUNET_TIME_Relative validity_granularity, - struct GNUNET_TIME_Relative start_offset, - const char *kind, - TALER_MERCHANT_TokenFamiliesPostCallback cb, - void *cb_cls); - - -/** - * Cancel POST /tokenfamilies operation. - * - * @param handle operation to cancel - */ -void -TALER_MERCHANT_token_families_post_cancel ( - struct TALER_MERCHANT_TokenFamiliesPostHandle *handle); - - -/* FIXME: token_families_patch API is missing... */ - - -/* ********************* /orders ************************** */ - - -/** - * Handle to a POST /private/orders operation - */ -struct TALER_MERCHANT_PostOrdersHandle; - - -/** - * Possible details from a reply to POST /private/orders. - */ -struct TALER_MERCHANT_PostOrdersReply -{ - - /** - * HTTP response details. HTTP status code - * determines what parts of @e details are valid. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details of the reply, depending on the HTTP - * status code. - */ - union - { - - /** - * Details provided if the @e hr.http_status is - * #MHD_HTTP_OK and the order was created. - */ - struct - { - - /** - * order id of the newly created order - */ - const char *order_id; - - /** - * the claim token generated by the merchant, - * (NULL if it was NOT generated). - */ - const struct TALER_ClaimTokenP *token; - - /** - * When will the order have to be paid? - * Note: only available since protocol v21, - * will be zero if server is older. - */ - struct GNUNET_TIME_Timestamp pay_deadline; - - } ok; - - /** - * Details provided if the @e hr.http_status is - * #MHD_HTTP_GONE because a product was out of stock. - */ - struct - { - /** - * ID of the product of the order that is out of - * stock. - */ - const char *product_id; - - /** - * How many units were requested by the order. - */ - uint64_t requested_quantity; - - /** - * Fractional component of the requested quantity in units of - * 1/#TALER_AMOUNT_FRAC_BASE. Absent or zero when the request did not - * include a fractional part. - */ - uint32_t requested_quantity_frac; - - /** - * How many units are actually still in stock. - */ - uint64_t available_quantity; - - /** - * Fractional component of the available quantity in units of - * 1/#TALER_AMOUNT_FRAC_BASE. - */ - uint32_t available_quantity_frac; - - /** - * When does the backend expect the stock to be - * restocked? 0 for unknown. - */ - struct GNUNET_TIME_Timestamp restock_expected; - - } gone; - - } details; - -}; - - -/** - * Callbacks of this type are used to serve the result of submitting a - * POST /using-templates and POST /orders request to a merchant. - * - * @param cls closure - * @param por response details - */ -typedef void -(*TALER_MERCHANT_PostOrdersCallback) ( - void *cls, - const struct TALER_MERCHANT_PostOrdersReply *por); - - -/** - * POST to /orders at the backend to setup an order and obtain - * the order ID (which may have been set by the front-end). - * - * @param ctx execution context - * @param backend_url URL of the backend - * @param order basic information about this purchase, to be extended by the backend - * @param refund_delay how long can refunds happen for this order; 0 to use - * absolute value from contract (or not allow refunds). - * @param cb the callback to call when a reply for this request is available - * @param cb_cls closure for @a cb - * @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); - -/** - * Information needed per product for constructing orders from - * the inventory. - */ -struct TALER_MERCHANT_InventoryProduct -{ - - /** - * Identifier of the product. - */ - char *product_id; - - /** - * How many units of this product should be ordered. - */ - uint64_t quantity; - - /** - * Fractional component of the quantity in units of 1/1000000 of the - * base value. - */ - uint32_t quantity_frac; - - /** - * Set to true if this product uses fractional quantity fields. - */ - bool use_fractional_quantity; -}; - - -/** - * POST to /orders at the backend to setup an order and obtain - * the order ID (which may have been set by the front-end). - * - * @param ctx execution context - * @param backend_url URL of the backend - * @param order basic information about this purchase, to be extended by the backend - * @param refund_delay how long can refunds happen for this order; 0 to use - * absolute value from contract (or not allow refunds). - * @param payment_target desired payment target identifier (to select merchant bank details) - * @param inventory_products_length length of the @a inventory_products array - * @param inventory_products products to add to the order from the inventory - * @param uuids_length length of the @a uuids array - * @param uuids array of UUIDs with locks on @a inventory_products - * @param create_token whether to create a claim token - * @param cb the callback to call when a reply for this request is available - * @param cb_cls closure for @a cb - * @return a handle for this request, NULL on error - */ -struct TALER_MERCHANT_PostOrdersHandle * -TALER_MERCHANT_orders_post2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const json_t *order, - struct GNUNET_TIME_Relative refund_delay, - const char *payment_target, - unsigned int inventory_products_length, - const struct TALER_MERCHANT_InventoryProduct inventory_products[], - unsigned int uuids_length, - const char *uuids[static uuids_length], - bool create_token, - TALER_MERCHANT_PostOrdersCallback cb, - void *cb_cls); - - -/** - * POST to /orders at the backend to setup an order and obtain - * the order ID (which may have been set by the front-end). - * - * @param ctx execution context - * @param backend_url URL of the backend - * @param order basic information about this purchase, to be extended by the backend - * @param session_id session ID to set for the order - * @param refund_delay how long can refunds happen for this order; 0 to use - * absolute value from contract (or not allow refunds). - * @param payment_target desired payment target identifier (to select merchant bank details) - * @param inventory_products_length length of the @a inventory_products array - * @param inventory_products products to add to the order from the inventory - * @param uuids_length length of the @a uuids array - * @param uuids array of UUIDs with locks on @a inventory_products - * @param create_token whether to create a claim token - * @param cb the callback to call when a reply for this request is available - * @param cb_cls closure for @a cb - * @return a handle for this request, NULL on error - */ -struct TALER_MERCHANT_PostOrdersHandle * -TALER_MERCHANT_orders_post3 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const json_t *order, - const char *session_id, - struct GNUNET_TIME_Relative refund_delay, - const char *payment_target, - unsigned int inventory_products_length, - const struct TALER_MERCHANT_InventoryProduct inventory_products[], - unsigned int uuids_length, - const char *uuids[static uuids_length], - bool create_token, - TALER_MERCHANT_PostOrdersCallback cb, - void *cb_cls); - - -/** - * Cancel a POST /orders request. This function cannot be used - * on a request handle if a response is already served for it. - * - * @param[in] po the proposal operation request handle - */ -void -TALER_MERCHANT_orders_post_cancel ( - struct TALER_MERCHANT_PostOrdersHandle *po); - - -/** - * Handle for a GET /orders operation. - */ -struct TALER_MERCHANT_OrdersGetHandle; - -/** - * Individual order (minimal information returned via GET /orders). - */ -struct TALER_MERCHANT_OrderEntry -{ - /** - * Order identifier. - */ - const char *order_id; - - /** - * Time when the order was created. Useful for filtering by - * 'date' (in #TALER_MERCHANT_orders_get2()). - */ - struct GNUNET_TIME_Timestamp timestamp; - - /** - * Serial ID of the order. Useful for filtering by 'start_row' - * (in #TALER_MERCHANT_orders_get2()). - */ - uint64_t order_serial; - - /** - * The amount of the order. - */ - struct TALER_Amount amount; - - /** - * The summary of the order. - */ - const char *summary; - - /** - * Whether it is possible to refund a part of the order still. - */ - bool refundable; - - /** - * Whether the order has been paid. - */ - bool paid; - - /** - * Total amount of refunds granted (but not necessarily - * accepted by the wallet). Only set if @e paid, otherwise - * set to an invalid amount! - */ - struct TALER_Amount refund_amount; - - /** - * Total amount of refunds pending (wallet did not pick them up). - * Only set if @e paid, otherwise set to an invalid amount! - */ - struct TALER_Amount pending_refund_amount; - -}; - - -/** - * Response for a GET /private/orders request. - */ -struct TALER_MERCHANT_OrdersGetResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - - /** - * length of the @e orders array - */ - unsigned int orders_length; - - /** - * array of orders the requested instance has made - */ - const struct TALER_MERCHANT_OrderEntry *orders; - } ok; - } details; - -}; - - -/** - * Function called with the result of the GET /orders operation. - * - * @param cls closure - * @param ogr response details - */ -typedef void -(*TALER_MERCHANT_OrdersGetCallback)( - void *cls, - const struct TALER_MERCHANT_OrdersGetResponse *ogr); - - -/** - * Make a GET /orders request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend's inventory information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OrdersGetHandle * -TALER_MERCHANT_orders_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_OrdersGetCallback cb, - void *cb_cls); - - -/** - * Make a GET /orders request with filters. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param paid filter on payment status - * @param refunded filter on refund status - * @param wired filter on wire transfer status - * @param date range limit by date - * @param start_row range limit by order table row - * @param delta range from which @a date and @a start_row apply, positive - * to return delta items after the given limit(s), negative to - * return delta items before the given limit(s) - * @param timeout how long to wait (long polling) of zero results match the query - * @param cb function to call with the backend's inventory information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OrdersGetHandle * -TALER_MERCHANT_orders_get2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - enum TALER_EXCHANGE_YesNoAll paid, - enum TALER_EXCHANGE_YesNoAll refunded, - enum TALER_EXCHANGE_YesNoAll wired, - struct GNUNET_TIME_Timestamp date, - uint64_t start_row, - int64_t delta, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_OrdersGetCallback cb, - void *cb_cls); - - -/** - * Make a GET /orders request with more filters. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param paid filter on payment status - * @param refunded filter on refund status - * @param wired filter on wire transfer status - * @param session_id filter by session ID - * @param fulfillment_url filter by fulfillment URL - * @param date range limit by date - * @param start_row range limit by order table row - * @param delta range from which @a date and @a start_row apply, positive - * to return delta items after the given limit(s), negative to - * return delta items before the given limit(s) - * @param timeout how long to wait (long polling) of zero results match the query - * @param cb function to call with the backend's inventory information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OrdersGetHandle * -TALER_MERCHANT_orders_get3 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - enum TALER_EXCHANGE_YesNoAll paid, - enum TALER_EXCHANGE_YesNoAll refunded, - enum TALER_EXCHANGE_YesNoAll wired, - const char *session_id, - const char *fulfillment_url, - struct GNUNET_TIME_Timestamp date, - uint64_t start_row, - int64_t delta, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_OrdersGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /orders operation. - * - * @param[in] pgh operation to cancel - */ -void -TALER_MERCHANT_orders_get_cancel ( - struct TALER_MERCHANT_OrdersGetHandle *pgh); - - -/** - * Handle for a GET /orders/$ID operation. (Wallet's public endpoint, - * not to be confused with the private endpoint for the merchant.) - */ -struct TALER_MERCHANT_OrderWalletGetHandle; - - -/** - * Response to a GET /orders/$ID request. - */ -struct TALER_MERCHANT_OrderWalletGetResponse -{ - /** - * Full HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Response details depending on the HTTP status. - */ - union - { - /** - * Response details if the response code is #MHD_HTTP_OK. - */ - struct - { - - /** - * True if there is at least on refund on this payment. - */ - bool refunded; - - /** - * True if there are refunds waiting to be - * obtained. - */ - bool refund_pending; - - /** - * Amount that was refunded, only set if - * @e refunded is #GNUNET_YES. - */ - struct TALER_Amount refund_amount; - - } ok; - - /** - * Response if a payment is required from the client. - */ - struct - { - - /** - * The URI that instructs the wallet to process - * the payment. - */ - const char *taler_pay_uri; - - /** - * Equivalent order that this customer paid already, or NULL for none. - */ - const char *already_paid_order_id; - - } payment_required; - - } details; -}; - - -/** - * Callback to process a GET /orders/$ID response - * - * @param cls closure - * @param owgs HTTP response details - */ -typedef void -(*TALER_MERCHANT_OrderWalletGetCallback) ( - void *cls, - const struct TALER_MERCHANT_OrderWalletGetResponse *owgs); - - -/** - * Checks the status of a payment. Issue a GET /orders/$ID request to the - * backend. The @a h_contract serves as identification of the wallet and is - * used to authorize the request. - * - * @param ctx execution context - * @param backend_url base URL of the merchant backend - * @param order_id order id to identify the payment - * @param h_contract hash of the contract to authenticate the wallet - * @param timeout timeout to use in long polling (how long may the server wait to reply - * before generating an unpaid response). Note that this is just provided to - * the server, we as client will block until the response comes back or until - * #TALER_MERCHANT_wallet_order_get_cancel() is called. - * @param session_id for which session should the payment status be checked. Use - * NULL to disregard sessions. - * @param min_refund long poll for the service to approve a refund exceeding this value; - * use NULL to not wait for any refund (only for payment). Only makes sense - * with a non-zero @a timeout. Can be NULL. - * @param await_refund_obtained long poll for the order's refunds to be - * picked up by the wallet. - * @param cb callback which will work the response gotten from the backend - * @param cb_cls closure to pass to @a cb - * @return handle for this operation, NULL upon errors - */ -struct TALER_MERCHANT_OrderWalletGetHandle * -TALER_MERCHANT_wallet_order_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *order_id, - const struct TALER_PrivateContractHashP *h_contract, - struct GNUNET_TIME_Relative timeout, - const char *session_id, - const struct TALER_Amount *min_refund, - bool await_refund_obtained, - TALER_MERCHANT_OrderWalletGetCallback cb, - void *cb_cls); - -/** - * Cancel a GET /orders/$ID request. - * - * @param[in] owgh handle to the request to be canceled - */ -void -TALER_MERCHANT_wallet_order_get_cancel ( - struct TALER_MERCHANT_OrderWalletGetHandle *owgh); - - -/** - * Handle for a GET /private/orders/$ID operation (merchant's internal - * API, not to be confused with the endpoint for wallets). - */ -struct TALER_MERCHANT_OrderMerchantGetHandle; - - -/** - * Details about a wire transfer to the merchant related to the order. - */ -struct TALER_MERCHANT_WireTransfer -{ - /** - * Base URL of the exchange that made the transfer. - */ - const char *exchange_url; - - /** - * When the transfer took place (note: may not be exact, - * as the time at which the exchange initiated the transfer - * may differ from the time the bank or the merchant observed). - * Zero if not known. - */ - struct GNUNET_TIME_Timestamp execution_time; - - /** - * Wire transfer subject. - */ - struct TALER_WireTransferIdentifierRawP wtid; - - /** - * Total amount that was transferred. - */ - struct TALER_Amount total_amount; - - /** - * Whether this transfer was confirmed by the merchant using - * the POST /transfers API, or whether it was merely claimed - * by the exchange. - */ - bool confirmed; -}; - - -/** - * Details about a failures returned by the exchange when - * tracking wire transfers. - */ -struct TALER_MERCHANT_WireReport -{ - - /** - * Error code explaining the nature of the problem. - */ - enum TALER_ErrorCode code; - - /** - * Human-readable error description. - */ - const char *hint; - - /** - * Public key of the coin involved. - */ - struct TALER_CoinSpendPublicKeyP coin_pub; - - /** - * HTTP response data from the exchange (fields are MAY BE NULL or 0 if not - * available). - */ - struct TALER_EXCHANGE_HttpResponse hr; - -}; - - -/** - * Detail returned by the merchant backend about refunds. - */ -struct TALER_MERCHANT_RefundOrderDetail -{ - - /** - * Human-readable reason given for the refund. - */ - const char *reason; - - /** - * Time when the refund was granted. - */ - struct GNUNET_TIME_Timestamp refund_time; - - /** - * Total amount that was refunded. - */ - struct TALER_Amount refund_amount; - -}; - - -/** - * Status of an order. - */ -enum TALER_MERCHANT_OrderStatusCode -{ - /** - * The order was paid. - */ - TALER_MERCHANT_OSC_PAID = 1, - - /** - * The order was claimed but not yet paid. - */ - TALER_MERCHANT_OSC_CLAIMED = 2, - - /** - * The order was never paid or claimed. - */ - TALER_MERCHANT_OSC_UNPAID = 3 -}; - - -/** - * Details about the status of an order. - */ -struct TALER_MERCHANT_OrderStatusResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details provided depending on the HTTP status code. - */ - union - { - /** - * Details provided if the HTTP status is #MHD_HTTP_OK. - */ - struct - { - - /** - * Status of the order. - */ - enum TALER_MERCHANT_OrderStatusCode status; - - /** - * Details depending on the payment status given in @e status. - */ - union - { - - /** - * Details provided if @e status is #TALER_MERCHANT_OSC_PAID. - */ - struct - { - /** - * Amount that was refunded. - */ - struct TALER_Amount refund_amount; - - /** - * Amount that was deposited into our bank account, - * excluding fees. - */ - struct TALER_Amount deposit_total; - - /** - * The full contract terms of the order. - */ - const json_t *contract_terms; - - /** - * Array of wire transfers made for this payment to the - * merchant by the exchange. Of length @e wts_len. - */ - struct TALER_MERCHANT_WireTransfer *wts; - - /** - * Length of the @e wts array. - */ - unsigned int wts_len; - - /** - * Details returned by the merchant backend about refunds. - * Of length @e refunds_len. - */ - struct TALER_MERCHANT_RefundOrderDetail *refunds; - - /** - * Length of the @e refunds array. - */ - unsigned int refunds_len; - - /** - * Error code encountered trying to contact the exchange - * about the wire tracking, 0 for none. - */ - enum TALER_ErrorCode exchange_ec; - - /** - * HTTP status code encountered trying to contact the exchange - * about the wire tracking, 0 for no error. - */ - unsigned int exchange_hc; - - /** - * true if there is at least on refund on this payment, - * false if there are no refunds. - */ - bool refunded; - - /** - * true if refunds were approved that have not yet been obtained - * by the wallet. - */ - bool refund_pending; - - /** - * true if the exchange paid the merchant for this order, - * false if not. - */ - bool wired; - - /** - * Time of the last payment made on this order. - * Only available if the server supports protocol - * **v14** or higher, otherwise zero. - */ - struct GNUNET_TIME_Timestamp last_payment; - } paid; - - /** - * Details provided if @e status is #TALER_MERCHANT_OSC_CLAIMED. - */ - struct - { - - /** - * The full contract terms of the claimed order (including client nonce from claiming). - */ - const json_t *contract_terms; - - } claimed; - - /** - * Details provided if @e status is #TALER_MERCHANT_OSC_UNPAID. - */ - struct - { - - /** - * URI that should be shown to the wallet to trigger a payment. - */ - const char *taler_pay_uri; - - /** - * Alternative order ID which was paid for already in the same session. - * Only given if the same product was purchased before in the same session. - * Otherwise NULL. - */ - const char *already_paid_order_id; - - /** - * Order summary. - */ - const char *summary; - - /** - * Time when the order was created. - */ - struct GNUNET_TIME_Timestamp creation_time; - - /** - * Total amount the order is about (amount to be paid by customer). - */ - struct TALER_Amount contract_amount; - - } unpaid; - - } details; - - } ok; - - } details; -}; - - -/** - * Callback to process a GET /orders/$ID request - * - * @param cls closure - * @param osr order status response details - */ -typedef void -(*TALER_MERCHANT_OrderMerchantGetCallback) ( - void *cls, - const struct TALER_MERCHANT_OrderStatusResponse *osr); - - -/** - * Checks the status of a payment. Issue a GET /private/orders/$ID request to - * the backend. - * - * @param ctx execution context - * @param backend_url base URL of the merchant backend - * @param order_id order id to identify the payment - * @param session_id session id for the payment (or NULL if the check is not - * bound to a session) - * @param timeout timeout to use in long polling (how long may the server wait to reply - * before generating an unpaid response). Note that this is just provided to - * the server, we as client will block until the response comes back or until - * #TALER_MERCHANT_merchant_order_get_cancel() is called. - * @param cb callback which will work the response gotten from the backend - * @param cb_cls closure to pass to @a cb - * @return handle for this operation, NULL upon errors - */ -struct TALER_MERCHANT_OrderMerchantGetHandle * -TALER_MERCHANT_merchant_order_get (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *order_id, - const char *session_id, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_OrderMerchantGetCallback cb, - void *cb_cls); - - -/** - * Cancel a GET /private/orders/$ID request. - * - * @param[in] omgh handle to the request to be canceled - */ -void -TALER_MERCHANT_merchant_order_get_cancel ( - struct TALER_MERCHANT_OrderMerchantGetHandle *omgh); - - -/** - * Handle for a DELETE /orders/$ID operation. - */ -struct TALER_MERCHANT_OrderDeleteHandle; - - -/** - * Function called with the result of the DELETE /orders/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OrderDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a DELETE /orders/$ID request to delete a order from our - * inventory. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param order_id identifier of the order - * @param force force deletion of claimed (but unpaid) orders - * @param cb function to call with the backend's deletion status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OrderDeleteHandle * -TALER_MERCHANT_order_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *order_id, - bool force, - TALER_MERCHANT_OrderDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE /orders/$ID operation. - * - * @param[in] odh operation to cancel - */ -void -TALER_MERCHANT_order_delete_cancel ( - struct TALER_MERCHANT_OrderDeleteHandle *odh); - - -/** - * Handle to a POST /orders/$ID/claim handle - */ -struct TALER_MERCHANT_OrderClaimHandle; - - -/** - * Response to a POST /orders/$ID/claim request. - */ -struct TALER_MERCHANT_OrderClaimResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - /** - * the details of the contract - */ - const json_t *contract_terms; - - /** - * merchant's signature over @e contract_terms (already verified) - */ - struct TALER_MerchantSignatureP sig; - - /** - * hash over @e contract_terms (computed client-side to verify @e sig) - */ - struct TALER_PrivateContractHashP h_contract_terms; - } ok; - - } details; -}; - -/** - * Callback called to process a POST /orders/$ID/claim response. - * - * @param cls closure - * @param ocr response details - */ -typedef void -(*TALER_MERCHANT_OrderClaimCallback) ( - void *cls, - const struct TALER_MERCHANT_OrderClaimResponse *ocr); - - -/** - * Calls the POST /orders/$ID/claim API at the backend. That is, - * retrieve the final contract terms including the client nonce. - * - * This is a PUBLIC API for wallets. - * - * @param ctx execution context - * @param backend_url base URL of the merchant backend - * @param order_id order id used to perform the lookup - * @param nonce nonce to use to claim the proposal - * @param claim_token the token used to verify the claim (NULL for none) - * @param cb callback which will work the response gotten from the backend - * @param cb_cls closure to pass to @a cb - * @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); - - -/** - * Cancel a POST /order/$ID/claim request. - * - * @param[in] och handle to the request to be canceled - */ -void -TALER_MERCHANT_order_claim_cancel (struct TALER_MERCHANT_OrderClaimHandle *och); - - -/** - * All the details about a token that are generated during issuance and - * that may be needed for future operations on the coin. - */ -struct TALER_MERCHANT_PrivateTokenDetails -{ - - /** - * Master secret used to derive the private key from. - */ - struct TALER_TokenUseMasterSecretP master; - - /** - * Private key of the token. - */ - struct TALER_TokenUsePrivateKeyP token_priv; - - /** - * Public key of the token. - */ - struct TALER_TokenUsePublicKeyP token_pub; - - /** - * Public key of the token. - */ - struct TALER_TokenUsePublicKeyHashP h_token_pub; - - /** - * Blinded public key of the token. - */ - struct TALER_TokenEnvelope envelope; - - /** - * Value used to blind the key for the signature. - */ - union GNUNET_CRYPTO_BlindingSecretP blinding_secret; - - /** - * Inputs needed from the merchant for blind signing. - */ - struct TALER_TokenUseMerchantValues blinding_inputs; - - /** - * Token issue public key. - */ - struct TALER_TokenIssuePublicKey issue_pub; - - /** - * Unblinded token issue signature made by the merchant. - */ - struct TALER_TokenIssueSignature issue_sig; - - /** - * Blinded token issue signature made by the merchant. - */ - struct TALER_BlindedTokenIssueSignature blinded_sig; - -}; - -/** - * @brief Handle to a POST /orders/$ID/pay operation at a merchant. Note that - * we use the same handle for interactions with frontends (API for wallets) or - * backends (API for frontends). The difference is that for the frontend API, - * we need the private keys of the coins, while for the backend API we need - * the public keys and signatures received from the wallet. - */ -struct TALER_MERCHANT_OrderPayHandle; - - -/** - * Information returned in response to a payment. - */ -struct TALER_MERCHANT_PayResponse -{ - - /** - * General HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details returned depending on @e hr. - */ - union - { - - /** - * Details returned on success. - */ - struct - { - - /** - * Signature affirming that the order was paid. - */ - struct TALER_MerchantSignatureP merchant_sig; - - /** - * Optional payment confirmation code returned by the service. - */ - const char *pos_confirmation; - - /** - * Array of tokens that were issued for the payment. - */ - struct TALER_MERCHANT_OutputToken *tokens; - - /** - * Length of the @e tokens array. - */ - unsigned int num_tokens; - - } ok; - - // TODO: might want to return further details on errors, - // especially refund signatures on double-pay conflict. - - struct - { - - /** - * Array of exchange URLs which had legal problems. - */ - const char **exchanges; - - /** - * Length of the @e exchanges array. - */ - unsigned int num_exchanges; - - } unavailable_for_legal_reasons; - - } details; - -}; - - -/** - * Callbacks of this type are used to serve the result of submitting a - * POST /orders/$ID/pay request to a merchant. - * - * @param cls closure - * @param pr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OrderPayCallback) ( - void *cls, - const struct TALER_MERCHANT_PayResponse *pr); - - -/** - * Information we need from the frontend (ok, the frontend sends just JSON) - * when forwarding a payment to the backend. - */ -struct TALER_MERCHANT_PaidCoin -{ - /** - * Denomination key with which the coin is signed - */ - struct TALER_DenominationPublicKey denom_pub; - - /** - * Exchange’s unblinded signature of the coin - */ - struct TALER_DenominationSignature denom_sig; - - /** - * Overall value that coins of this @e denom_pub have. - */ - struct TALER_Amount denom_value; - - /** - * Coin's public key. - */ - struct TALER_CoinSpendPublicKeyP coin_pub; - - /** - * Coin's signature key. - */ - struct TALER_CoinSpendSignatureP coin_sig; - - /** - * Amount this coin contributes to (including fee). - */ - struct TALER_Amount amount_with_fee; - - /** - * Amount this coin contributes to (without fee). - */ - struct TALER_Amount amount_without_fee; - - /** - * What is the URL of the exchange that issued @a coin_pub? - */ - const char *exchange_url; - -}; - - -/** - * Information the frontend forwards to the backend to use a token for - * an order. Note that this does not include the token use private key, - * but only public keys and signatures. - */ -struct TALER_MERCHANT_UsedToken -{ - - /** - * Signature on TALER_TokenUseRequestPS made with the token use private key. - */ - struct TALER_TokenUseSignatureP token_sig; - - /** - * Public key of the token. This was blindly signed by the merchant - * during the issuance and is now being revealed to the merchant. - */ - struct TALER_TokenUsePublicKeyP token_pub; - - /** - * Unblinded signature made by the token issue public key of the merchant. - */ - struct TALER_TokenIssueSignature ub_sig; - - /** - * Token issue public key associated with this token. - */ - struct TALER_TokenIssuePublicKey issue_pub; - -}; - - -/** - * Information the frontend forwards to the backend for an output token. The - * blinded issue signature is set once the request return with an HTTP_OK. - * This does not include the blinding secret or any other private information. - */ -struct TALER_MERCHANT_OutputToken -{ - - /** - * Token envelope. - */ - struct TALER_TokenEnvelope envelope; - - /** - * Blinded issue signature made by the merchant. - */ - struct TALER_BlindedTokenIssueSignature blinded_sig; - -}; - - -/** - * Pay a merchant. API for frontends talking to backends. Here, - * the frontend does not have the coin's private keys, but just - * the public keys and signatures. - * - * This is a PUBLIC API, albeit in this form useful for the frontend, - * in case the frontend is proxying the request. - * - * @param ctx execution context - * @param merchant_url base URL of the merchant - * @param order_id which order should be paid - * @param session_id session to pay for, or NULL for none - * @param wallet_data inputs from the wallet for the contract, NULL for none - * @param num_coins length of the @a coins array - * @param coins array of coins to pay with - * @param num_tokens length of the @a tokens array - * @param tokens array of tokens used - * @param j_output_tokens json array of token envelopes, NULL for none - * @param pay_cb the callback to call when a reply for this request is available - * @param pay_cb_cls closure for @a pay_cb - * @return a handle for this request - */ -struct TALER_MERCHANT_OrderPayHandle * -TALER_MERCHANT_order_pay_frontend ( - struct GNUNET_CURL_Context *ctx, - const char *merchant_url, - const char *order_id, - const char *session_id, - const json_t *wallet_data, - unsigned int num_coins, - const struct TALER_MERCHANT_PaidCoin coins[static num_coins], - unsigned int num_tokens, - const struct TALER_MERCHANT_UsedToken tokens[static num_tokens], - json_t *j_output_tokens, - TALER_MERCHANT_OrderPayCallback pay_cb, - void *pay_cb_cls); - - -/** - * Information we need from the wallet for each coin when doing the - * payment. - */ -struct TALER_MERCHANT_PayCoin -{ - /** - * Denomination key with which the coin is signed - */ - struct TALER_DenominationPublicKey denom_pub; - - /** - * Exchange’s unblinded signature of the coin - */ - struct TALER_DenominationSignature denom_sig; - - /** - * Overall value that coins of this @e denom_pub have. - */ - struct TALER_Amount denom_value; - - /** - * Coin's private key. - */ - struct TALER_CoinSpendPrivateKeyP coin_priv; - - /** - * Coin's age commitment. Might be NULL, if not applicable. - */ - const struct TALER_AgeCommitmentHashP *h_age_commitment; - - /** - * Amount this coin contributes to (including fee). - */ - struct TALER_Amount amount_with_fee; - - /** - * Amount this coin contributes to (without fee). - */ - struct TALER_Amount amount_without_fee; - - /** - * URL of the exchange that issued @e coin_priv. - */ - const char *exchange_url; - -}; - - -/** - * Information we need from the wallet to use a token for an order. - */ -struct TALER_MERCHANT_UseToken -{ - - /** - * Token use private key. We will derive the public key from this. - */ - struct TALER_TokenUsePrivateKeyP token_priv; - - /** - * Unblinded signature made by the token issue public key of the merchant. - */ - struct TALER_TokenIssueSignature ub_sig; - - /** - * Token issue public key associated with this token. - */ - struct TALER_TokenIssuePublicKey issue_pub; - -}; - - -/** - * Pay a merchant. API for wallets that have the coin's private keys. - * - * This is a PUBLIC API for wallets. - * - * @param ctx execution context - * @param merchant_url base URL of the merchant - * @param session_id session to pay for, or NULL for none - * @param h_contract hash of the contact of the merchant with the customer - * @param choice_index index of the selected contract choice, -1 for none - * @param amount total value of the contract to be paid to the merchant - * @param max_fee maximum fee covered by the merchant (according to the contract) - * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests) - * @param merchant_sig signature from the merchant over the original contract - * @param timestamp timestamp when the contract was finalized, must match approximately the current time of the merchant - * @param refund_deadline date until which the merchant can issue a refund to the customer via the merchant (can be zero if refunds are not allowed) - * @param pay_deadline maximum time limit to pay for this contract - * @param h_wire hash of the merchant’s account details - * @param order_id order id - * @param num_coins number of coins used to pay - * @param coins array of coins we use to pay - * @param num_tokens number of tokens to used in this payment request - * @param tokens array of tokens we use in this payment request - * @param num_output_tokens length of the @a output_tokens array - * @param output_tokens array of output tokens to be issued by the merchant - * @param pay_cb the callback to call when a reply for this request is available - * @param pay_cb_cls closure for @a pay_cb - * @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, - int choice_index, - 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], - unsigned int num_tokens, - const struct TALER_MERCHANT_UseToken tokens[static num_tokens], - unsigned int num_output_tokens, - const struct TALER_MERCHANT_OutputToken output_tokens[static num_output_tokens - ], - TALER_MERCHANT_OrderPayCallback pay_cb, - void *pay_cb_cls); - -/** - * Cancel a POST /orders/$ID/pay request. Note that if you cancel a request - * like this, you have no assurance that the request has not yet been - * forwarded to the merchant. Thus, the payment may still succeed or fail. - * Re-issue the original /pay request to resume/retry and obtain a definitive - * result, or refresh the coins involved to ensure that the merchant can no - * longer complete the payment. - * - * @param oph the payment request handle - */ -void -TALER_MERCHANT_order_pay_cancel (struct TALER_MERCHANT_OrderPayHandle *oph); - - -/** - * @brief Handle to a POST /orders/$ID/paid operation at a merchant. - */ -struct TALER_MERCHANT_OrderPaidHandle; - -/** - * Response to an /orders/$ID/paid request. - */ -struct TALER_MERCHANT_OrderPaidResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - /** - * HTTP-status code dependent details. - */ - union - { - /** - * Details on success. - */ - struct - { - /** - * Set to true if the order was paid but also - * refunded. - */ - bool refunded; - } ok; - } details; -}; - - -/** - * Callbacks of this type are used to serve the result of submitting a - * POST /orders/$ID/paid request to a merchant. - * - * @param cls closure - * @param opr response details - */ -typedef void -(*TALER_MERCHANT_OrderPaidCallback) ( - void *cls, - const struct TALER_MERCHANT_OrderPaidResponse *opr); - - -/** - * Send proof of payment to a merchant. - * - * This is a PUBLIC API, albeit in this form useful for the frontend, - * in case the frontend is proxying the request. - * - * @param ctx execution context - * @param merchant_url base URL of the merchant - * @param order_id which order should be paid - * @param session_id session to pay for, or NULL for none - * @param h_contract_terms hash of the contract terms - * @param wallet_data_hash inputs from the wallet for the contract, NULL for none; FIXME: this argument is not needed and should be removed! - * @param merchant_sig signature from the merchant - * affirming payment, or NULL on errors - * @param paid_cb the callback to call when a reply for this request is available - * @param paid_cb_cls closure for @a paid_cb - * @return a handle for this request - */ -struct TALER_MERCHANT_OrderPaidHandle * -TALER_MERCHANT_order_paid ( - struct GNUNET_CURL_Context *ctx, - const char *merchant_url, - const char *order_id, - const char *session_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct GNUNET_HashCode *wallet_data_hash, - const struct TALER_MerchantSignatureP *merchant_sig, - TALER_MERCHANT_OrderPaidCallback paid_cb, - void *paid_cb_cls); - - -/** - * Cancel POST /orders/$ID/paid operation. - * - * @param oph operation to cancel - */ -void -TALER_MERCHANT_order_paid_cancel ( - struct TALER_MERCHANT_OrderPaidHandle *oph); - - -/** - * Handle for an POST /orders/$ID/abort operation. - */ -struct TALER_MERCHANT_OrderAbortHandle; - - -/** - * Entry in the array of refunded coins. - */ -struct TALER_MERCHANT_AbortedCoin -{ - /** - * Exchange signature affirming the refund. - */ - struct TALER_ExchangeSignatureP exchange_sig; - - /** - * Exchange public key affirming the refund. - */ - struct TALER_ExchangePublicKeyP exchange_pub; -}; - - -/** - * Response to an /orders/$ID/abort request. - */ -struct TALER_MERCHANT_AbortResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status code. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - - /** - * public key of the merchant - */ - const struct TALER_MerchantPublicKeyP *merchant_pub; - - /** - * size of the @e aborts array - */ - unsigned int num_aborts; - - /** - * merchant signatures refunding coins - */ - const struct TALER_MERCHANT_AbortedCoin *aborts; - } ok; - - } details; -}; - - -/** - * Callbacks of this type are used to serve the result of submitting a - * /orders/$ID/abort request to a merchant. - * - * @param cls closure - * @param ar response details - */ -typedef void -(*TALER_MERCHANT_AbortCallback) ( - void *cls, - const struct TALER_MERCHANT_AbortResponse *ar); - - -/** - * Information we need from the wallet for each coin when aborting. - */ -struct TALER_MERCHANT_AbortCoin -{ - - /** - * Coin's public key. - */ - struct TALER_CoinSpendPublicKeyP coin_pub; - - /** - * Amount this coin contributes to (including fee). - * FIXME: no longer needed since **v18**. Remove eventually! - */ - struct TALER_Amount amount_with_fee; - - /** - * URL of the exchange that issued @e coin_priv. - */ - const char *exchange_url; - -}; - -/** - * Run a payment abort operation, asking for the payment to be aborted, - * yieldingrefunds for coins that were previously spend on a payment that - * failed to go through. - * - * This is a PUBLIC API for wallets. - * - * @param ctx execution context - * @param merchant_url base URL of the merchant - * @param order_id order to abort - * @param h_contract hash of the contact of the merchant with the customer - * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests) - * @param num_coins number of coins used to pay - * @param coins array of coins we use to pay - * @param cb the callback to call when a reply for this request is available - * @param cb_cls closure for @a cb - * @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[static num_coins], - TALER_MERCHANT_AbortCallback cb, - void *cb_cls); - - -/** - * Cancel a POST /orders/$ID/abort request. Note that if you cancel a request - * like this, you have no assurance that the request has not yet been - * forwarded to the merchant. - * - * @param oah the abort request handle - */ -void -TALER_MERCHANT_order_abort_cancel (struct TALER_MERCHANT_OrderAbortHandle *oah); - - -/** - * Handle for an PATCH /orders/$ID/forget operation. - */ -struct TALER_MERCHANT_OrderForgetHandle; - - -/** - * Callbacks of this type are used to serve the result of submitting a - * /orders/$ID/forget request to a merchant. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_ForgetCallback) ( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Run an order forget operation, which forgets certain fields in an order's - * contract terms without changing the hash of the contract terms. - * - * @param ctx execution context. - * @param merchant_url base URL of the merchant. - * @param order_id order to forget. - * @param fields_length length of @e fields. - * @param fields the fields in the contract terms to forget. - * @param cb the callback to call when a reply for this request is available. - * @param cb_cls closure for @a cb. - * @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[static fields_length], - TALER_MERCHANT_ForgetCallback cb, - void *cb_cls); - - -/** - * Cancel a PATCH /orders/$ID/forget request. Note that if you cancel a request - * like this, you have no assurance that the request has not yet been - * forwarded to the merchant. - * - * @param[in] ofh the forget request handle - */ -void -TALER_MERCHANT_order_forget_cancel ( - struct TALER_MERCHANT_OrderForgetHandle *ofh); - - -/** - * Handle for a POST /orders/ID/refund operation. - */ -struct TALER_MERCHANT_OrderRefundHandle; - - -/** - * Response to a POST /orders/$ID/refund request - */ -struct TALER_MERCHANT_RefundResponse -{ - /** - * HTTP response details this request - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - - /** - * the refund uri offered to the wallet - */ - const char *taler_refund_uri; - - /** - * Hash of the contract a wallet may need to authorize obtaining the HTTP - * response. - */ - struct TALER_PrivateContractHashP h_contract; - } ok; - } details; -}; - - -/** - * Callback to process a POST /orders/$ID/refund request - * - * @param cls closure - * @param rr response details this request - */ -typedef void -(*TALER_MERCHANT_RefundCallback) ( - void *cls, - const struct TALER_MERCHANT_RefundResponse *rr); - - -/** - * Increase the refund granted for an order - * - * @param ctx the CURL context used to connect to the backend - * @param backend_url backend's base URL, including final "/" - * @param order_id id of the order whose refund is to be increased - * @param refund amount to which increase the refund - * @param reason human-readable reason justifying the refund - * @param cb callback processing the response from /refund - * @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); - -/** - * Cancel a POST /refund request. - * - * @param orh the refund increasing operation to cancel - */ -void -TALER_MERCHANT_post_order_refund_cancel ( - struct TALER_MERCHANT_OrderRefundHandle *orh); - - -/** - * Handle for a (public) POST /orders/ID/refund operation. - */ -struct TALER_MERCHANT_WalletOrderRefundHandle; - - -/** - * Detail about a refund lookup result. - */ -struct TALER_MERCHANT_RefundDetail -{ - - /** - * Exchange response details. Full details are only included - * upon failure (HTTP status is not #MHD_HTTP_OK). - */ - struct TALER_EXCHANGE_HttpResponse hr; - - /** - * Coin this detail is about. - */ - struct TALER_CoinSpendPublicKeyP coin_pub; - - /** - * Refund transaction ID used. - */ - uint64_t rtransaction_id; - - /** - * Amount to be refunded for this coin. - */ - struct TALER_Amount refund_amount; - - /** - * Details depending on exchange HTTP status. - */ - union - { - /** - * Details if exchange status is #MHD_HTTP_OK. - */ - struct - { - /** - * Public key of the exchange affirming the refund, - * only valid if the @e hr http_status is #MHD_HTTP_OK. - */ - struct TALER_ExchangePublicKeyP exchange_pub; - - /** - * Signature of the exchange affirming the refund, - * only valid if the @e hr http_status is #MHD_HTTP_OK. - */ - struct TALER_ExchangeSignatureP exchange_sig; - } ok; - } details; -}; - - -/** - * Response to a POST /orders/$ID/refund request - * for wallet API. - */ -struct TALER_MERCHANT_WalletRefundResponse -{ - /** - * HTTP response details this request - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - - /** - * Total amount of the refund that was granted - */ - struct TALER_Amount refund_amount; - - /** - * public key of the merchant signing the @e refunds - */ - struct TALER_MerchantPublicKeyP merchant_pub; - - /** - * array with details about the refunds obtained - */ - const struct TALER_MERCHANT_RefundDetail *refunds; - - /** - * length of the @e refunds array - */ - unsigned int refunds_length; - } ok; - } details; -}; - - -/** - * Callback to process a (public) POST /orders/ID/refund request - * - * @param cls closure - * @param wrr HTTP response details - */ -typedef void -(*TALER_MERCHANT_WalletRefundCallback) ( - void *cls, - const struct TALER_MERCHANT_WalletRefundResponse *wrr); - - -/** - * Obtain the refunds that have been granted for an order. - * - * @param ctx the CURL context used to connect to the backend - * @param backend_url backend's base URL, including final "/" - * @param order_id id of the order whose refund is to be increased - * @param h_contract_terms hash of the contract terms of the order - * @param cb callback processing the response from /refund - * @param cb_cls closure for cb - */ -struct TALER_MERCHANT_WalletOrderRefundHandle * -TALER_MERCHANT_wallet_post_order_refund ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *order_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - TALER_MERCHANT_WalletRefundCallback cb, - void *cb_cls); - -/** - * Cancel a (public) POST /refund request. - * - * @param orh the refund operation to cancel - */ -void -TALER_MERCHANT_wallet_post_order_refund_cancel ( - struct TALER_MERCHANT_WalletOrderRefundHandle *orh); - - -/* ********************* /transfers *********************** */ - -/** - * @brief Handle to a POST /transfers operation at a merchant's backend. - */ -struct TALER_MERCHANT_PostTransfersHandle; - - -/** - * @brief Response to a POST /transfers operation from a merchant's backend. - */ -struct TALER_MERCHANT_PostTransfersResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - - /** - * Details if we got an #MHD_HTTP_BAD_GATEWAY. - */ - struct - { - /** - * HTTP status of the exchange (or 0 if not available). - */ - unsigned int exchange_http_status; - - /** - * Error code of the exchange (or TALER_EC_NONE if not available). - */ - enum TALER_ErrorCode exchange_ec; - - } bad_gateway; - - } details; - -}; - - -/** - * Callbacks of this type are used to work the result of submitting a - * POST /transfers request to a merchant - * - * @param cls closure - * @param ptr response details - */ -typedef void -(*TALER_MERCHANT_PostTransfersCallback) ( - void *cls, - const struct TALER_MERCHANT_PostTransfersResponse *ptr); - - -/** - * Request backend to remember that we received the given - * wire transfer and to request details about the aggregated - * transactions from the exchange. - * - * @param ctx execution context - * @param backend_url base URL of the backend - * @param credit_amount how much money did we receive (without wire fee) - * @param wtid base32 string indicating a wtid - * @param payto_uri which account was credited by the wire transfer - * @param exchange_url what is the URL of the exchange that made the transfer - * @param cb the callback to call when a reply for this request is available - * @param cls closure for @a cb - * @return a handle for this request - */ -struct TALER_MERCHANT_PostTransfersHandle * -TALER_MERCHANT_transfers_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const struct TALER_Amount *credit_amount, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct TALER_FullPayto payto_uri, - const char *exchange_url, - TALER_MERCHANT_PostTransfersCallback cb, - void *cls); - - -/** - * Cancel a POST /transfers request. This function cannot be used - * on a request handle if a response is already served for it. - * - * @param pth the operation to cancel - */ -void -TALER_MERCHANT_transfers_post_cancel ( - struct TALER_MERCHANT_PostTransfersHandle *pth); - - -/** - * Handle for a DELETE /transfers/ID operation. - */ -struct TALER_MERCHANT_TransferDeleteHandle; - - -/** - * Function called with the result of the DELETE /transfers/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TransferDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Delete an incoming wire transfer at an instance of a backend. This - * will only succeed if the exchange did not respond to the inquiry - * about the transfer. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend (top-level "default" instance - * or base URL of an instance if @a instance_id is NULL) - * @param wire_transfer_serial unique number that identifies the transfer - * @param td_cb function to call with the backend's result - * @param td_cb_cls closure for @a td_cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TransferDeleteHandle * -TALER_MERCHANT_transfer_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - uint64_t wire_transfer_serial, - TALER_MERCHANT_TransferDeleteCallback td_cb, - void *td_cb_cls); - - -/** - * Cancel deletion operation. Note that the operation may still - * succeed. - * - * @param tdh operation to cancel - */ -void -TALER_MERCHANT_transfer_delete_cancel ( - struct TALER_MERCHANT_TransferDeleteHandle *tdh); - - -/** - * @brief Handle to a GET /transfers operation at a merchant's backend. - */ -struct TALER_MERCHANT_GetTransfersHandle; - -/** - * Information about the _total_ amount that was paid back - * by the exchange for a given h_contract_terms, by _one_ wire - * transfer. - */ -struct TALER_MERCHANT_TransferData -{ - - /** - * Total amount wired by the exchange (without wire fee) - */ - struct TALER_Amount credit_amount; - - /** - * Wire transfer identifier used. - */ - struct TALER_WireTransferIdentifierRawP wtid; - - /** - * URI of the target account. - */ - struct TALER_FullPayto payto_uri; - - /** - * URL of the exchange that made the transfer. - */ - const char *exchange_url; - - /** - * Serial number of the credit operation in the merchant backend. - * Needed, for example, to delete the transfer using - * #TALER_MERCHANT_transfer_delete(). - */ - uint64_t credit_serial; - - /** - * Time of the wire transfer, based on when we received - * a confirmation for the wire transfer. - */ - struct GNUNET_TIME_Timestamp execution_time; - - /** - * True if this wire transfer was expected. - */ - bool expected; - -}; - - -/** - * Response from a GET /transfers request. - */ -struct TALER_MERCHANT_GetTransfersResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - - /** - * Details for status #MHD_HTTP_OK. - */ - struct - { - - /** - * length of the @e transfers array - */ - unsigned int transfers_length; - - /** - * array with details about the transfers we received - */ - const struct TALER_MERCHANT_TransferData *transfers; - } ok; - } details; -}; - - -/** - * Callbacks of this type are used to work the result of submitting a - * GET /transfers request to a merchant - * - * @param cls closure - * @param gtr HTTP response details - */ -typedef void -(*TALER_MERCHANT_GetTransfersCallback) ( - void *cls, - const struct TALER_MERCHANT_GetTransfersResponse *gtr); - - -/** - * Request backend to return list of all wire transfers that - * we received. - * - * @param ctx execution context - * @param backend_url base URL of the backend - * @param payto_uri filter by this credit account of the merchant - * @param before limit to transactions before this timestamp, use - * #GNUNET_TIME_UNIT_FOREVER_ABS to not filter by @a before - * @param after limit to transactions after this timestamp, use - * #GNUNET_TIME_UNIT_ZERO_ABS to not filter by @a after - * @param limit return at most this number of results; negative to descend in execution time - * @param offset start at this "credit serial" number (exclusive) - * @param expected filter results by expectation status - * @param cb the callback to call when a reply for this request is available - * @param cb_cls closure for @a cb - * @return a handle for this request - */ -struct TALER_MERCHANT_GetTransfersHandle * -TALER_MERCHANT_transfers_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - struct TALER_FullPayto payto_uri, - const struct GNUNET_TIME_Timestamp before, - const struct GNUNET_TIME_Timestamp after, - int64_t limit, - uint64_t offset, - enum TALER_EXCHANGE_YesNoAll expected, - TALER_MERCHANT_GetTransfersCallback cb, - void *cb_cls); - - -/** - * Cancel a POST /transfers request. This function cannot be used - * on a request handle if a response is already served for it. - * - * @param gth the operation to cancel - */ -void -TALER_MERCHANT_transfers_get_cancel ( - struct TALER_MERCHANT_GetTransfersHandle *gth); - - -/* ********************* /kyc ************************** */ - -/** - * Handle for getting the KYC status of instance(s). - */ -struct TALER_MERCHANT_KycGetHandle; - - -/** - * Information about KYC actions the merchant still must perform. - */ -struct TALER_MERCHANT_AccountKycRedirectDetail -{ - - /** - * Access token the user needs to start a KYC process, - * all zero if a KYC auth transfer must be made first. - */ - struct TALER_AccountAccessTokenP access_token; - - /** - * Base URL of the exchange this is about. - */ - const char *exchange_url; - - /** - * Our bank wire account this is about. - */ - struct TALER_FullPayto payto_uri; - - /** - * Array of length @e limits_array with (exposed) limits that apply to the - * account. - */ - const struct TALER_EXCHANGE_AccountLimit *limits; - - /** - * Array of payto://-URIs with instructions for wire - * transfers to perform a KYC auth wire transfer for - * the given account. Needed if @e kyc_url is NULL - * and @e limits are to be passed. - */ - struct TALER_FullPayto *payto_kycauths; - - /** - * Length of the @e limits array. - */ - unsigned int limits_length; - - /** - * Length of the @e payto_kycauths array. - */ - unsigned int pkycauth_length; - - /** - * HTTP status code returned by the exchange when we asked for - * information about the KYC status. - * 0 if there was no response at all. - */ - unsigned int exchange_http_status; - - /** - * Error code indicating errors the exchange - * returned, or #TALER_EC_NONE for none. - */ - enum TALER_ErrorCode exchange_code; - - /** - * Set to true if @e access_token was not given. - */ - bool no_access_token; - - /** - * Set to true if the merchant backend could not - * get the exchanges ``/keys`` and thus could not - * determine default limits or determine an - * @e auth_conflict. - */ - bool no_keys; - - /** - * Set to true if the given account cannot to KYC at the given exchange - * because no wire method exists that could be used to do the KYC auth wire - * transfer. - */ - bool auth_conflict; -}; - - -/** - * Details in a response to a GET /kyc request. - */ -struct TALER_MERCHANT_KycResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Response details depending on the HTTP status. - */ - union - { - /** - * Information returned if the status was #MHD_HTTP_OK. - */ - struct - { - - /** - * Array with information about KYC actions the merchant may perform. - */ - struct TALER_MERCHANT_AccountKycRedirectDetail *kycs; - - /** - * Length of the @e pending_kycs array. - */ - unsigned int kycs_length; - - } ok; - - } details; - -}; - - -/** - * Callback to with a response from a GET [/private]/kyc request - * - * @param cls closure - * @param kr response details - */ -typedef void -(*TALER_MERCHANT_KycGetCallback) ( - void *cls, - const struct TALER_MERCHANT_KycResponse *kr); - - -/** - * Issue a GET /private/kycs/$KYC_ID (private variant) request to the backend. - * Returns KYC status of bank accounts. - * - * @param ctx execution context - * @param backend_url base URL of the merchant backend - * @param h_wire which bank account to query, NULL for all - * @param exchange_url which exchange to query, NULL for all - * @param lpt target for long polling - * @param timeout how long to wait for an answer, including possibly long polling for the desired @a lpt status; - * note that when pulling for multiple accounts, any - * account reaching this status will cause the - * response to be returned - * @param cb function to call with the result - * @param cb_cls closure for @a cb - * @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, - enum TALER_EXCHANGE_KycLongPollTarget lpt, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_KycGetCallback cb, - void *cb_cls); - - -/** - * Issue a GET /management/instances/$INSTANCE/kyc request to the backend. - * Returns KYC status of bank accounts. - * - * @param ctx execution context - * @param backend_url base URL of the merchant backend - * @param instance_id specific instance to query - * @param h_wire which bank account to query, NULL for all - * @param exchange_url which exchange to query, NULL for all - * @param lpt target for long polling - * @param timeout how long to wait for a reply - * @param cb function to call with the result - * @param cb_cls closure for @a cb - * @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, - enum TALER_EXCHANGE_KycLongPollTarget lpt, - struct GNUNET_TIME_Relative timeout, - TALER_MERCHANT_KycGetCallback cb, - void *cb_cls); - - -/** - * Cancel a GET [/private]/kyc/$KYC_ID request. - * - * @param kyc handle to the request to be canceled - */ -void -TALER_MERCHANT_kyc_get_cancel ( - struct TALER_MERCHANT_KycGetHandle *kyc); - - -/* ********************* /otp-devices *********************** */ - - -/** - * Handle for a GET /otp-devices operation. - */ -struct TALER_MERCHANT_OtpDevicesGetHandle; - -/** - * Individual OTP device (minimal information - * returned via GET /otp-devices). - */ -struct TALER_MERCHANT_OtpDeviceEntry -{ - /** - * OTP device identifier. - */ - const char *otp_device_id; - - /** - * OTP device description. - */ - const char *device_description; - -}; - - -/** - * Response to a GET /otp-devices operation. - */ -struct TALER_MERCHANT_OtpDevicesGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @e otp_devices array - */ - unsigned int otp_devices_length; - - /** - * array of otp_devices the requested instance offers - */ - const struct TALER_MERCHANT_OtpDeviceEntry *otp_devices; - } ok; - } details; -}; - - -/** - * Function called with the result of the GET /otp-devices operation. - * - * @param cls closure - * @param tgr response details - */ -typedef void -(*TALER_MERCHANT_OtpDevicesGetCallback)( - void *cls, - const struct TALER_MERCHANT_OtpDevicesGetResponse *tgr); - - -/** - * Make a GET /otp-devices request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OtpDevicesGetHandle * -TALER_MERCHANT_otp_devices_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_OtpDevicesGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /otp-devices operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_otp_devices_get_cancel ( - struct TALER_MERCHANT_OtpDevicesGetHandle *tgh); - - -/** - * Handle for a GET /otp-device/$ID operation. Gets details - * about a single otp_device. Do not confused with a - * `struct TALER_MERCHANT_OtpDevicesGetHandle`, which - * obtains a list of all otp_devices. - */ -struct TALER_MERCHANT_OtpDeviceGetHandle; - - -/** - * Details in a response to a GET /otp-devices request. - */ -struct TALER_MERCHANT_OtpDeviceGetResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Response details depending on the HTTP status. - */ - union - { - /** - * Information returned if the status was #MHD_HTTP_OK. - */ - struct - { - - /** - * description of the otp_device - */ - const char *otp_device_description; - - /** - * POS confirmation text with OTP codes that - * would be returned for a purchase over the - * amount given in the query for the respective - * time and algorithm. NULL if the confirmation - * could not be computed based on the query and - * OTP algorithm. - */ - const char *otp_code; - - /** - * current counter. - */ - uint64_t otp_ctr; - - /** - * OTP algorithm used. - */ - enum TALER_MerchantConfirmationAlgorithm otp_alg; - - /** - * Timestamp in second used to compute - * @e otp_code. - */ - uint64_t otp_timestamp_s; - - } ok; - - } details; - -}; - - -/** - * Function called with the result of the GET /otp-device/$ID operation. - * - * @param cls closure - * @param tgr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OtpDeviceGetCallback)( - void *cls, - const struct TALER_MERCHANT_OtpDeviceGetResponse *tgr); - - -/** - * Make a GET /otp-device/$ID request to get details about an - * individual OTP device. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param otp_device_id identifier of the otp_device to inquire about - * @param cb function to call with the backend's otp_device information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OtpDeviceGetHandle * -TALER_MERCHANT_otp_device_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *otp_device_id, - TALER_MERCHANT_OtpDeviceGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /otp-devices/$ID operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_otp_device_get_cancel ( - struct TALER_MERCHANT_OtpDeviceGetHandle *tgh); - - -/** - * Handle for a POST /otp-devices operation. - */ -struct TALER_MERCHANT_OtpDevicesPostHandle; - - -/** - * Function called with the result of the POST /otp-devices operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OtpDevicesPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /otp-devices request to add an OTP device - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param otp_id identifier to use for the OTP device - * @param otp_device_description description of the OTP device - * @param otp_key key of the OTP device - * @param otp_alg OTP algorithm used - * @param otp_ctr counter for counter-based OTP - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OtpDevicesPostHandle * -TALER_MERCHANT_otp_devices_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *otp_id, - const char *otp_device_description, - const char *otp_key, - enum TALER_MerchantConfirmationAlgorithm otp_alg, - uint64_t otp_ctr, - TALER_MERCHANT_OtpDevicesPostCallback cb, - void *cb_cls); - - -/** - * Cancel POST /otp-devices operation. - * - * @param[in] tph operation to cancel - */ -void -TALER_MERCHANT_otp_devices_post_cancel ( - struct TALER_MERCHANT_OtpDevicesPostHandle *tph); - - -/** - * Handle for a PATCH /otp-device operation. - */ -struct TALER_MERCHANT_OtpDevicePatchHandle; - - -/** - * Function called with the result of the PATCH /otp-device operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OtpDevicePatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a PATCH /otp-device request to update OTP device details - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param otp_id identifier to use for the OTP device; the OTP device must exist, - * or the transaction will fail with a #MHD_HTTP_NOT_FOUND - * HTTP status code - * @param otp_device_description description of the otp_device - * @param otp_key key of the OTP device - * @param otp_alg OTP algorithm used - * @param otp_ctr counter for counter-based OTP - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OtpDevicePatchHandle * -TALER_MERCHANT_otp_device_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *otp_id, - const char *otp_device_description, - const char *otp_key, - enum TALER_MerchantConfirmationAlgorithm otp_alg, - uint64_t otp_ctr, - TALER_MERCHANT_OtpDevicePatchCallback cb, - void *cb_cls); - - -/** - * Cancel PATCH /otp-device operation. - * - * @param[in] tph operation to cancel - */ -void -TALER_MERCHANT_otp_device_patch_cancel ( - struct TALER_MERCHANT_OtpDevicePatchHandle *tph); - - -/** - * Handle for a DELETE /otp-device/$ID operation. - */ -struct TALER_MERCHANT_OtpDeviceDeleteHandle; - - -/** - * Function called with the result of the DELETE /otp-device/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_OtpDeviceDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a DELETE /otp-device/$ID request to delete an OTP device. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param otp_device_id identifier of the OTP device - * @param cb function to call with the backend's deletion status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_OtpDeviceDeleteHandle * -TALER_MERCHANT_otp_device_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *otp_device_id, - TALER_MERCHANT_OtpDeviceDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE /otp-device/$ID operation. - * - * @param[in] tdh operation to cancel - */ -void -TALER_MERCHANT_otp_device_delete_cancel ( - struct TALER_MERCHANT_OtpDeviceDeleteHandle *tdh); - - -/* ********************* /units *********************** */ - -struct TALER_MERCHANT_UnitEntry -{ - const char *unit; - const char *unit_name_long; - const char *unit_name_short; - const json_t *unit_name_long_i18n; - const json_t *unit_name_short_i18n; - bool unit_allow_fraction; - uint32_t unit_precision_level; - bool unit_active; - bool unit_builtin; -}; - -struct TALER_MERCHANT_UnitsGetResponse -{ - struct TALER_MERCHANT_HttpResponse hr; - union - { - struct - { - struct TALER_MERCHANT_UnitEntry *units; - unsigned int units_length; - } ok; - } details; -}; - -struct TALER_MERCHANT_UnitGetResponse -{ - struct TALER_MERCHANT_HttpResponse hr; - union - { - struct - { - struct TALER_MERCHANT_UnitEntry unit; - } ok; - } details; -}; - -typedef void -(*TALER_MERCHANT_UnitsGetCallback)( - void *cls, - const struct TALER_MERCHANT_UnitsGetResponse *ugr); - -typedef void -(*TALER_MERCHANT_UnitGetCallback)( - void *cls, - const struct TALER_MERCHANT_UnitGetResponse *ugr); - -typedef void -(*TALER_MERCHANT_UnitsPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - -typedef void -(*TALER_MERCHANT_UnitPatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - -typedef void -(*TALER_MERCHANT_UnitDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - -struct TALER_MERCHANT_UnitsGetHandle; -struct TALER_MERCHANT_UnitGetHandle; -struct TALER_MERCHANT_UnitsPostHandle; -struct TALER_MERCHANT_UnitPatchHandle; -struct TALER_MERCHANT_UnitDeleteHandle; - -struct TALER_MERCHANT_UnitsGetHandle * -TALER_MERCHANT_units_get (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_UnitsGetCallback cb, - void *cb_cls); - -void -TALER_MERCHANT_units_get_cancel ( - struct TALER_MERCHANT_UnitsGetHandle *ugh); - -struct TALER_MERCHANT_UnitGetHandle * -TALER_MERCHANT_unit_get (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *unit_id, - TALER_MERCHANT_UnitGetCallback cb, - void *cb_cls); - -void -TALER_MERCHANT_unit_get_cancel ( - struct TALER_MERCHANT_UnitGetHandle *ugh); - -struct TALER_MERCHANT_UnitsPostHandle * -TALER_MERCHANT_units_post (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *unit_id, - const char *unit_name_long, - const char *unit_name_short, - bool unit_allow_fraction, - uint32_t unit_precision_level, - bool unit_active, - const json_t *unit_name_long_i18n, - const json_t *unit_name_short_i18n, - TALER_MERCHANT_UnitsPostCallback cb, - void *cb_cls); - -void -TALER_MERCHANT_units_post_cancel ( - struct TALER_MERCHANT_UnitsPostHandle *uph); - -struct TALER_MERCHANT_UnitPatchHandle * -TALER_MERCHANT_unit_patch (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *unit_id, - const char *unit_name_long, - const char *unit_name_short, - const json_t *unit_name_long_i18n, - const json_t *unit_name_short_i18n, - const bool *unit_allow_fraction, - const uint32_t *unit_precision_level, - const bool *unit_active, - TALER_MERCHANT_UnitPatchCallback cb, - void *cb_cls); - -void -TALER_MERCHANT_unit_patch_cancel ( - struct TALER_MERCHANT_UnitPatchHandle *uph); - -struct TALER_MERCHANT_UnitDeleteHandle * -TALER_MERCHANT_unit_delete (struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *unit_id, - TALER_MERCHANT_UnitDeleteCallback cb, - void *cb_cls); - -void -TALER_MERCHANT_unit_delete_cancel ( - struct TALER_MERCHANT_UnitDeleteHandle *udh); - - -/* ********************* /templates *********************** */ - - -/** - * Handle for a GET /templates operation. - */ -struct TALER_MERCHANT_TemplatesGetHandle; - -/** - * Individual template (minimal information - * returned via GET /templates). - */ -struct TALER_MERCHANT_TemplateEntry -{ - /** - * template identifier. - */ - const char *template_id; - -}; - - -/** - * Response to a GET /templates operation. - */ -struct TALER_MERCHANT_TemplatesGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @e templates array - */ - unsigned int templates_length; - - /** - * array of templates the requested instance offers - */ - const struct TALER_MERCHANT_TemplateEntry *templates; - } ok; - } details; -}; - - -/** - * Function called with the result of the GET /templates operation. - * - * @param cls closure - * @param tgr response details - */ -typedef void -(*TALER_MERCHANT_TemplatesGetCallback)( - void *cls, - const struct TALER_MERCHANT_TemplatesGetResponse *tgr); - - -/** - * Make a GET /templates request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TemplatesGetHandle * -TALER_MERCHANT_templates_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_TemplatesGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /templates operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_templates_get_cancel ( - struct TALER_MERCHANT_TemplatesGetHandle *tgh); - - -/** - * Handle for a GET /private/template/$ID operation. Gets details - * about a single template. Do not confused with a - * `struct TALER_MERCHANT_TemplatesGetHandle`, which - * obtains a list of all templates. - */ -struct TALER_MERCHANT_TemplateGetHandle; - - -/** - * Details in a response to a GET /private/templates/$ID request. - */ -struct TALER_MERCHANT_TemplateGetResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Response details depending on the HTTP status. - */ - union - { - /** - * Information returned if the status was #MHD_HTTP_OK. - */ - struct - { - - /** - * description of the template - */ - const char *template_description; - - /** - * OTP device ID used by the POS, NULL if none. - */ - const char *otp_id; - - /** - * Template for the contract. - */ - const json_t *template_contract; - - } ok; - - } details; - -}; - - -/** - * Function called with the result of the GET /private/template/$ID operation. - * - * @param cls closure - * @param tgr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TemplateGetCallback)( - void *cls, - const struct TALER_MERCHANT_TemplateGetResponse *tgr); - - -/** - * Make a GET /private/template/$ID request to get details about an - * individual template. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier of the template to inquire about - * @param cb function to call with the backend's template information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TemplateGetHandle * -TALER_MERCHANT_template_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - TALER_MERCHANT_TemplateGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /private/templates/$ID operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_template_get_cancel ( - struct TALER_MERCHANT_TemplateGetHandle *tgh); - - -/** - * Handle for a (public) GET /template/$ID operation. Gets details about a - * single template. Do not confused with a `struct - * TALER_MERCHANT_TemplateGetHandle`, which is for the private API. - */ -struct TALER_MERCHANT_WalletTemplateGetHandle; - - -/** - * Details in a response to a GET /templates request. - */ -struct TALER_MERCHANT_WalletTemplateGetResponse -{ - /** - * HTTP response details. - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Response details depending on the HTTP status. - */ - union - { - /** - * Information returned if the status was #MHD_HTTP_OK. - */ - struct - { - - /** - * Template for the contract. - */ - const json_t *template_contract; - - } ok; - - } details; - -}; - - -/** - * Function called with the result of the GET /template/$ID operation. - * - * @param cls closure - * @param tgr HTTP response details - */ -typedef void -(*TALER_MERCHANT_WalletTemplateGetCallback)( - void *cls, - const struct TALER_MERCHANT_WalletTemplateGetResponse *tgr); - - -/** - * Make a GET /template/$ID request to get details about an - * individual template. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier of the template to inquire about - * @param cb function to call with the backend's template information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WalletTemplateGetHandle * -TALER_MERCHANT_wallet_template_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - TALER_MERCHANT_WalletTemplateGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /templates/$ID operation. - * - * @param tgh operation to cancel - */ -void -TALER_MERCHANT_wallet_template_get_cancel ( - struct TALER_MERCHANT_WalletTemplateGetHandle *tgh); - - -/** - * Handle for a POST /templates operation. - */ -struct TALER_MERCHANT_TemplatesPostHandle; - - -/** - * Function called with the result of the POST /templates operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TemplatesPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /templates request to add a template - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier to use for the template - * @param template_description description of the template - * @param otp_id ID of the OTP device, or NULL if OTP is not used - * @param template_contract is the contract of the company - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TemplatesPostHandle * -TALER_MERCHANT_templates_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - const char *template_description, - const char *otp_id, - const json_t *template_contract, - TALER_MERCHANT_TemplatesPostCallback cb, - void *cb_cls); - - -/** - * Cancel POST /templates operation. - * - * @param[in] tph operation to cancel - */ -void -TALER_MERCHANT_templates_post_cancel ( - struct TALER_MERCHANT_TemplatesPostHandle *tph); - - -/** - * Handle for a PATCH /template operation. - */ -struct TALER_MERCHANT_TemplatePatchHandle; - - -/** - * Function called with the result of the PATCH /template operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TemplatePatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a PATCH /template request to update template details - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier to use for the template; the template must exist, - * or the transaction will fail with a #MHD_HTTP_NOT_FOUND - * HTTP status code - * @param template_description description of the template - * @param otp_id device ID of the OTP device, or NULL if OTP is not used - * @param template_contract is the contract of the company - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TemplatePatchHandle * -TALER_MERCHANT_template_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - const char *template_description, - const char *otp_id, - json_t *template_contract, - TALER_MERCHANT_TemplatePatchCallback cb, - void *cb_cls); - - -/** - * Cancel PATCH /template operation. - * - * @param[in] tph operation to cancel - */ -void -TALER_MERCHANT_template_patch_cancel ( - struct TALER_MERCHANT_TemplatePatchHandle *tph); - - -/** - * Handle for a DELETE /template/$ID operation. - */ -struct TALER_MERCHANT_TemplateDeleteHandle; - - -/** - * Function called with the result of the DELETE /template/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_TemplateDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a DELETE /template/$ID request to delete a template. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier of the template - * @param cb function to call with the backend's deletion status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_TemplateDeleteHandle * -TALER_MERCHANT_template_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - TALER_MERCHANT_TemplateDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE /template/$ID operation. - * - * @param[in] tdh operation to cancel - */ -void -TALER_MERCHANT_template_delete_cancel ( - struct TALER_MERCHANT_TemplateDeleteHandle *tdh); - - -/** - * Make a POST /using-templates request to add an using template - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id which template should be used - * @param summary summary of the using template - * @param amount to pay given by the customer - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_UsingTemplatesPostHandle * -TALER_MERCHANT_using_templates_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - const char *summary, - const struct TALER_Amount *amount, - TALER_MERCHANT_PostOrdersCallback cb, - void *cb_cls); - -/** - * Make a POST /templates/$ID request to instantiate a template - * with a raw JSON payload. Useful for inventory templates. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param template_id identifier of the template to use - * @param details JSON payload to send as request body - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_UsingTemplatesPostHandle * -TALER_MERCHANT_using_templates_post2 ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *template_id, - const json_t *details, - TALER_MERCHANT_PostOrdersCallback cb, - void *cb_cls); - - -/** - * Cancel POST /using-templates operation. - * - * @param[in] utph operation to cancel - */ -void -TALER_MERCHANT_using_templates_post_cancel ( - struct TALER_MERCHANT_UsingTemplatesPostHandle *utph); - - -/* ********************* /webhooks *********************** */ - - -/** - * Handle for a GET /webhooks operation. - */ -struct TALER_MERCHANT_WebhooksGetHandle; - -/** - * Individual webhook (minimal information - * returned via GET /webhooks). - */ -struct TALER_MERCHANT_WebhookEntry -{ - /** - * webhook identifier. - */ - const char *webhook_id; - -}; - - -/** - * Response to a GET /webhooks operation. - */ -struct TALER_MERCHANT_WebhooksGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on status. - */ - union - { - /** - * Details if status is #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @e webhooks array - */ - unsigned int webhooks_length; - - /** - * array of templates the requested instance offers - */ - const struct TALER_MERCHANT_WebhookEntry *webhooks; - - } ok; - - } details; -}; - - -/** - * Function called with the result of the GET /webhooks operation. - * - * @param cls closure - * @param wgr response details - */ -typedef void -(*TALER_MERCHANT_WebhooksGetCallback)( - void *cls, - const struct TALER_MERCHANT_WebhooksGetResponse *wgr); - - -/** - * Make a GET /webhooks request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param cb function to call with the backend information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WebhooksGetHandle * -TALER_MERCHANT_webhooks_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - TALER_MERCHANT_WebhooksGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /webhooks operation. - * - * @param[in] tgh operation to cancel - */ -void -TALER_MERCHANT_webhooks_get_cancel ( - struct TALER_MERCHANT_WebhooksGetHandle *tgh); - - -/** - * Handle for a GET /webhook/$ID operation. Gets details - * about a single webhook. Do not confused with a - * `struct TALER_MERCHANT_WebhooksGetHandle`, which - * obtains a list of all webhooks. - */ -struct TALER_MERCHANT_WebhookGetHandle; - - -/** - * Function called with the result of the GET /webhooks operation. - * - * @param cls closure - * @param hr HTTP response details - * @param event_type event of the webhook - * @param url url to trigger webhook at - * @param http_method use for the webhook - * @param header_template header of the webhook - * @param body_template body of the webhook - */ -typedef void -(*TALER_MERCHANT_WebhookGetCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template); - - -/** - * Make a GET /webhook/$ID request to get details about an - * individual webhook. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param webhook_id identifier of the webhook to inquire about - * @param cb function to call with the backend's webhook information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WebhookGetHandle * -TALER_MERCHANT_webhook_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *webhook_id, - TALER_MERCHANT_WebhookGetCallback cb, - void *cb_cls); - - -/** - * Cancel GET /webhooks/$ID operation. - * - * @param[in] tgh operation to cancel - */ -void -TALER_MERCHANT_webhook_get_cancel ( - struct TALER_MERCHANT_WebhookGetHandle *tgh); - - -/** - * Handle for a POST /webhooks operation. - */ -struct TALER_MERCHANT_WebhooksPostHandle; - - -/** - * Function called with the result of the POST /webhooks operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_WebhooksPostCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a POST /webhooks request to add a webhook - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param webhook_id identifier to use for the webhook - * @param event_type event of the webhook - * @param url url use by the customer - * @param http_method http method use by the merchant - * @param header_template header of the webhook - * @param body_template body of the webhook - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WebhooksPostHandle * -TALER_MERCHANT_webhooks_post ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *webhook_id, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template, - TALER_MERCHANT_WebhooksPostCallback cb, - void *cb_cls); - - -/** - * Cancel POST /webhooks operation. - * - * @param[in] wph operation to cancel - */ -void -TALER_MERCHANT_webhooks_post_cancel ( - struct TALER_MERCHANT_WebhooksPostHandle *wph); - - -/** - * Handle for a PATCH /webhook operation. - */ -struct TALER_MERCHANT_WebhookPatchHandle; - - -/** - * Function called with the result of the PATCH /webhook operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_WebhookPatchCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a PATCH /webhook request to update webhook details - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param webhook_id identifier to use for the webhook; the webhook must exist, - * or the transaction will fail with a #MHD_HTTP_NOT_FOUND - * HTTP status code - * @param event_type event of the webhook - * @param url url use by the customer - * @param http_method http method use by the merchant - * @param header_template header of the webhook - * @param body_template body of the webhook - * @param cb function to call with the backend's result - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WebhookPatchHandle * -TALER_MERCHANT_webhook_patch ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *webhook_id, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template, - TALER_MERCHANT_WebhookPatchCallback cb, - void *cb_cls); - - -/** - * Cancel PATCH /webhook operation. - * - * @param[in] wph operation to cancel - */ -void -TALER_MERCHANT_webhook_patch_cancel ( - struct TALER_MERCHANT_WebhookPatchHandle *wph); - - -/** - * Handle for a DELETE /webhook$ID operation. - */ -struct TALER_MERCHANT_WebhookDeleteHandle; - - -/** - * Function called with the result of the DELETE /webhook/$ID operation. - * - * @param cls closure - * @param hr HTTP response details - */ -typedef void -(*TALER_MERCHANT_WebhookDeleteCallback)( - void *cls, - const struct TALER_MERCHANT_HttpResponse *hr); - - -/** - * Make a DELETE /webhook/$ID request to delete a webhook. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param webhook_id identifier of the webhook - * @param cb function to call with the backend's deletion status - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_WebhookDeleteHandle * -TALER_MERCHANT_webhook_delete ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *webhook_id, - TALER_MERCHANT_WebhookDeleteCallback cb, - void *cb_cls); - - -/** - * Cancel DELETE /webhook/$ID operation. - * - * @param[in] wdh operation to cancel - */ -void -TALER_MERCHANT_webhook_delete_cancel ( - struct TALER_MERCHANT_WebhookDeleteHandle *wdh); - -/* ********************* /statistics-[counter,amount] ************************** */ - -/** - * Statistic type that can be filtered by - */ -enum TALER_MERCHANT_StatisticsType -{ - - /** - * Get all statistics - */ - TALER_MERCHANT_STATISTICS_ALL, - - /** - * Get statistics by interval only - */ - TALER_MERCHANT_STATISTICS_BY_INTERVAL, - - /** - * Get statistics by bucket only - */ - TALER_MERCHANT_STATISTICS_BY_BUCKET, - -}; - -/** - * Handle for a GET /statistics-counter/$SLUG operation. - */ -struct TALER_MERCHANT_StatisticsCounterGetHandle; - -/** - * Counter by interval result object - */ -struct TALER_MERCHANT_StatisticCounterByInterval -{ - - /** - * Start time of the interval (inclusive). - * The interval always ends at the response - * generation time. - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * Sum of all counters falling under the given - * SLUG within this timeframe. - */ - uint64_t cumulative_counter; - -}; - -/** - * Counter by bucket result object - */ -struct TALER_MERCHANT_StatisticCounterByBucket -{ - - /** - * Start time of the bucket (inclusive). - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * End time of the bucket (exclusive). - */ - struct GNUNET_TIME_Timestamp end_time; - - /** - * Range of the bucket - */ - const char *range; - - /** - * Sum of all counters falling under the given - * SLUG within this timeframe. - */ - uint64_t cumulative_counter; - -}; - -/** - * Response to GET /statistics-counter/$SLUG operation. - */ -struct TALER_MERCHANT_StatisticsCounterGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @a buckets array - */ - unsigned int buckets_length; - - /** - * array of statistics in this bucket - */ - const struct TALER_MERCHANT_StatisticCounterByBucket *buckets; - - /** - * description of the statistic of the buckets - */ - const char *buckets_description; - - /** - * length of the @a intervals array - */ - unsigned int intervals_length; - - /** - * array of statistics in this interval - */ - const struct TALER_MERCHANT_StatisticCounterByInterval *intervals; - - /** - * description of the statistic of the intervals - */ - const char *intervals_description; - - } ok; - - } details; - -}; - -/** - * Cancel GET /statistics-counter/$SLUG operation. - * - * @param handle operation to cancel - */ -void -TALER_MERCHANT_statistic_counter_get_cancel ( - struct TALER_MERCHANT_StatisticsCounterGetHandle *handle); - - -/** - * Function called with the result of the GET /statistics-counter/$SLUG operation. - * - * @param cls closure - * @param scgr response details - */ -typedef void -(*TALER_MERCHANT_StatisticsCounterGetCallback)( - void *cls, - const struct TALER_MERCHANT_StatisticsCounterGetResponse *scgr); - -/** - * Make a GET /statistics-counter/$SLUG request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param slug short, url-safe identifier for the statistic - * @param stype the type of statistic to get, see #TALER_MERCHANT_StatisticsType - * @param cb function to call with the statistic information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_StatisticsCounterGetHandle * -TALER_MERCHANT_statistic_counter_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *slug, - enum TALER_MERCHANT_StatisticsType stype, - TALER_MERCHANT_StatisticsCounterGetCallback cb, - void *cb_cls); - -/** - * Handle for a GET /statistics-amount/$SLUG operation. - */ -struct TALER_MERCHANT_StatisticsAmountGetHandle; - -/** - * Amount by interval result object - */ -struct TALER_MERCHANT_StatisticAmountByInterval -{ - /** - * Start time of the interval (inclusive). - * The interval always ends at the response - * generation time. - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * Sum of all amounts falling under the given - * SLUG within this timeframe. - */ - struct TALER_Amount *cumulative_amounts; - - /** - * Length of array @a cumulative_amounts - */ - unsigned int cumulative_amount_len; - -}; - -/** - * Amount by bucket result object - */ -struct TALER_MERCHANT_StatisticAmountByBucket -{ - /** - * Start time of the bucket (inclusive). - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * End time of the bucket (exclusive). - */ - struct GNUNET_TIME_Timestamp end_time; - - /** - * Range of the bucket - */ - const char *range; - - /** - * Sum of all amounts falling under the given - * SLUG within this timeframe. - */ - struct TALER_Amount *cumulative_amounts; - - /** - * Length of array @a cumulative_amounts - */ - unsigned int cumulative_amount_len; -}; - -/** - * Response to GET /statistics-amount/$SLUG operation. - */ -struct TALER_MERCHANT_StatisticsAmountGetResponse -{ - /** - * HTTP response details - */ - struct TALER_MERCHANT_HttpResponse hr; - - /** - * Details depending on HTTP status. - */ - union - { - /** - * Details for #MHD_HTTP_OK. - */ - struct - { - /** - * length of the @a buckets array - */ - unsigned int buckets_length; - - /** - * array of statistics in this bucket - */ - const struct TALER_MERCHANT_StatisticAmountByBucket *buckets; - - /** - * description of the statistic of the buckets - */ - const char *buckets_description; - - /** - * length of the @a intervals array - */ - unsigned int intervals_length; - - /** - * array of statistics in this Interval - */ - const struct TALER_MERCHANT_StatisticAmountByInterval *intervals; - - /** - * description of the statistic of the intervals - */ - const char *intervals_description; - - } ok; - - } details; - -}; - -/** - * Cancel GET /statistics-amount/$SLUG operation. - * - * @param handle operation to cancel - */ -void -TALER_MERCHANT_statistic_amount_get_cancel ( - struct TALER_MERCHANT_StatisticsAmountGetHandle *handle); - - -/** - * Function called with the result of the GET /statistics-amount/$SLUG operation. - * - * @param cls closure - * @param sagr response details - */ -typedef void -(*TALER_MERCHANT_StatisticsAmountGetCallback)( - void *cls, - const struct TALER_MERCHANT_StatisticsAmountGetResponse *sagr); - -/** - * Make a GET /statistics-amount request. - * - * @param ctx the context - * @param backend_url HTTP base URL for the backend - * @param slug short, url-safe identifier for the statistic - * @param stype the type of statistic to get, see #TALER_MERCHANT_StatisticsType - * @param cb function to call with the statistic information - * @param cb_cls closure for @a cb - * @return the request handle; NULL upon error - */ -struct TALER_MERCHANT_StatisticsAmountGetHandle * -TALER_MERCHANT_statistic_amount_get ( - struct GNUNET_CURL_Context *ctx, - const char *backend_url, - const char *slug, - enum TALER_MERCHANT_StatisticsType stype, - TALER_MERCHANT_StatisticsAmountGetCallback cb, - void *cb_cls); - - -#endif /* _TALER_MERCHANT_SERVICE_H */ diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h @@ -1,2514 +0,0 @@ -/* - This file is part of TALER - (C) 2018-2023 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 3, or - (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with TALER; see the file COPYING. If not, see - <http://www.gnu.org/licenses/> -*/ - -/** - * @file taler_merchant_testing_lib.h - * @brief API for writing an interpreter to test Taler components - * @author Christian Grothoff <christian@grothoff.org> - * @author Marcello Shtanisci - * @author Priscilla HUANG - */ -#ifndef TALER_MERCHANT_TESTING_LIB_H -#define TALER_MERCHANT_TESTING_LIB_H - -#include <gnunet/gnunet_time_lib.h> -#include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#ifdef HAVE_DONAU_DONAU_SERVICE_H -#include "donau/donau_service.h" -#endif // HAVE_DONAU_DONAU_SERVICE_H - -/* ********************* Helper functions ********************* */ - - -#define MERCHANT_FAIL() \ - do {GNUNET_break (0); return NULL; } while (0) - - -/** - * Extract hostname (and port) from merchant base URL. - * - * @param merchant_url full merchant URL (e.g. "http://host:8080/foo/bar/") - * @return just the hostname and port ("hostname:8080") - */ -char * -TALER_MERCHANT_TESTING_extract_host (const char *merchant_url); - - -/* ************** Specific interpreter commands ************ */ - - -/** - * Define a "config" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * "config" request. - * @param http_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_config (const char *label, - const char *merchant_url, - unsigned int http_code); - - -/** - * Define a "GET /instances" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /instances request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * product (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_instances (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "POST /instances" CMD, simple version - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param instance_id the ID of the instance to create - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_instances (const char *label, - const char *merchant_url, - const char *instance_id, - unsigned int http_status); - - -/** - * Define a "POST /private/auth" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param instance_id the ID of the instance, or NULL - * @param auth_token new auth token to use, can be NULL for no auth - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_instance_auth (const char *label, - const char *merchant_url, - const char *instance_id, - const char *auth_token, - unsigned int http_status); - - -/** - * Define a "POST /private/token" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param instance_id the ID of the instance, or NULL - * @param scope scope to request, can be NULL - * @param duration requested token validity duration - * @param refreshable should token be refreshable - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_instance_token (const char *label, - const char *merchant_url, - const char *instance_id, - const char *scope, - struct GNUNET_TIME_Relative - duration, - bool refreshable, - unsigned int http_status); - -/** - * Set the access token gotten through another CMD - * - * @param label command label. - * @param cmd_job_label the other command exposing the bearer_token trait. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_set_instance_token (const char *label, - const char *cmd_job_label); - -/** - * Define a "DELETE /private/token" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param instance_id the ID of the instance, or NULL - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_instance_token (const char *label, - const char *merchant_url, - const char *instance_id, - unsigned int http_status); - -/** - * Define a "POST /instances" CMD. Comprehensive version. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param instance_id the ID of the instance to query - * @param name name of the merchant instance - * @param address physical address of the merchant instance - * @param jurisdiction jurisdiction of the merchant instance - * @param use_stefan enable STEFAN curve - * @param default_wire_transfer_delay default wire transfer delay merchant will ask for - * @param default_pay_delay default validity period for offers merchant makes - * @param auth_token authorization token needed to access the instance, can be NULL - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_instances2 ( - const char *label, - const char *merchant_url, - const char *instance_id, - const char *name, - json_t *address, - json_t *jurisdiction, - bool use_stefan, - struct GNUNET_TIME_Relative default_wire_transfer_delay, - struct GNUNET_TIME_Relative default_pay_delay, - const char *auth_token, - unsigned int http_status); - - -/** - * Define a "POST /account" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param payto_uri URIs of the bank account to add to the merchant instance - * @param credit_facade_url credit facade URL to configure, can be NULL - * @param credit_facade_credentials credit facade credentials to use, can be NULL - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_account ( - const char *label, - const char *merchant_url, - struct TALER_FullPayto payto_uri, - const char *credit_facade_url, - const json_t *credit_facade_credentials, - unsigned int http_status); - - -/** - * Define a "PATCH /account" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /instances request. - * @param create_account_ref reference to account setup command - * @param credit_facade_url credit facade URL to configure, can be NULL - * @param credit_facade_credentials credit facade credentials to use, can be NULL - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_account ( - const char *label, - const char *merchant_url, - const char *create_account_ref, - const char *credit_facade_url, - const json_t *credit_facade_credentials, - unsigned int http_status); - - -/** - * Define a "DELETE /account" CMD. - * - * @param label command label. - * @param create_account_ref reference to account setup command - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_account ( - const char *label, - const char *create_account_ref, - unsigned int http_status); - - -/** - * Define a "PATCH /instances/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /instance request. - * @param instance_id the ID of the instance to query - * @param name name of the merchant instance - * @param address physical address of the merchant instance - * @param jurisdiction jurisdiction of the merchant instance - * @param use_stefan use STEFAN curve - * @param default_wire_transfer_delay default wire transfer delay merchant will ask for - * @param default_pay_delay default validity period for offers merchant makes - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_instance ( - const char *label, - const char *merchant_url, - const char *instance_id, - const char *name, - json_t *address, - json_t *jurisdiction, - bool use_stefan, - struct GNUNET_TIME_Relative default_wire_transfer_delay, - struct GNUNET_TIME_Relative default_pay_delay, - unsigned int http_status); - - -/** - * Define a "GET instance" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /instances/$ID request. - * @param instance_id the ID of the instance to query - * @param http_status expected HTTP response code. - * @param instance_reference reference to a "POST /instances" or "PATCH /instances/$ID" CMD - * that will provide what we expect the backend to return to us - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_instance (const char *label, - const char *merchant_url, - const char *instance_id, - unsigned int http_status, - const char *instance_reference); - - -/** - * Define a "PURGE instance" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PURGE /instances/$ID request. - * @param instance_id the ID of the instance to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_purge_instance (const char *label, - const char *merchant_url, - const char *instance_id, - unsigned int http_status); - - -/** - * Define a "DELETE instance" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /instances/$ID request. - * @param instance_id the ID of the instance to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_instance (const char *label, - const char *merchant_url, - const char *instance_id, - unsigned int http_status); - - -/* ******************* /products **************** */ - - -/** - * Define a "POST /products" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /products request. - * @param product_id the ID of the product to query - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books) - * @param minimum_age minimum age required for buying this product - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_TS for 'never'. - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_products2 ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - json_t *description_i18n, - const char *unit, - const char *price, - const char *image, - json_t *taxes, - int64_t total_stock, - uint32_t minimum_age, - json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - unsigned int http_status); - - -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_products3 ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - json_t *description_i18n, - const char *unit, - const char *price, - const char *image, - json_t *taxes, - int64_t total_stock, - uint32_t total_stock_frac, - bool unit_allow_fraction, - uint32_t minimum_age, - json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - unsigned int http_status); - -/** - * Define a "POST /products" CMD with explicit unit_price array. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /products request. - * @param product_id the ID of the product to create - * @param description name of the product - * @param unit unit in which the product is measured - * @param unit_prices array of unit prices as strings - * @param unit_prices_len length of @a unit_prices - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_products_with_unit_prices ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - const char *unit, - const char *const *unit_prices, - size_t unit_prices_len, - unsigned int http_status); - - -/** - * Define a "POST /products" CMD, simple version - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /products request. - * @param product_id the ID of the product to create - * @param description name of the product - * @param price price of the product - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_products (const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - const char *price, - unsigned int http_status); - -/** - * Define a "POST /products" CMD with category IDs. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /products request. - * @param product_id the ID of the product to create - * @param description name of the product - * @param price price of the product - * @param num_cats length of the @a cats array - * @param cats array of category IDs - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_products_with_categories ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - const char *unit, - const char *price, - unsigned int num_cats, - const uint64_t *cats, - bool unit_allow_fraction, - uint32_t unit_precision_level, - unsigned int http_status); - -/** - * Define a "POST /private/categories" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param name category name - * @param name_i18n category name translations - * @param expected_category_id expected category id (0 to ignore) - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_categories ( - const char *label, - const char *merchant_url, - const char *name, - json_t *name_i18n, - uint64_t expected_category_id, - unsigned int http_status); - -/** - * Define a "GET /templates/$ID" wallet CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param template_id template ID to fetch - * @param expected_products_len expected number of products (0 to ignore) - * @param expected_product_id first expected product id (can be NULL) - * @param expected_unit expected unit for @a expected_product_id (can be NULL) - * @param expected_unit_allow_fraction expected fractional flag - * @param expected_unit_precision_level expected precision - * @param expected_product_id2 second expected product id (can be NULL) - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_wallet_get_template ( - const char *label, - const char *merchant_url, - const char *template_id, - size_t expected_products_len, - const char *expected_product_id, - const char *expected_unit, - bool expected_unit_allow_fraction, - uint32_t expected_unit_precision_level, - json_t *expected_unit_name_short_i18n, - const char *expected_product_id2, - const char *expected_product_id3, - uint64_t expected_category_id1, - uint64_t expected_category_id2, - unsigned int http_status); - - -/** - * Define a "PATCH /products/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /product request. - * @param product_id the ID of the product to query - * @param description description of the product - * @param description_i18n Map from IETF BCP 47 language tags to localized descriptions - * @param unit unit in which the product is measured (liters, kilograms, packages, etc.) - * @param price the price for one @a unit of the product, zero is used to imply that - * this product is not sold separately or that the price is not fixed and - * must be supplied by the front-end. If non-zero, price must include - * applicable taxes. - * @param image base64-encoded product image - * @param taxes list of taxes paid by the merchant - * @param total_stock in @a units, -1 to indicate "infinite" (i.e. electronic books) - * @param total_lost in @a units, must be larger than previous values, and may - * not exceed total_stock minus total_sold; if it does, the transaction - * will fail with a #MHD_HTTP_CONFLICT HTTP status code - * @param address where the product is in stock - * @param next_restock when the next restocking is expected to happen, 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for 'never'. - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_product ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - json_t *description_i18n, - const char *unit, - const char *price, - const char *image, - json_t *taxes, - int64_t total_stock, - uint64_t total_lost, - json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - unsigned int http_status); - - -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_product2 ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - json_t *description_i18n, - const char *unit, - const char *price, - const char *image, - json_t *taxes, - int64_t total_stock, - uint32_t total_stock_frac, - bool unit_allow_fraction, - uint64_t total_lost, - json_t *address, - struct GNUNET_TIME_Timestamp next_restock, - unsigned int http_status); - -/** - * Define a "PATCH /products/$ID" CMD with explicit unit_price array. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /product request. - * @param product_id the ID of the product to query - * @param description description of the product - * @param unit unit in which the product is measured - * @param unit_prices array of unit prices as strings - * @param unit_prices_len length of @a unit_prices - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_product_with_unit_prices ( - const char *label, - const char *merchant_url, - const char *product_id, - const char *description, - const char *unit, - const char *const *unit_prices, - size_t unit_prices_len, - unsigned int http_status); - - -/** - * Define a "GET /products" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /products request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * product (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_products (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - -/** - * Expectations for fractional unit fields when checking a product. - */ -struct TALER_TESTING_ProductUnitExpectations -{ - /** - * Whether @e unit_allow_fraction is provided. - */ - bool have_unit_allow_fraction; - - /** - * Expected fractional flag. - */ - bool unit_allow_fraction; - - /** - * Whether @e unit_precision_level is provided. - */ - bool have_unit_precision_level; - - /** - * Expected fractional precision. - */ - uint32_t unit_precision_level; -}; - - -/** - * Define a "GET product" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /products/$ID request. - * @param product_id the ID of the product to query - * @param http_status expected HTTP response code. - * @param product_reference reference to a "POST /products" or "PATCH /products/$ID" CMD - * that will provide what we expect the backend to return to us - * @param unit_expectations optional explicit expectations for the fractional fields - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_product2 ( - const char *label, - const char *merchant_url, - const char *product_id, - unsigned int http_status, - const char *product_reference, - const struct TALER_TESTING_ProductUnitExpectations *unit_expectations); - - -/** - * Legacy helper kept for compatibility. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_product (const char *label, - const char *merchant_url, - const char *product_id, - unsigned int http_status, - const char *product_reference); - -struct TALER_TESTING_Command -TALER_TESTING_cmd_get_product_image (const char *label, - const char *merchant_url, - const char *product_reference, - const char *image_hash, - unsigned int http_status); - - -/** - * Define a "LOCK /products/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * LOCK /product request. - * @param product_id the ID of the product to lock. - * @param duration how long the lock should last. - * @param quantity how money units to lock. - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_lock_product ( - const char *label, - const char *merchant_url, - const char *product_id, - struct GNUNET_TIME_Relative duration, - uint32_t quantity, - unsigned int http_status); - - -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_lock_product2 ( - const char *label, - const char *merchant_url, - const char *product_id, - struct GNUNET_TIME_Relative duration, - uint32_t quantity, - uint32_t quantity_frac, - bool use_fractional_quantity, - unsigned int http_status); - - -/** - * Define a "DELETE product" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /products/$ID request. - * @param product_id the ID of the product to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_product (const char *label, - const char *merchant_url, - const char *product_id, - unsigned int http_status); - - -/* ******************* /orders **************** */ - -/** - * Make the "proposal" command. - * - * @param label command label - * @param cfg configuration to use - * @param merchant_url base URL of the merchant serving - * the proposal request. - * @param http_status expected HTTP status. - * @param order_id the name of the order to add. - * @param refund_deadline the deadline for refunds on this order. - * @param pay_deadline the deadline for payment on this order. - * @param amount the amount this order is for. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders ( - const char *label, - const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *merchant_url, - unsigned int http_status, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - const char *amount); - - -/** - * Make the "proposal" command AVOIDING claiming the order. - * - * @param label command label - * @param merchant_url base URL of the merchant serving - * the proposal request. - * @param http_status expected HTTP status. - * @param order_id the name of the order to add. - * @param refund_deadline the deadline for refunds on this order. - * @param pay_deadline the deadline for payment on this order. - * @param amount the amount this order is for. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders_no_claim ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - const char *amount); - - -/** - * Make the "proposal" command. - * - * @param label command label - * @param cfg configuration to use - * @param merchant_url base URL of the merchant serving - * the proposal request. - * @param http_status expected HTTP status. - * @param order_id the name of the order to add. - * @param refund_deadline the deadline for refunds on this order. - * @param pay_deadline the deadline for payment on this order. - * @param claim_token whether to generate a claim token. - * @param amount the amount this order is for. - * @param payment_target payment target for the order. - * @param products a string indicating the products this order will be - * purchasing. Should be formatted as - * "[product_id]/[quantity];...". - * @param locks a string of references to lock product commands that should - * be formatted as "[lock_1];[lock_2];...". - * @param duplicate_of if not NULL, a reference to a previous order command - * that should be duplicated and checked for an identical response. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders2 ( - const char *label, - const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *merchant_url, - unsigned int http_status, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - bool claim_token, - const char *amount, - const char *payment_target, - const char *products, - const char *locks, - const char *duplicate_of); - - -/** - * Create an order with a specific fulfillment URL. - * Does not claim the order. - * - * @param label command label - * @param cfg configuration to use - * @param merchant_url base URL of the merchant serving - * the proposal request - * @param http_status expected HTTP status - * @param order_id ID of the order to create - * @param refund_deadline the deadline for refunds on this order - * @param pay_deadline the deadline for payment on this order - * @param fulfillment_url the fulfillment URL to use - * @param amount the amount this order is for - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders3 ( - const char *label, - const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *merchant_url, - unsigned int http_status, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - const char *fulfillment_url, - const char *amount); - - -/** - * Create an order with a choices array with input and output tokens. - * - * @param label command label - * @param cfg configuration to use - * @param merchant_url base URL of the merchant serving - * the proposal request. - * @param http_status expected HTTP status. - * @param token_family_slug slug of the token family to use - * @param choice_description description of the choice - * @param choice_description_i18n json of description translations - * @param num_inputs number of input tokens. - * @param num_outputs number of output tokens. - * @param order_id the name of the order to add. - * @param refund_deadline the deadline for refunds on this order. - * @param pay_deadline the deadline for payment on this order. - * @param amount the amount this order is for. - * @return the command - */ - -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders_choices ( - const char *label, - const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *merchant_url, - unsigned int http_status, - const char *token_family_slug, - const char *choice_description, - json_t *choice_description_i18n, - unsigned int num_inputs, - unsigned int num_outputs, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - const char *amount); - - -/** - * Create an order with a choices array with output choice for donau. - * - * @param label command label - * @param cfg configuration to use - * @param merchant_url base URL of the merchant serving - * the proposal request. - * @param http_status expected HTTP status. - * @param order_id the name of the order to add. - * @param refund_deadline the deadline for refunds on this order. - * @param pay_deadline the deadline for payment on this order. - * @param amount the amount this order is for. - * @return the command - */ - -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders_donau ( - const char *label, - const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *merchant_url, - unsigned int http_status, - const char *order_id, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - const char *amount); - -/** - * Define a "GET /orders" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /orders request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * order (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_orders (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Start a long poll for GET /private/orders. - * - * FIXME: needs additional arguments to specify range to long poll for! - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param timeout how long to wait for the request to complete - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_poll_orders_start (const char *label, - const char *merchant_url, - struct GNUNET_TIME_Relative timeout); - - -/** - * Complete a long poll for GET /private/orders. - * - * @param label the command label - * @param http_status expected HTTP response code - * @param poll_start_reference reference to the #TALER_TESTING_cmd_poll_orders_start command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_poll_orders_conclude ( - const char *label, - unsigned int http_status, - const char *poll_start_reference); - - -/** - * Define a GET /orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param paid whether the order has been paid for or not. - * @param refunded whether the order has been refunded. - * @param refund_pending whether the order has refunds that haven't been obtained. - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_get_order ( - const char *label, - const char *merchant_url, - const char *order_reference, - bool paid, - bool refunded, - bool refund_pending, - unsigned int http_status); - - -/** - * Define a GET /orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param session_id session ID to check for - * @param paid whether the order has been paid for or not. - * @param refunded whether the order has been refunded. - * @param refund_pending whether the order has refunds that haven't been obtained. - * @param repurchase_order_ref command of a paid equivalent order the merchant should be referring us to, or NULL - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_get_order2 ( - const char *label, - const char *merchant_url, - const char *order_reference, - const char *session_id, - bool paid, - bool refunded, - bool refund_pending, - const char *repurchase_order_ref, - unsigned int http_status); - - -/** - * Start a long poll for GET /orders/$ORDER_ID. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_ref reference to a command that created an order. - * @param timeout how long to wait for the request to complete - * @param await_refund NULL to not wait for refund, amount of value - * zero to wait for any refund amount, non-zero to poll - * for refund exceeding the given amount - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_poll_order_start ( - const char *label, - const char *merchant_url, - const char *order_ref, - struct GNUNET_TIME_Relative timeout, - const char *await_refund); - - -/** - * Start a long poll for GET /orders/$ORDER_ID. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_ref reference to a command that created an order. - * @param timeout how long to wait for the request to complete - * @param await_refund NULL to not wait for refund, amount of value - * zero to wait for any refund amount, non-zero to poll - * for refund exceeding the given amount - * @param session_id which session ID to use - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_poll_order_start2 ( - const char *label, - const char *merchant_url, - const char *order_ref, - struct GNUNET_TIME_Relative timeout, - const char *await_refund, - const char *session_id); - - -/** - * Complete a long poll for GET /orders/$ORDER_ID. - * - * @param label the command label - * @param expected_http_status expected HTTP response code - * @param expected_refund_amount refund expected, NULL for no refund expected - * @param poll_start_reference reference to the #TALER_TESTING_cmd_wallet_poll_order_start command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_poll_order_conclude ( - const char *label, - unsigned int expected_http_status, - const char *expected_refund_amount, - const char *poll_start_reference); - - -/** - * Complete a long poll for GET /orders/$ORDER_ID. - * - * @param label the command label - * @param expected_http_status expected HTTP response code - * @param expected_refund_amount refund expected, NULL for no refund expected - * @param poll_start_reference reference to the #TALER_TESTING_cmd_wallet_poll_order_start command - * @param already_paid_order_id ID of an already paid order we expect to get returned - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_poll_order_conclude2 ( - const char *label, - unsigned int expected_http_status, - const char *expected_refund_amount, - const char *poll_start_reference, - const char *already_paid_order_id); - - -/** - * Define a GET /private/orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param osc expected order status - * @param refunded whether the order has been refunded. - * @param http_status expected HTTP response code for the request. - * @param ... NULL-terminated list of labels (const char *) of - * refunds (commands) we expect to be aggregated in the transfer - * (assuming @a http_code is #MHD_HTTP_OK). If @e refunded is false, - * this parameter is ignored. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_order ( - const char *label, - const char *merchant_url, - const char *order_reference, - enum TALER_MERCHANT_OrderStatusCode osc, - bool refunded, - unsigned int http_status, - ...); - - -/** - * Define a GET /private/orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param osc expected order status - * @param wired whether the order has been wired or not. - * @param transfers NULL-terminated list of labels (const char *) of - * wire transfers (commands) we expect to be aggregated in the order - * (assuming @a http_code is #MHD_HTTP_OK). If @e paid is false, this - * parameter is ignored. - * @param refunded whether the order has been refunded. - * @param refunds NULL-terminated list of labels (const char *) of - * refunds (commands) we expect to be aggregated in the order - * (assuming @a http_code is #MHD_HTTP_OK). If @e refunded is false, - * this parameter is ignored. - * @param forgets a NULL-terminated list of references to forget commands - * that apply to the order we are querying. If NULL, this is - * interpreted as no forgets are expected. - * @param http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_order2 ( - const char *label, - const char *merchant_url, - const char *order_reference, - enum TALER_MERCHANT_OrderStatusCode osc, - bool wired, - const char **transfers, - bool refunded, - const char **refunds, - const char **forgets, - unsigned int http_status); - - -/** - * Define a GET /private/orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param osc expected order status - * @param session_id session ID the payment must be bound to - * @param repurchase_order_ref command of a paid equivalent order the merchant should be referring us to, or NULL - * @param expected_http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_order3 ( - const char *label, - const char *merchant_url, - const char *order_reference, - enum TALER_MERCHANT_OrderStatusCode osc, - const char *session_id, - const char *repurchase_order_ref, - unsigned int expected_http_status); - - -/** - * Define a GET /private/orders/$ORDER_ID CMD. - * - * @param label the command label - * @param merchant_url base URL of the merchant which will - * serve the request. - * @param order_reference reference to a command that created an order. - * @param osc expected order status - * @param expected_min_age expected minimum age for the contract - * @param expected_http_status expected HTTP response code for the request. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_order4 ( - const char *label, - const char *merchant_url, - const char *order_reference, - enum TALER_MERCHANT_OrderStatusCode osc, - uint32_t expected_min_age, - unsigned int expected_http_status); - - -/** - * Start a long poll for GET /private/orders/$ORDER_ID. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_poll_order_start (const char *label, - const char *merchant_url, - const char *order_id, - struct GNUNET_TIME_Relative timeout); - - -/** - * Complete a long poll for GET /private/orders/$ORDER_ID. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_poll_order_conclude (const char *label, - unsigned int http_status, - const char *poll_start_reference); - -/** - * Make a "claim order" command. - * - * @param label command label. - * @param merchant_url base URL of the merchant backend - * serving the proposal lookup request. - * @param http_status expected HTTP response code. - * @param order_reference reference to a POST order CMD, can be NULL if @a order_id given - * @param order_id order id to lookup, can be NULL (then we use @a order_reference) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_claim_order (const char *label, - const char *merchant_url, - unsigned int http_status, - const char *order_reference, - const char *order_id); - - -/** - * Make a "pay" test command. - * - * @param label command label. - * @param merchant_url merchant base url - * @param http_status expected HTTP response code. - * @param proposal_reference the proposal whose payment status - * is going to be checked. - * @param coin_reference reference to any command which is able - * to provide coins to use for paying. - * @param amount_with_fee amount to pay, including the deposit - * fee - * @param amount_without_fee amount to pay, no fees included. - * @param session_id the session id to use for the payment (can be NULL). - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_pay_order ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *proposal_reference, - const char *coin_reference, - const char *amount_with_fee, - const char *amount_without_fee, - const char *session_id); - - -/** - * Make a "pay" test command for an order with choices. - * - * @param label command label. - * @param merchant_url merchant base url - * @param http_status expected HTTP response code. - * @param proposal_reference the proposal whose payment status - * is going to be checked. - * @param coin_reference reference to any command which is able - * to provide coins to use for paying. - * @param amount_with_fee amount to pay, including the deposit - * fee - * @param amount_without_fee amount to pay, no fees included. - * @param session_id the session id to use for the payment (can be NULL). - * @param choice_index index of the selected choice for the payment. - * @param input_reference reference to a previous pay command that issued some - outputs to be used as inputs to this pay request. - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_pay_order_choices ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *proposal_reference, - const char *coin_reference, - const char *amount_with_fee, - const char *amount_without_fee, - const char *session_id, - int choice_index, - const char *input_reference); - -#ifdef HAVE_DONAU_DONAU_SERVICE_H - -/** - * Make a "pay" test command for an order with choices. - * - * @param label command label. - * @param merchant_url merchant base url - * @param http_status expected HTTP response code. - * @param proposal_reference the proposal whose payment status - * is going to be checked. - * @param coin_reference reference to any command which is able - * to provide coins to use for paying. - * @param amount_with_fee amount to pay, including the deposit - * fee - * @param amount_without_fee amount to pay, no fees included. - * @param amount_donation amount for which the BKPS will be received. - * @param session_id the session id to use for the payment (can be NULL). - * @param choice_index index of the selected choice for the payment. - * @param year year of the donation - * @param donor_tax_id tax ID of the donor - * @param salt salt for the donation - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_pay_order_donau ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *proposal_reference, - const char *coin_reference, - const char *amount_with_fee, - const char *amount_without_fee, - const char *amount_donation, - const char *session_id, - int choice_index, - const char *charity_reference, - uint64_t year, - const char *donor_tax_id, - const char *salt); - -#endif - -/** - * Make an "order paid" test command. - * - * @param label command label - * @param merchant_url merchant base URL - * @param pay_reference reference to the payment to verify - * @param session_id the session to use for the verification. - * @param http_status expected HTTP response code - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_orders_paid ( - const char *label, - const char *merchant_url, - const char *pay_reference, - const char *session_id, - unsigned int http_status); - - -/** - * Make an "abort" test command. - * - * @param label command label - * @param merchant_url merchant base URL - * @param pay_reference reference to the payment to abort - * @param http_status expected HTTP response code - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_order_abort ( - const char *label, - const char *merchant_url, - const char *pay_reference, - unsigned int http_status); - - -/** - * Make a "order forget" command. - * - * @param label command label. - * @param merchant_url base URL of the merchant backend - * serving the order claim request. - * @param http_status expected HTTP response code. - * @param order_reference reference to a POST order CMD, can be NULL if @a order_id given - * @param order_id order id to forget for, can be NULL (then we use @a order_reference) - * @param ... NULL-terminated list of paths (const char *) to forget in - * the contract terms. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_forget_order ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *order_reference, - const char *order_id, - ...); - - -/** - * Define a "refund" order CMD. - * - * @param label command label. - * @param merchant_url base URL of the backend serving the - * "refund increase" request. - * @param reason refund justification, human-readable. - * @param order_id order id of the contract to refund. - * @param refund_amount amount to be refund-increased. - * @param http_code expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_order_refund ( - const char *label, - const char *merchant_url, - const char *reason, - const char *order_id, - const char *refund_amount, - unsigned int http_code); - - -/** - * Define a "refund order" CMD. - * - * @param label command label. - * @param merchant_url base URL of the backend serving the - * "refund increase" request. - * @param order_ref order id of the contract to refund. - * @param http_code expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * refunds (commands) we expect to be aggregated in the transfer - * (assuming @a http_code is #MHD_HTTP_OK). If @e refunded is false, - * this parameter is ignored. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_wallet_order_refund ( - const char *label, - const char *merchant_url, - const char *order_ref, - unsigned int http_code, - ...); - - -/** - * Define a "DELETE order" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /instances/$ID request. - * @param order_id the ID of the instance to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_order ( - const char *label, - const char *merchant_url, - const char *order_id, - unsigned int http_status); - - -/* ******************* /transfers *************** */ - - -/** - * Define a POST /transfers CMD. Details like the WTID and - * other required parameters will be extracted from the bank - * history, using the latest transfer of the specified - * @a credit_amount to the @a merchant_url. - * - * @param label command label. - * @param auth credentials to access the exchange's bank account - * @param payto_uri URL of the exchange's bank account - * @param merchant_url base URL of the backend serving the - * "refund increase" request. - * @param credit_amount amount credited - * @param http_code expected HTTP response code - * @param ... NULL-terminated list of labels (const char *) of - * deposit (commands) we expect to be aggregated in the transfer - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_transfer ( - const char *label, - const struct TALER_BANK_AuthenticationData *auth, - struct TALER_FullPayto payto_uri, - const char *merchant_url, - const char *credit_amount, - unsigned int http_code, - ...); - - -/** - * Define a POST /transfers CMD. Details like the WTID and - * other required parameters are explicitly provided. - * - * @param label command label. - * @param merchant_url base URL of the backend - * @param payto_uri URL of the exchange's bank account - * @param credit_amount amount credited - * @param wtid wire transfer ID to use, NULL to pick one at random - * @param exchange_url URL of the exchange to use - * @param http_code expected HTTP response code - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_transfer2 ( - const char *label, - const char *merchant_url, - struct TALER_FullPayto payto_uri, - const char *credit_amount, - const char *wtid, - const char *exchange_url, - unsigned int http_code); - - -/** - * We have discovered the @a serial for a POST transfer - * command. Store it (for the bank row trait). - * - * @param cmd command to update - * @param serial serial number to store (identifies the row) - */ -void -TALER_TESTING_cmd_merchant_post_transfer_set_serial ( - struct TALER_TESTING_Command *cmd, - uint64_t serial); - - -/** - * Define a GET /transfers CMD. - * - * @param label command label. - * @param merchant_url base URL of the backend serving the - * "refund increase" request. - * @param payto_uri payto URI to filter by, NULL for no filter - * @param http_code expected HTTP response code - * @param ... NULL-terminated list of labels (const char *) of - * transfer (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_transfers ( - const char *label, - const char *merchant_url, - struct TALER_FullPayto payto_uri, - unsigned int http_code, - ...); - - -/** - * Define a "DELETE transfer" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant for the - * DELETE /transfers/$ID request. - * @param transfer_ref reference to a command that - * yields the transfer ID to delete - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_transfer (const char *label, - const char *merchant_url, - const char *transfer_ref, - unsigned int http_status); - - -/** - * Run a command to fetch the KYC status of a merchant. - * - * @param label the command label - * @param merchant_url base URL of the merchant - * @param instance_id instance to use, NULL if instance is part of @a merchant_url - * @param h_wire_ref label of command with a merchant wire hash trait - * of the bank account to check KYC for; NULL to check all accounts - * @param exchange_url base URL of the exchange to check KYC status for - * @param lpt target for long polling - * @param expected_http_status expected HTTP status - * @param expected_kyc_state expected KYC state (only effective if @e expected_http_status is #MHD_HTTP_OK/#MHD_HTTP_ACCEPTED) - * @return the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_kyc_get ( - const char *label, - const char *merchant_url, - const char *instance_id, - const char *h_wire_ref, - const char *exchange_url, - enum TALER_EXCHANGE_KycLongPollTarget lpt, - unsigned int expected_http_status, - bool expected_kyc_state); - - -/* ****** OTP devices ******* */ - - -/** - * Define a "POST /otp-devices" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /otps request. - * @param otp_id the ID of the otp device to modify - * @param otp_description description of the otp device - * @param otp_key base32-encoded key to verify the payment - * @param otp_alg is an option that show the amount of the order. it is linked with the @a otp_key - * @param otp_ctr counter to use (if in counter mode) - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_otp_devices ( - const char *label, - const char *merchant_url, - const char *otp_id, - const char *otp_description, - const char *otp_key, - enum TALER_MerchantConfirmationAlgorithm otp_alg, - uint64_t otp_ctr, - unsigned int http_status); - - -/** - * Define a "PATCH /otp-devices/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /otp-devices request. - * @param otp_id the ID of the otp device to modify - * @param otp_description description of the otp device - * @param otp_key base32-encoded key to verify the payment - * @param otp_alg is an option that show the amount of the order. it is linked with the @a otp_key - * @param otp_ctr counter to use (if in counter mode) - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_otp_device ( - const char *label, - const char *merchant_url, - const char *otp_id, - const char *otp_description, - const char *otp_key, - enum TALER_MerchantConfirmationAlgorithm otp_alg, - uint64_t otp_ctr, - unsigned int http_status); - - -/** - * Define a "GET /otp-devices" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /otp-devices request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * otp (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_otp_devices (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "GET otp device" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /otp-devices/$ID request. - * @param otp_id the ID of the otp to query - * @param http_status expected HTTP response code. - * @param otp_reference reference to a "POST /otp-devices" or "PATCH /otp-devices/$ID" CMD - * that will provide what we expect the backend to return to us - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_otp_device (const char *label, - const char *merchant_url, - const char *otp_id, - unsigned int http_status, - const char *otp_reference); - - -/** - * Define a "DELETE otp device" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /otp-devices/$ID request. - * @param otp_id the ID of the otp to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_otp_device (const char *label, - const char *merchant_url, - const char *otp_id, - unsigned int http_status); - - -/* ****** Templates ******* */ - -/** - * Define a "POST /units" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param unit_id identifier of the unit. - * @param unit_name_long long label to store. - * @param unit_name_short short label to store. - * @param unit_allow_fraction whether fractional quantities are allowed. - * @param unit_precision_level fractional precision level. - * @param unit_active whether the unit starts active. - * @param unit_name_long_i18n optional translations for the long label. - * @param unit_name_short_i18n optional translations for the short label. - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_units (const char *label, - const char *merchant_url, - const char *unit_id, - const char *unit_name_long, - const char *unit_name_short, - bool unit_allow_fraction, - uint32_t unit_precision_level, - bool unit_active, - json_t *unit_name_long_i18n, - json_t *unit_name_short_i18n, - unsigned int http_status); - - -/** - * Define a "PATCH /units/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param unit_id identifier of the unit to patch. - * @param unit_name_long optional new long label (NULL to skip). - * @param unit_name_short optional new short label (NULL to skip). - * @param unit_name_long_i18n optional new long label translations (NULL to skip). - * @param unit_name_short_i18n optional new short label translations (NULL to skip). - * @param unit_allow_fraction optional pointer to new fractional flag (NULL to skip). - * @param unit_precision_level optional pointer to new precision level (NULL to skip). - * @param unit_active optional pointer to new active flag (NULL to skip). - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_unit ( - const char *label, - const char *merchant_url, - const char *unit_id, - const char *unit_name_long, - const char *unit_name_short, - json_t *unit_name_long_i18n, - json_t *unit_name_short_i18n, - const bool unit_allow_fraction, - const uint32_t unit_precision_level, - const bool unit_active, - unsigned int http_status); - - -/** - * Define a "GET /units" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) whose units must - * appear in the response (verified when @a http_status is #MHD_HTTP_OK). - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_units (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "GET /units/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param unit_id identifier to fetch. - * @param http_status expected HTTP response code. - * @param reference optional label of a command providing expected unit traits. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_unit (const char *label, - const char *merchant_url, - const char *unit_id, - unsigned int http_status, - const char *reference); - - -/** - * Define a "DELETE /units/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the request. - * @param unit_id identifier to delete. - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_unit (const char *label, - const char *merchant_url, - const char *unit_id, - unsigned int http_status); - - -/** - * Define a "POST /templates" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /templates request. - * @param template_id the ID of the template to query - * @param template_description description of the template - * @param otp_id OTP device ID, NULL for none - * @param template_contract where the contract of the company is - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_templates2 ( - const char *label, - const char *merchant_url, - const char *template_id, - const char *template_description, - const char *otp_id, - json_t *template_contract, - unsigned int http_status); - - -/** - * Define a "POST /templates" CMD, simple version - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /templates request. - * @param template_id the ID of the template to create - * @param template_description description of the template - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_templates (const char *label, - const char *merchant_url, - const char *template_id, - const char *template_description, - unsigned int http_status); - - -/** - * Define a "PATCH /templates/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /template request. - * @param template_id the ID of the template to query - * @param template_description description of the template - * @param otp_id OTP device to use - * @param template_contract contract of the company - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_template ( - const char *label, - const char *merchant_url, - const char *template_id, - const char *template_description, - const char *otp_id, - json_t *template_contract, - unsigned int http_status); - - -/** - * Define a "GET /templates" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /templates request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * template (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_templates (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "GET template" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /templates/$ID request. - * @param template_id the ID of the template to query - * @param http_status expected HTTP response code. - * @param template_reference reference to a "POST /templates" or "PATCH /templates/$ID" CMD - * that will provide what we expect the backend to return to us - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_template (const char *label, - const char *merchant_url, - const char *template_id, - unsigned int http_status, - const char *template_reference); - - -/** - * Define a "DELETE template" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /templates/$ID request. - * @param template_id the ID of the template to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_template (const char *label, - const char *merchant_url, - const char *template_id, - unsigned int http_status); - - -/** - * Define a "POST /using-templates" CMD, simple version - * - * @param label command label. - * @param template_ref label of command that created the template to use - * @param otp_ref label of command that created OTP device we use (or NULL for no OTP) - * @param merchant_url base URL of the merchant serving the - * POST /using-templates request. - * @param using_template_id template ID to use - * @param summary given by the customer to know what they did pay - * @param amount given by the customer to pay - * @param refund_deadline refund deadline to use for the contract - * @param pay_deadline pay deadline to use for the contract - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_using_templates ( - const char *label, - const char *template_ref, - const char *otp_ref, - const char *merchant_url, - const char *using_template_id, - const char *summary, - const char *amount, - struct GNUNET_TIME_Timestamp refund_deadline, - struct GNUNET_TIME_Timestamp pay_deadline, - unsigned int http_status); - -/** - * Define a "POST /using-templates" CMD with a raw JSON request body. - * - * @param label command label. - * @param template_ref label of command that created the template to use - * @param otp_ref label of command that created OTP device we use (or NULL for no OTP) - * @param merchant_url base URL of the merchant serving the - * POST /using-templates request. - * @param using_template_id template ID to use - * @param details raw JSON request body to send - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_using_templates2 ( - const char *label, - const char *template_ref, - const char *otp_ref, - const char *merchant_url, - const char *using_template_id, - const json_t *details, - unsigned int http_status); - - -/* ****** Token Families ******* */ - - -/** - * Define a "POST /tokenfamilies" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /tokenfamilies request. - * @param http_status expected HTTP response code. - * @param slug slug of the token family. - * @param name name of the token family. - * @param description description of the token family. - * @param description_i18n internationalized description of the token family. - * @param valid_after start of the validity time of the token family. - * @param valid_before end of the validity time of the token family. - * @param duration validity duration of an issued token of the token family. - * @param rounding to multiples of what duration should start times be rounded - * @param kind kind of the token family. either "subscription" or "discount". - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_tokenfamilies ( - const char *label, - const char *merchant_url, - unsigned int http_status, - const char *slug, - const char *name, - const char *description, - json_t *description_i18n, - struct GNUNET_TIME_Timestamp valid_after, - struct GNUNET_TIME_Timestamp valid_before, - struct GNUNET_TIME_Relative duration, - struct GNUNET_TIME_Relative rounding, - const char *kind); - -/* ****** Webhooks ******* */ - - -/** - * Define a "POST /webhooks" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /webhooks request. - * @param webhook_id the ID of the webhook to query - * @param event_type event of the webhook - * @param url use by the customer - * @param http_method use by the merchant - * @param header_template of the webhook - * @param body_template of the webhook - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_webhooks2 ( - const char *label, - const char *merchant_url, - const char *webhook_id, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template, - unsigned int http_status); - - -/** - * Define a "POST /webhooks" CMD, simple version - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * POST /webhooks request. - * @param webhook_id the ID of the webhook to query - * @param event_type event of the webhook - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_webhooks (const char *label, - const char *merchant_url, - const char *webhook_id, - const char *event_type, - unsigned int http_status); - - -/** - * Define a "PATCH /webhooks/$ID" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * PATCH /webhook request. - * @param webhook_id the ID of the webhook to query - * @param event_type event of the webhook - * @param url use by the customer - * @param http_method use by the merchant - * @param header_template of the webhook - * @param body_template of the webhook - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_patch_webhook ( - const char *label, - const char *merchant_url, - const char *webhook_id, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template, - unsigned int http_status); - - -/** - * Define a "GET /webhooks" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /webhooks request. - * @param http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * webhook (commands) we expect to be returned in the list - * (assuming @a http_code is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_webhooks (const char *label, - const char *merchant_url, - unsigned int http_status, - ...); - - -/** - * Define a "GET webhook" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * GET /templates/$ID request. - * @param webhook_id the ID of the webhook to query - * @param http_status expected HTTP response code. - * @param webhook_reference reference to a "POST /webhooks" or "PATCH /webhooks/$ID" CMD - * that will provide what we expect the backend to return to us - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_webhook (const char *label, - const char *merchant_url, - const char *webhook_id, - unsigned int http_status, - const char *webhook_reference); - - -/** - * Define a "DELETE webhook" CMD. - * - * @param label command label. - * @param merchant_url base URL of the merchant serving the - * DELETE /webhooks/$ID request. - * @param webhook_id the ID of the webhook to query - * @param http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_webhook (const char *label, - const char *merchant_url, - const char *webhook_id, - unsigned int http_status); - -/** - * Command to run the 'taler-merchant-webhook' program. - * - * @param label command label. - * @param config_filename configuration file used by the webhook. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_webhook (const char *label, - const char *config_filename); - - -/** - * Command to run the 'taler-merchant-depositcheck' program. - * - * @param label command label. - * @param config_filename configuration file used by the deposit check helper. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_depositcheck (const char *label, - const char *config_filename); - - -/** - * Command to run the 'taler-merchant-exchange' program. - * - * @param label command label. - * @param config_filename configuration file used by the webhook. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_run_tme (const char *label, - const char *config_filename); - - -/** - * This function is used to start the web server. - * - * @param label command label - * @param port is the port of the web server - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_testserver (const char *label, - uint16_t port); - - -/** - * This function is used to check the web server got the - * expected request from the web hook. - * - * @param label command label - * @param ref_operation reference to command to the previous set server status operation. - * @param index index to know which web server we check. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_checkserver (const char *label, - const char *ref_operation, - unsigned int index); - - -/** - * This function is used to check that the web server - * got the expected request from the web hook. - * - * @param label command label - * @param ref_operation reference to command to the previous set server status operation. - * @param index index to know which web server we check. - * @param expected_url url of the webhook - * @param expected_method method of the webhook - * @param expected_header header of the webhook - * @param expected_body body of the webhook - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_checkserver2 (const char *label, - const char *ref_operation, - unsigned int index, - const char *expected_url, - const char *expected_method, - const char *expected_header, - const char *expected_body); - - -#ifdef HAVE_DONAU_DONAU_SERVICE_H -/** - * This function is the similar to the TALER_TESSTING_cmd_charity_post from DONAU - * with only difference that it reuses the merchant public key, from the merchant test-suite. - * - * @param label command label - * @param name name of the charity - * @param url url of the charity - * @param max_per_year maximum amount of donations per year - * @param bearer - * @param merchant_reference reference to fetch the merchant public key - * @param expected_response_code expected HTTP response code - * @return - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_charity_post_merchant ( - const char *label, - const char *name, - const char *url, - const char *max_per_year, - const struct DONAU_BearerToken *bearer, - const char *merchant_reference, - unsigned int expected_response_code); - -#endif /* HAVE_DONAU_DONAU_SERVICE_H */ - -/** - * Define a "GET /donau" CMD. - * - * @param label command label. - * @param url base URL of the Donau we are looking for instances of. - * @param instance_count number of instances we expect to be returned. - * @param expected_http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * donau instances (commands) we expect to be returned in the list - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_donau_instances (const char *label, - const char *url, - unsigned int instance_count, - unsigned int - expected_http_status, - ...); - - -/** - * Define a "POST /donau" CMD. - * - * @param label command label. - * @param url base URL of the Donau service serving the - * GET /donau_instances request. - * @param merchant_reference string reference to get the testing traits - * @param expected_http_status expected HTTP response code. - * @param ... NULL-terminated list of labels (const char *) of - * donau instances (commands) we expect to be returned in the list - * (assuming @a expected_http_status is #MHD_HTTP_OK) - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_post_donau_instance (const char *label, - const char *url, - const char *merchant_reference, - unsigned int - expected_http_status, - ...); - - -/** - * Define a "DELETE /donau/$charity_id" CMD. - * - * @param label command label. - * @param url base URL of the Donau service serving the - * DELETE /donau/$charity_id request. - * @param charity_id the ID of the charity to delete. - * @param expected_http_status expected HTTP response code. - * @return the command. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_delete_donau_instance (const char *label, - const char *url, - uint64_t charity_id, - unsigned int - expected_http_status); - -/** - * This function is used to check the statistics counter API - * - * @param label command label - * @param merchant_url base URL of the merchant serving the API - * @param slug base statistics slug - * @param buckets_length expected length of buckets array - * @param intervals_length expected length of intervals array - * @param http_status expected HTTP response code. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_statisticscounter (const char *label, - const char *merchant_url, - const char *slug, - uint64_t buckets_length, - uint64_t intervals_length, - unsigned int http_status); - -/** - * This function is used to check the statistics amount API - * - * @param label command label - * @param merchant_url base URL of the merchant serving the API - * @param slug base statistics slug - * @param buckets_length expected length of buckets array - * @param intervals_length expected length of intervals array - * @param http_status expected HTTP response code. - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_merchant_get_statisticsamount (const char *label, - const char *merchant_url, - const char *slug, - uint64_t buckets_length, - uint64_t intervals_length, - unsigned int http_status); - - -/** - * Run the taler-merchant-donaukeyupdate command (with -t). - * - * @param label command label - * @param config_filename configuration file to pass to the command - */ -struct TALER_TESTING_Command -TALER_TESTING_cmd_exec_donaukeyupdate (const char *label, - const char *config_filename); - - -/* ****** Specific traits supported by this component ******* */ - - -/** - * Call @a op on all simple traits. - * - * @param op macro to call - */ -// FIXME: rename: refund_entry->refund_detail -#define TALER_MERCHANT_TESTING_SIMPLE_TRAITS(op) \ - op (claim_nonce, const struct GNUNET_CRYPTO_EddsaPublicKey) \ - op (pickup_id, const struct TALER_PickupIdentifierP) \ - op (instance_name, const char) \ - op (instance_id, const char) \ - op (address, const json_t) \ - op (category_id, const uint64_t) \ - op (product_description, const char) \ - op (product_image, const char) \ - op (product_stock, const int64_t) \ - op (product_unit_total_stock, const char) \ - op (product_unit_precision_level, const uint32_t) \ - op (product_unit_allow_fraction, const bool) \ - op (product_unit, const char) \ - op (product_id, const char) \ - op (unit_id, const char) \ - op (unit_name_long, const char) \ - op (unit_name_short, const char) \ - op (unit_allow_fraction, const bool) \ - op (unit_precision_level, const uint32_t) \ - op (unit_active, const bool) \ - op (unit_builtin, const bool) \ - op (unit_name_long_i18n, const json_t) \ - op (unit_name_short_i18n, const json_t) \ - op (reason, const char) \ - op (lock_uuid, const char) \ - op (auth_token, const char) \ - op (bearer_token, const char) \ - op (paths_length, const uint32_t) \ - op (payto_length, const uint32_t) \ - op (num_planchets, const uint32_t) \ - op (i18n_description, const json_t) \ - op (taxes, const json_t) \ - op (fee, const struct TALER_Amount) \ - op (use_stefan, const bool) \ - op (jurisdiction, const json_t) \ - op (wire_delay, const struct GNUNET_TIME_Relative) \ - op (pay_delay, const struct GNUNET_TIME_Relative) \ - op (refund_entry, const struct TALER_MERCHANT_RefundDetail) \ - op (order_terms, const json_t) \ - op (h_contract_terms, const struct TALER_PrivateContractHashP) \ - op (h_wire, const struct TALER_MerchantWireHashP) \ - op (proposal_reference, const char) \ - op (template_description, const char) \ - op (otp_device_description, const char) \ - op (otp_id, const char) \ - op (otp_key, const char) \ - op (otp_alg, const enum TALER_MerchantConfirmationAlgorithm) \ - op (template_id, const char) \ - op (template_contract, const json_t) \ - op (event_type, const char) \ - op (webhook_id, const char) \ - op (merchant_base_url, const char) \ - op (url, const char) \ - op (http_method, const char) \ - op (header_template, const char) \ - op (body_template, const char) \ - op (summary, const char) \ - op (token_family_slug, const char) \ - op (token_family_duration, const struct GNUNET_TIME_Relative) \ - op (token_family_kind, const char) - - -/** - * Call @a op on all indexed traits. - * - * @param op macro to call - */ -#define TALER_MERCHANT_TESTING_INDEXED_TRAITS(op) \ - op (coin_reference, const char) \ - op (paths, const char) \ - op (payto_uris, const struct TALER_FullPayto) \ - op (h_wires, const struct TALER_MerchantWireHashP) \ - op (amounts, const struct TALER_Amount) \ - op (urls, const char) \ - op (http_methods, const char) \ - op (http_header, const char) \ - op (http_body, const void) \ - op (http_body_size, const size_t) \ - op (planchet_secrets, const struct TALER_PlanchetMasterSecretP) \ - op (token_priv, const struct TALER_TokenUsePrivateKeyP) \ - op (token_issue_sig, const struct TALER_TokenIssueSignature) \ - op (token_issue_pub, const struct TALER_TokenIssuePublicKey) - - -TALER_MERCHANT_TESTING_SIMPLE_TRAITS (TALER_TESTING_MAKE_DECL_SIMPLE_TRAIT) -TALER_MERCHANT_TESTING_INDEXED_TRAITS (TALER_TESTING_MAKE_DECL_INDEXED_TRAIT) - - -#endif diff --git a/src/include/taler_merchant_util.h b/src/include/taler_merchant_util.h @@ -1,1535 +0,0 @@ -/* - This file is part of GNU Taler - Copyright (C) 2024, 2025 Taler Systems SA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file include/taler_merchant_util.h - * @brief Interface for common utility functions - * @author Christian Grothoff - */ -#ifndef TALER_MERCHANT_UTIL_H -#define TALER_MERCHANT_UTIL_H - -#include <gnunet/gnunet_common.h> -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_json_lib.h> - -#include <stdint.h> -#include <taler/taler_util.h> -#include <jansson.h> - -/** - * Fixed-point base for inventory quantities (powers of 10). - * Six decimal digits are supported to match the maximum unit precision. - */ -#define TALER_MERCHANT_UNIT_FRAC_BASE 1000000U -#define TALER_MERCHANT_UNIT_FRAC_MAX_DIGITS 6U - -/** - * Return default project data used by Taler merchant. - */ -const struct GNUNET_OS_ProjectData * -TALER_MERCHANT_project_data (void); - - -/** - * Kind of fixed-decimal value the helpers operate on. - * Primarily distinguishes how special sentinel values (such as "-1" - * meaning infinity for stock) must be encoded. - */ -enum TALER_MERCHANT_ValueKind -{ - TALER_MERCHANT_VK_QUANTITY, /* -1 is illegal */ - TALER_MERCHANT_VK_STOCK /* -1 means "infinity" */ -}; - - -/** - * Parse decimal quantity expressed as string for request handling. - * - * @param value string to parse - * @param[out] integer_part result integer component - * @param[out] fractional_part result fractional component (0..TALER_MERCHANT_UNIT_FRAC_BASE-1) - * @return #GNUNET_OK on success, #GNUNET_SYSERR on validation failure - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_vk_parse_fractional_string ( - const char *value, - int64_t *integer_part, - uint32_t *fractional_part); - - -/** - * Extract a fixed-decimal number that may be supplied either - * - as pure integer (e.g. "total_stock"), or - * - as decimal text (e.g. "unit_total_stock"). - * - * Rules: - * - If both forms are missing -> error. - * - If both are present -> they must match and the decimal must have no fraction. - * - For kind == TALER_MERCHANT_VK_STOCK the integer value -1 represents infinity. - * - * @param kind See #TALER_MERCHANT_ValueKind - * @param allow_fractional False: any fractional part is rejected - * @param int_missing True if client omitted the integer field - * @param int_raw Raw integer (undefined if @a int_missing is true) - * @param str_missing True if client omitted the string field - * @param str_raw Raw UTF-8 string (undefined if @a str_missing is true) - * @param[out] int_out Canonicalised integer part - * @param[out] frac_out Canonicalised fractional part - * @param[out] error_param Set to offending field name on failure - * @param int_field Integer field name (for error reporting) - * @param str_field String field name (for error reporting) - * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_vk_process_quantity_inputs ( - enum TALER_MERCHANT_ValueKind kind, - bool allow_fractional, - bool int_missing, - int64_t int_raw, - bool str_missing, - const char *str_raw, - uint64_t *int_out, - uint32_t *frac_out, - const char **error_param); - -/** - * Format a fixed-decimal pair into canonical string representation. - * Recognises INT64_MAX / INT32_MAX as the "-1" sentinel used for - * infinite stock if @a kind equals #TALER_MERCHANT_VK_STOCK. - * - * @param kind specifies whether sentinel values are permitted - * @param integer integer portion - * @param fractional fractional portion (0..TALER_MERCHANT_UNIT_FRAC_BASE-1 or sentinel) - * @param buffer output buffer - * @param buffer_length length of @a buffer - */ -void -TALER_MERCHANT_vk_format_fractional_string ( - enum TALER_MERCHANT_ValueKind kind, - uint64_t integer, - uint32_t fractional, - size_t buffer_length, - char buffer[static buffer_length]); - - -/** - * Check if @a image_data_url is a valid image - * data URL. Does not validate the actual payload, - * only the syntax and that it properly claims to - * be an image. - * - * FIXME: use in TALER_MERCHANT_parse_product! - * - * @param image_data_url string to check - * @return true if @a image_data_url is a data - * URL with an "image/" mime-type - */ -bool -TALER_MERCHANT_image_data_url_valid (const char *image_data_url); - - -/** - * Check if @a email is a valid email address. - * - * FIXME: move to libgnunetutil? - * - * @param email string to check - * @return true if @a email is a valid e-mail address - */ -bool -TALER_MERCHANT_email_valid (const char *email); - - -/** - * Check if @a email is a valid international phone number - * with "+CC" prefix. - * - * @param phone phone number to check - * @param allow_letters to allow "A-Z" letters representing digits - * @return normalized phone number if @a phone is valid, - * NULL if @a phone is not a phone number - */ -char * -TALER_MERCHANT_phone_validate_normalize (const char *phone, - bool allow_letters); - - -/** - * Channel used to transmit MFA authorization request. - */ -enum TALER_MERCHANT_MFA_Channel -{ - /** - * No MFA channel. - */ - TALER_MERCHANT_MFA_CHANNEL_NONE = 0, - - /** - * SMS ("sms") - */ - TALER_MERCHANT_MFA_CHANNEL_SMS = 1, - - /** - * E-mail ("email") - */ - TALER_MERCHANT_MFA_CHANNEL_EMAIL, - - /** - * TOTP ("totp"). (Not yet implemented, #10327.) - */ - TALER_MERCHANT_MFA_CHANNEL_TOTP -}; - - -/** - * Types of critical operations of a merchant backend that may require - * multi-factor authorization. - */ -enum TALER_MERCHANT_MFA_CriticalOperation -{ - /** - * Marker used to indicate that this is NOT a critical operation. - */ - TALER_MERCHANT_MFA_CO_NONE = 0, - - /** - * Instance provisioning ("instance_provision"). - */ - TALER_MERCHANT_MFA_CO_INSTANCE_PROVISION, - - /** - * Bank account configuration or reconfiguration ("account_config"). - */ - TALER_MERCHANT_MFA_CO_ACCOUNT_CONFIGURATION, - - /** - * Authentication configuration change ("auth_config"). - */ - TALER_MERCHANT_MFA_CO_AUTH_CONFIGURATION, - - /** - * Instance deletion ("instance_deletion"). - */ - TALER_MERCHANT_MFA_CO_INSTANCE_DELETION, - - /** - * Authentication token creation ("auth_token_creation"). - */ - TALER_MERCHANT_MFA_CO_AUTH_TOKEN_CREATION - - -}; - -/** - * Template type discriminator. - */ -enum TALER_MERCHANT_TemplateType -{ - TALER_MERCHANT_TEMPLATE_TYPE_INVALID = 0, - TALER_MERCHANT_TEMPLATE_TYPE_FIXED_ORDER, - TALER_MERCHANT_TEMPLATE_TYPE_INVENTORY_CART, - TALER_MERCHANT_TEMPLATE_TYPE_PAIVANA -}; - -/** - * Determine template type from string. - * - * @param template_type string value (NULL means fixed-order) - * @return template type (defaults to fixed order) - */ -enum TALER_MERCHANT_TemplateType -TALER_MERCHANT_template_type_from_string (const char *template_type); - -/** - * Convert template type to its string representation. - * - * @param template_type template type to convert - * @return string name or NULL for invalid types - */ -const char * -TALER_MERCHANT_template_type_to_string ( - enum TALER_MERCHANT_TemplateType template_type); - -/** - * Determine template type from a template contract. - * - * @param template_contract contract JSON - * @return template type (defaults to fixed order) - */ -enum TALER_MERCHANT_TemplateType -TALER_MERCHANT_template_type_from_contract (const json_t *template_contract); - -/** - * Template contract fields for inventory templates. - */ -struct TALER_MERCHANT_TemplateContractInventory -{ - /** - * Selected categories from the template contract. - */ - const json_t *selected_categories; - - /** - * Selected products from the template contract. - */ - const json_t *selected_products; - - /** - * Whether all products are selectable. - */ - bool selected_all; - - /** - * Template requires exactly one selection. - */ - bool choose_one; - -}; - -/** - * Template contract fields for paivana templates. - */ -struct TALER_MERCHANT_TemplateContractPaivana -{ - /** - * Paivana website regular expression. - * NULL to allow any site. - */ - const char *website_regex; - - /** - * Array of possible specific contracts the wallet/customer may choose - * from by selecting the respective index when signing the deposit - * confirmation. - */ - struct TALER_MERCHANT_ContractChoice *choices; - - /** - * Length of the @e choices array. - */ - unsigned int choices_len; - -}; - -/** - * Parsed template contract. - */ -struct TALER_MERCHANT_TemplateContract -{ - /** - * Template type. - */ - enum TALER_MERCHANT_TemplateType type; - - /** - * Summary from the template contract. - */ - const char *summary; - - /** - * Currency from the template contract. - */ - const char *currency; - - /** - * Amount from the template contract. - */ - struct TALER_Amount amount; - - /** - * True if @e amount was not provided. - */ - bool no_amount; - - /** - * Template allows tips. - */ - bool request_tip; - - /** - * Minimum age required by the template. - */ - uint32_t minimum_age; - - /** - * How long does the customer have to pay for the order. - * 0 if not specified (use instance default). - */ - struct GNUNET_TIME_Relative pay_duration; - - union - { - - /** - * Parsed fields for inventory templates. - */ - struct TALER_MERCHANT_TemplateContractInventory inventory; - - /** - * Parsed fields for paivana templates. - */ - struct TALER_MERCHANT_TemplateContractPaivana paivana; - - } details; - -}; - -/** - * Parse template contract JSON into @a out. - * - * @param template_contract JSON object containing the template contract - * @param[out] out parsed template contract - * @param[out] error_name pointer to the name of the failed field, or NULL - * @return #GNUNET_SYSERR if @a template_contract is malformed; #GNUNET_OK otherwise - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_template_contract_parse ( - const json_t *template_contract, - struct TALER_MERCHANT_TemplateContract *out, - const char **error_name); - -/** - * Check if @a template_contract is valid. - * - * @param template_contract template contract to validate - * @return true if @a template_contract is valid - */ -bool -TALER_MERCHANT_template_contract_valid (const json_t *template_contract); - - -/** - * Convert critical operation enumeration value to string - * suitable for human readers. - * - * @param co input to convert - * @return operation value as string - */ -const char * -TALER_MERCHANT_MFA_co2s ( - enum TALER_MERCHANT_MFA_CriticalOperation co); - - -/** - * Convert critical operation enumeration value to string. - * - * @param co input to convert - * @return operation value as string - */ -const char * -TALER_MERCHANT_MFA_co_to_string ( - enum TALER_MERCHANT_MFA_CriticalOperation co); - - -/** - * Convert string to critical operation enumeration value. - * - * @param str input to convert - * @return #TALER_MERCHANT_MFA_CO_NONE on failure - */ -enum TALER_MERCHANT_MFA_CriticalOperation -TALER_MERCHANT_MFA_co_from_string (const char *str); - - -/** - * Convert MFA channel enumeration value to string. - * - * @param ch input to convert - * @return operation value as string - */ -const char * -TALER_MERCHANT_MFA_channel_to_string ( - enum TALER_MERCHANT_MFA_Channel ch); - - -/** - * Convert string to MFA channel enumeration value. - * - * @param str input to convert - * @return #TALER_MERCHANT_MFA_CHANNEL_NONE on failure - */ -enum TALER_MERCHANT_MFA_Channel -TALER_MERCHANT_MFA_channel_from_string (const char *str); - - -/** - * @brief Salted hash of a body for a request that required MFA. - */ -struct TALER_MERCHANT_MFA_BodyHash -{ - /** - * Hash of the body and salt. - */ - struct GNUNET_ShortHashCode hash; -}; - - -/** - * @brief Salt used when computing a `struct TALER_MERCHANT_MFA_BodyHash` - */ -struct TALER_MERCHANT_MFA_BodySalt -{ - /** - * Salt. - */ - uint64_t salt[128 / 64]; -}; - - -/** - * @brief Token used to authorize report generation. - */ -struct TALER_MERCHANT_ReportToken -{ - /** - * Salt. - */ - uint64_t salt[256 / 64]; -}; - - -/** - * Hash the given request @a body with the given @a salt to - * produce @a h_body for MFA checks. - * - * @param body HTTP request body, NULL if body was empty - * @param salt salt to use - * @param h_body resulting hash - */ -void -TALER_MERCHANT_mfa_body_hash ( - const json_t *body, - const struct TALER_MERCHANT_MFA_BodySalt *salt, - struct TALER_MERCHANT_MFA_BodyHash *h_body); - - -/** - * Possible versions of the contract terms. - */ -enum TALER_MERCHANT_ContractVersion -{ - - /** - * Version 0 - */ - TALER_MERCHANT_CONTRACT_VERSION_0 = 0, - - /** - * Version 1 - */ - TALER_MERCHANT_CONTRACT_VERSION_1 = 1 -}; - -/** - * Possible token kinds. - */ -enum TALER_MERCHANT_ContractTokenKind -{ - /** - * Token kind invalid - */ - TALER_MERCHANT_CONTRACT_TOKEN_KIND_INVALID = 0, - - /** - * Subscription token kind - */ - TALER_MERCHANT_CONTRACT_TOKEN_KIND_SUBSCRIPTION = 1, - - /** - * Discount token kind - */ - TALER_MERCHANT_CONTRACT_TOKEN_KIND_DISCOUNT = 2, -}; - -/** - * Possible input types for the contract terms. - */ -enum TALER_MERCHANT_ContractInputType -{ - - /** - * Input type invalid - */ - TALER_MERCHANT_CONTRACT_INPUT_TYPE_INVALID = 0, - -#if FUTURE - /** - * Input type coin - */ - TALER_MERCHANT_CONTRACT_INPUT_TYPE_COIN = 1, -#endif - /** - * Input type token - */ - TALER_MERCHANT_CONTRACT_INPUT_TYPE_TOKEN = 2 -}; - -/** - * Contract input (part of the v1 contract terms). - */ -struct TALER_MERCHANT_ContractInput -{ - /** - * Type of the input. - */ - enum TALER_MERCHANT_ContractInputType type; - - union - { -#if FUTURE - /** - * Coin-based input (ration). (Future work, only here for reference) - */ - struct - { - /** - * Price to be paid. - */ - struct TALER_Amount price; - - /** - * Base URL of the ration authority. - */ - const char *ration_authority_url; - } coin; -#endif - - /** - * Token-based input. - */ - struct - { - /** - * Slug of the token family to be used. - */ - const char *token_family_slug; - - /** - * Number of tokens of this type required. Defaults to one if the - * field is not provided. - */ - unsigned int count; - } token; - } details; -}; - -/** - * Possible output types for the contract terms. - */ -enum TALER_MERCHANT_ContractOutputType -{ - - /** - * Invalid output type - */ - TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_INVALID = 0, - - /** - * Output type token - */ - TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_TOKEN = 1, - - /** - * Output type donation-receipt - */ - TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_DONATION_RECEIPT = 2, -#if FUTURE - /** - * Output type coin - */ - TALER_MERCHANT_CONTRACT_OUTPUT_TYPE_COIN = 3 -#endif - -}; - -/** - * Contract output (part of the v1 contract terms). - */ -struct TALER_MERCHANT_ContractOutput -{ - /** - * Type of the output. - */ - enum TALER_MERCHANT_ContractOutputType type; - - union - { -#if FUTURE - /** - * Coin-based output. - */ - struct - { - /** - * Coins that will be yielded. This excludes any applicable withdraw fees. - */ - struct TALER_Amount brutto_yield; - - /** - * Base URL of the exchange that will issue the coins. - * - * NOTE: Once implemented, check if we need to allocate this here or if - * we again reference the JSON as we do in other places. - */ - char *exchange_url; - - } coin; -#endif - /** - * DONAU-receipt output. - */ - struct - { - /** - * Amount of the donation. (optional) - */ - struct TALER_Amount amount; - - /** - * Base URLs of the donation authorities that will issue the tax receipt. - */ - char **donau_urls; - - /** - * Length of the @e donau_urls array. - */ - unsigned int donau_urls_len; - - } donation_receipt; - - /** - * Token-based output. - */ - struct - { - /** - * Slug of the token family to be issued. - * Note: this is a pointer into the JSON of the - * respective contract/request and not owned here. - */ - const char *token_family_slug; - - /** - * Index of the public key in the @a token_family_slug's token family - * ``keys`` array that this output token will have. - */ - unsigned int key_index; - - /** - * Number of tokens of this type required. Defaults to one if the - * field is not provided. - */ - unsigned int count; - - /** - * Determines when the output token should be valid. - * Optional, set to zero for not specified (then we - * use the current time). - */ - struct GNUNET_TIME_Timestamp valid_at; - - } token; - - } details; - -}; - -/** - * Contract choice (part of the v1 contract terms). - */ -struct TALER_MERCHANT_ContractChoice -{ - - /** - * Amount to be paid for this choice. - */ - struct TALER_Amount amount; - - /** - * Tip included by the customer (part of the total amount). - */ - struct TALER_Amount tip; - - /** - * True if @e tip was not provided. - */ - bool no_tip; - - /** - * Human readable description of the semantics of the choice within the - * contract to be shown to the user at payment. - */ - char *description; - - /** - * Map from IETF BCP 47 language tags to localized description. - */ - json_t *description_i18n; - - /** - * Maximum fee the merchant is willing to pay for this choice. - * Set to an invalid amount to use instance defaults (zero or STEFAN). - */ - struct TALER_Amount max_fee; - - /** - * List of inputs the wallet must provision (all of them) to satisfy the - * conditions for the contract. - */ - struct TALER_MERCHANT_ContractInput *inputs; - - /** - * Length of the @e inputs array. - */ - unsigned int inputs_len; - - /** - * List of outputs the merchant promises to yield (all of them) once - * the contract is paid. - */ - struct TALER_MERCHANT_ContractOutput *outputs; - - /** - * Length of the @e outputs array. - */ - unsigned int outputs_len; -}; - -/** - * Public key and corresponding metadata for a token family. - */ -struct TALER_MERCHANT_ContractTokenFamilyKey -{ - /** - * Public key. - */ - struct TALER_TokenIssuePublicKey pub; - - /** - * Start time of the token family duration. - */ - struct GNUNET_TIME_Timestamp valid_after; - - /** - * Tokens signed by this key will be valid until this time. - */ - struct GNUNET_TIME_Timestamp valid_before; -}; - - -/** - * Represents a family of tokens issued by merchants that can be used in contracts. - */ -struct TALER_MERCHANT_ContractTokenFamily -{ - /** - * Slug of the token family. - */ - char *slug; - - /** - * Human-readable name of the token family. - */ - char *name; - - /** - * Human-readable description of the semantics of the tokens issued by - * this token family. - */ - char *description; - - /** - * Map from IETF BCP 47 language tags to localized description. - */ - json_t *description_i18n; - - /** - * Relevant public keys of this token family for the given contract. - */ - struct TALER_MERCHANT_ContractTokenFamilyKey *keys; - - /** - * Length of the @e keys array. - */ - unsigned int keys_len; - - /** - * Must a wallet understand this token type to process contracts that - * consume or yield it? - */ - bool critical; - - /** - * Kind of the token family. - */ - enum TALER_MERCHANT_ContractTokenKind kind; - - /** - * Kind-specific information about the token. - */ - union - { - /** - * Subscription token. - */ - struct - { - /** - * Array of domain names where this subscription can be safely used - * (e.g. the issuer warrants that these sites will re-issue tokens of - * this type if the respective contract says so). May contain "*" for - * any domain or subdomain. - */ - char **trusted_domains; - - /** - * Length of the @e trusted_domains array. - */ - unsigned int trusted_domains_len; - } subscription; - - /** - * Discount token. - */ - struct - { - /** - * Array of domain names where this discount token is intended to be - * used. May contain "*" for any domain or subdomain. Users should be - * warned about sites proposing to consume discount tokens of this - * type that are not in this list that the merchant is accepting a - * coupon from a competitor and thus may be attaching different - * semantics (like get 20% discount for my competitors 30% discount - * token). - */ - char **expected_domains; - - /** - * Length of the @e expected_domains array. - */ - unsigned int expected_domains_len; - - } discount; - } details; -}; - -/** - * Specifies the quantity of a product (to be) sold. - */ -struct TALER_MERCHANT_ProductQuantity -{ - /** - * Integer component of the quantity. - */ - uint64_t integer; - - /** - * Fractional component of the quantity, in the - * range of 0..TALER_MERCHANT_UNIT_FRAC_BASE-1. - */ - uint32_t fractional; - -}; - - -/** - * How to round when computing with amounts? - */ -enum TALER_MERCHANT_RoundMode -{ - TALER_MERCHANT_ROUND_NEAREST, - TALER_MERCHANT_ROUND_UP, - TALER_MERCHANT_ROUND_DOWN -}; - - -/** - * Multiply the @a unit_price by the quantity given in @a factor. - * Round the result using the given rounding mode @a rm to a - * multiple of the @a atomic_amount. - * - * @param[out] result where to store the result - * @param unit_price price for one item - * @param factor quantity to purchase, can be factional - * @param rm rounding mode to apply - * @param atomic_amount granularity to round to - * @return #GNUNET_OK on success - * #GNUNET_NO on integer overflow (resulting amount cannot be represented) - * #GNUNET_SYSERR on internal failure (e.g. currency - * @a unit_price and @a atomic_amount do not match) - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_amount_multiply_by_quantity ( - struct TALER_Amount *result, - const struct TALER_Amount *unit_price, - const struct TALER_MERCHANT_ProductQuantity *factor, - enum TALER_MERCHANT_RoundMode rm, - const struct TALER_Amount *atomic_amount); - - -/** - * Details about a product (to be) sold. - */ -struct TALER_MERCHANT_ProductSold -{ - - /** - * Merchant-internal identifier for the product. NULL for none. - */ - char *product_id; - - /** - * Name of the product. NULL for pre **v20** contract terms. - */ - char *product_name; - - /** - * Human-readable product description. - */ - char *description; - - /** - * Map from IETF BCP 47 language tags to localized descriptions. - * NULL if no translations are available. - */ - json_t *description_i18n; - - /** - * Quantity (in multiples of @e unit) to be sold. - */ - struct TALER_MERCHANT_ProductQuantity unit_quantity; - - /** - * Unit in which the product is measured (liters, kilograms, packages, - * etc.). Can be NULL if not specified. - */ - char *unit; - - /** - * Length of the @e prices array. - */ - unsigned int prices_length; - - /** - * Array of prices (in different currencies) for @e unit_quantity - * units of this product (these are longer the per-unit prices!). - */ - struct TALER_Amount *prices; - - /** - * True if the @e prices given are the net price, - * false if they are the gross price. Note that even @e prices are the - * gross price, @e taxes may be missing if the merchant configured - * gross @e prices but did not configure any @e taxes. - * Similarly, the merchant may have configured net @e prices - * for products but deals with taxes on a per-order basis. Thus, it - * may not always be possible to compute the gross price from the net - * price for an individual product, necessitating this flag. - */ - bool prices_are_net; - - /** - * An optional base64-encoded image of the product. - */ - char *image; - - /** - * A list of taxes paid by the merchant for this product. Can be NULL. - * Will likely change soon! - */ - json_t *taxes; - - /** - * Time indicating when this product should be delivered. - * #GNUNET_TIME_UNIT_FOREVER_TS for unknown / not specified. - */ - struct GNUNET_TIME_Timestamp delivery_date; - - /** - * Money pot to use for this product, overrides value from - * the inventory if given. Not useful to wallets, only for - * merchant-internal accounting. - */ - uint64_t product_money_pot; - -}; - - -/** - * Struct to hold contract terms. - */ -struct TALER_MERCHANT_Contract -{ - /** - * URL where the same contract could be ordered again (if available). - */ - char *public_reorder_url; - - /** - * Our order ID. - */ - char *order_id; - - /** - * Merchant base URL. - */ - char *merchant_base_url; - - /** - * Merchant information. - */ - struct - { - /** - * Legal name of the instance - */ - char *name; - - /** - * Merchant's site url - */ - char *website; - - /** - * Email contact for customers - */ - char *email; - - /** - * merchant's logo data uri - */ - char *logo; - - /** - * Merchant address - */ - json_t *address; - - /** - * Jurisdiction of the business - */ - json_t *jurisdiction; - - } merchant; - - /** - * Summary of the contract. - */ - char *summary; - - /** - * Internationalized summary. - */ - json_t *summary_i18n; - - /** - * URL that will show that the contract was successful - * after it has been paid for. - */ - char *fulfillment_url; - - /** - * Message shown to the customer after paying for the contract. - * Either fulfillment_url or fulfillment_message must be specified. - */ - char *fulfillment_message; - - /** - * Map from IETF BCP 47 language tags to localized fulfillment messages. - */ - json_t *fulfillment_message_i18n; - - /** - * Length of the @e products array. - */ - size_t products_len; - - /** - * Array of products that are part of the purchase. - */ - struct TALER_MERCHANT_ProductSold *products; - - /** - * Timestamp of the contract. - */ - struct GNUNET_TIME_Timestamp timestamp; - - /** - * Deadline for refunds. - */ - struct GNUNET_TIME_Timestamp refund_deadline; - - /** - * Specifies for how long the wallet should try to get an - * automatic refund for the purchase. - */ - struct GNUNET_TIME_Relative auto_refund; - - /** - * Payment deadline. - */ - struct GNUNET_TIME_Timestamp pay_deadline; - - /** - * Wire transfer deadline. - */ - struct GNUNET_TIME_Timestamp wire_deadline; - - /** - * Delivery date. - */ - struct GNUNET_TIME_Timestamp delivery_date; - - /** - * Merchant public key. - */ - struct TALER_MerchantPublicKeyP merchant_pub; - - /** - * The hash of the merchant instance's wire details. - */ - struct TALER_MerchantWireHashP h_wire; - - /** - * Wire transfer method identifier for the wire method associated with - * @e h_wire. - */ - char *wire_method; - - /** - * Exchanges that the merchant accepts even if it does not accept any auditors that audit them. - * TODO: appropriate type - */ - json_t *exchanges; - - /** - * Delivery location. - */ - json_t *delivery_location; - - /** - * Nonce generated by the wallet and echoed by the merchant - * in this field when the proposal is generated. - */ - char *nonce; - - /** - * Extra data that is only interpreted by the merchant frontend. - */ - json_t *extra; - - /** - * Minimum age the buyer must have (in years). - */ - uint8_t minimum_age; - - /** - * Default money pot to use for this product, applies to the - * amount remaining that was not claimed by money pots of - * products or taxes. Not useful to wallets, only for - * merchant-internal accounting. If zero, the remaining - * account is simply not accounted for in any money pot. - */ - uint64_t default_money_pot; - - /** - * Specified version of the contract. - */ - enum TALER_MERCHANT_ContractVersion version; - - /** - * Details depending on the @e version. - */ - union - { - - /** - * Details for v0 contracts. - */ - struct - { - - /** - * Price to be paid for the transaction. Could be 0. The price is in addition - * to other instruments, such as rations and tokens. - * The exchange will subtract deposit fees from that amount - * before transferring it to the merchant. - */ - struct TALER_Amount brutto; - - /** - * Tip included by the customer (part of the total amount). - */ - struct TALER_Amount tip; - - /** - * True if @e tip was not provided. - */ - bool no_tip; - - /** - * Maximum fee as given by the client request. - */ - struct TALER_Amount max_fee; - - } v0; - - /** - * Details for v1 contracts. - */ - struct - { - - /** - * Array of possible specific contracts the wallet/customer may choose - * from by selecting the respective index when signing the deposit - * confirmation. - */ - struct TALER_MERCHANT_ContractChoice *choices; - - /** - * Length of the @e choices array. - */ - unsigned int choices_len; - - /** - * Array of token authorities. - */ - struct TALER_MERCHANT_ContractTokenFamily *token_authorities; - - /** - * Length of the @e token_authorities array. - */ - unsigned int token_authorities_len; - - } v1; - - } details; - -}; - - -/** - * Parse JSON contract terms in @a input. - * - * @param[in] input JSON object containing contract terms - * @param nonce_optional whether `nonce' field is optional - * @return parsed contract terms; NULL if @a input is malformed - */ -struct TALER_MERCHANT_Contract * -TALER_MERCHANT_contract_parse (json_t *input, - bool nonce_optional); - - -/** - * Provide specification to parse an JSON contract input type. - * The value is provided as a descriptive string. - * - * @param name name of the JSON member with the contract type - * @param[out] cit where to store the contract input type - * @return spec for parsing a contract input type - */ -struct GNUNET_JSON_Specification -TALER_MERCHANT_json_spec_cit (const char *name, - enum TALER_MERCHANT_ContractInputType *cit); - - -/** - * Provide specification to parse given JSON array to contract terms - * choices. All fields from @a choices elements are copied. - * - * @param name name of the choices field in the JSON - * @param[out] choices where the contract choices array has to be written - * @param[out] choices_len length of the @a choices array - */ -struct GNUNET_JSON_Specification -TALER_MERCHANT_spec_choices ( - const char *name, - struct TALER_MERCHANT_ContractChoice **choices, - unsigned int *choices_len); - - -/** - * Parse JSON contract terms choice input. - * - * @param[in] root JSON object containing choice input - * @param[out] input parsed choice input, NULL if @a input is malformed - * @param index index of choice input in inputs array - * @param order whether @a input is contained in order or contract terms - * @return #GNUNET_SYSERR if @a input is malformed; #GNUNET_OK otherwise - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_parse_choice_input ( - json_t *root, - struct TALER_MERCHANT_ContractInput *input, - size_t index, - bool order); - - -/** - * Check if @a taxes is an array of valid Taxes in the sense of - * Taler's API definition. - * - * @param taxes array to check - * @return true if @a taxes is an array and all - * entries are valid Taxes. - */ -bool -TALER_MERCHANT_taxes_array_valid (const json_t *taxes); - - -/** - * Parse JSON product given in @a p, returning the result in - * @a r. - * - * @param p JSON specifying a ``ProductSold`` to parse - * @param[out] r where to write the result - * @return #GNUNET_OK on success - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_parse_product_sold (const json_t *p, - struct TALER_MERCHANT_ProductSold *r); - - -/** - * Provide specification to parse an JSON contract output type. - * The value is provided as a descriptive string. - * - * @param name name of the JSON member with the contract type - * @param[out] cot where to store the contract output type - * @return spec for parsing a contract output type - */ -struct GNUNET_JSON_Specification -TALER_MERCHANT_json_spec_cot (const char *name, - enum TALER_MERCHANT_ContractOutputType *cot); - - -/** - * Parse JSON contract terms choice output. - * - * @param[in] root JSON object containing choice output - * @param[out] output parsed choice output, NULL if @a output is malformed - * @param index index of choice output in outputs array - * @param order whether @a output is contained in order or contract terms - * @return #GNUNET_SYSERR if @a output is malformed; #GNUNET_OK otherwise - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_parse_choice_output ( - json_t *root, - struct TALER_MERCHANT_ContractOutput *output, - size_t index, - bool order); - - -/** - * Serialize @a p to JSON. - * - * @param p product to serialize - * @return JSON object representing the product @a p - */ -json_t * -TALER_MERCHANT_product_sold_serialize ( - const struct TALER_MERCHANT_ProductSold *p); - - -/** - * Serialize contract terms into JSON object. - * - * @param[in] input contract terms to serialize - * @param nonce_optional whether `nonce' field is optional - * @return JSON representation of @a input; NULL on error - */ -json_t * -TALER_MERCHANT_contract_serialize ( - const struct TALER_MERCHANT_Contract *input, - bool nonce_optional); - - -/** - * Get JSON representation of contract choice. - * - * @param[in] choice contract choice to serialize - * @param order whether @a choice is contained in order or contract terms - * @return JSON representation of @a choice; NULL on error - */ -json_t * -TALER_MERCHANT_json_from_contract_choice ( - const struct TALER_MERCHANT_ContractChoice *choice, - bool order); - - -/** - * Get JSON representation of contract token family. - * - * @param[in] family contract token family to serialize - * @return JSON representation of @a family; NULL on error - */ -json_t * -TALER_MERCHANT_json_from_token_family ( - const struct TALER_MERCHANT_ContractTokenFamily *family); - - -/** - * Find token family in contract terms from slug and validity date. - * - * @param slug slug of the token family - * @param valid_after validity start of the token family - * @param[in] families array of token families in the contract terms - * @param families_len length of @a families array - * @param[out] family matching token family; NULL if no result - * @param[out] key key of matching token family; NULL if no result - * @return #GNUNET_SYSERR if no matching family found; #GNUNET_OK otherwise - */ -enum GNUNET_GenericReturnValue -TALER_MERCHANT_find_token_family_key ( - const char *slug, - struct GNUNET_TIME_Timestamp valid_after, - const struct TALER_MERCHANT_ContractTokenFamily *families, - unsigned int families_len, - struct TALER_MERCHANT_ContractTokenFamily *family, - struct TALER_MERCHANT_ContractTokenFamilyKey *key); - - -/** - * Free all the fields in the given @a choice, but not @a choice itself, since - * it is normally part of an array. - * - * @param[in] choice contract terms choice to free - */ -void -TALER_MERCHANT_contract_choice_free ( - struct TALER_MERCHANT_ContractChoice *choice); - - -/** - * Release memory inside of @a product, but not @a product itself. - * - * @param[in] product data structure to clean up - */ -void -TALER_MERCHANT_product_sold_free (struct TALER_MERCHANT_ProductSold *product); - - -/** - * Free the @a contract and all fields in it. - * - * @param[in] contract contract to free - */ -void -TALER_MERCHANT_contract_free (struct TALER_MERCHANT_Contract *contract); - - -#endif diff --git a/src/include/taler_merchantdb_lib.h b/src/include/taler_merchantdb_lib.h @@ -1,121 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014, 2015, 2016, 2020 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 - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> -*/ - -/** - * @file taler_merchantdb_lib.h - * @brief database helper functions used by the merchant backend - * @author Sree Harsha Totakura <sreeharsha@totakura.in> - */ -#ifndef TALER_MERCHANTDB_LIB_H -#define TALER_MERCHANTDB_LIB_H - -#include <taler/taler_util.h> -#include "taler_merchantdb_plugin.h" - -/** - * Handle to interact with the database. - */ -struct TALER_MERCHANTDB_Plugin; - -/** - * Connect to postgresql database - * - * @param cfg the configuration handle - * @return connection to the database; NULL upon error - */ -struct TALER_MERCHANTDB_Plugin * -TALER_MERCHANTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg); - - -/** - * Disconnect from the database - * - * @param dbh database handle to close - */ -void -TALER_MERCHANTDB_plugin_unload (struct TALER_MERCHANTDB_Plugin *dbh); - - -/** - * Free members of @a pd, but not @a pd itself. - * - * @param[in] pd product details to clean up - */ -void -TALER_MERCHANTDB_product_details_free ( - struct TALER_MERCHANTDB_ProductDetails *pd); - - -/** - * Free members of @a tp, but not @a tp itself. - * - * @param[in] tp template details to clean up - */ -void -TALER_MERCHANTDB_template_details_free ( - struct TALER_MERCHANTDB_TemplateDetails *tp); - - -/** - * Free members of @a wb, but not @a wb itself. - * - * @param[in] wb webhook details to clean up - */ -void -TALER_MERCHANTDB_webhook_details_free ( - struct TALER_MERCHANTDB_WebhookDetails *wb); - -/** - * Free members of @a pwb, but not @a pwb itself. - * - * @param[in] pwb pending webhook details to clean up - */ -void -TALER_MERCHANTDB_pending_webhook_details_free ( - struct TALER_MERCHANTDB_PendingWebhookDetails *pwb); - - -/** - * Free members of @a tf, but not @a tf itself. - * - * @param[in] tf token family details to clean up - */ -void -TALER_MERCHANTDB_token_family_details_free ( - struct TALER_MERCHANTDB_TokenFamilyDetails *tf); - - -/** - * Free members of @a cd, but not @a cd itself. - * - * @param[in] cd token family details to clean up - */ -void -TALER_MERCHANTDB_category_details_free ( - struct TALER_MERCHANTDB_CategoryDetails *cd); - -/** - * Free members of @a ud, but not @a ud itself. - * - * @param[in] ud unit details to clean up - */ -void -TALER_MERCHANTDB_unit_details_free ( - struct TALER_MERCHANTDB_UnitDetails *ud); - -#endif /* MERCHANT_DB_H */ - -/* end of taler_merchantdb_lib.h */ diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h @@ -1,5833 +0,0 @@ -/* - This file is part of TALER - Copyright (C) 2014-2026 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 - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> -*/ -/** - * @file taler_merchantdb_plugin.h - * @brief database access for the merchant - * @author Florian Dold - * @author Christian Grothoff - * @author Priscilla Huang - */ -#ifndef TALER_MERCHANTDB_PLUGIN_H -#define TALER_MERCHANTDB_PLUGIN_H - -#include <gnunet/gnunet_common.h> -#include <gnunet/gnunet_time_lib.h> -#include <gnunet/gnunet_util_lib.h> -#include <gnunet/gnunet_db_lib.h> -#include <taler_merchant_util.h> -#include <taler/taler_exchange_service.h> -#include <jansson.h> - -#ifdef HAVE_DONAU_DONAU_SERVICE_H -#include <donau/donau_service.h> -#include "taler_merchant_donau.h" -#endif - -/** - * Handle to interact with the database. - */ -struct TALER_MERCHANTDB_Plugin; - - -GNUNET_NETWORK_STRUCT_BEGIN - - -/** - * Format of the data hashed to generate the notification - * string whenever the KYC status for an account has - * changed. - */ -struct TALER_MERCHANTDB_MerchantKycStatusChangeEventP -{ - /** - * Type is TALER_DBEVENT_MERCHANT_EXCHANGE_KYC_STATUS_CHANGED. - */ - struct GNUNET_DB_EventHeaderP header; - - /** - * Salted hash of the affected account. - */ - struct TALER_MerchantWireHashP h_wire; -}; - -/** - * Event triggered when an order is paid. - */ -struct TMH_OrderPayEventP -{ - /** - * Type is #TALER_DBEVENT_MERCHANT_ORDER_PAID - */ - struct GNUNET_DB_EventHeaderP header; - - /** - * Always zero (for alignment). - */ - uint32_t reserved GNUNET_PACKED; - - /** - * Merchant's public key - */ - struct TALER_MerchantPublicKeyP merchant_pub; - - /** - * Hash of the order ID. - */ - struct GNUNET_HashCode h_order_id; -}; - - -GNUNET_NETWORK_STRUCT_END - -/** - * Current exposed deposit limits by an exchange - * for a merchant (until other rules may apply). - */ -struct TALER_MERCHANTDB_DepositLimits -{ - /** - * Maximum amount to be deposited within @a timeframe. - */ - struct TALER_Amount threshold; - - /** - * Timeframe over which the limit applies. - */ - struct GNUNET_TIME_Relative timeframe; - - /** - * True if this is a soft limit that could be - * raised (by AML staff or by passing KYC checks). - */ - bool soft_limit; -}; - -/** - * Details about a wire account of the merchant. - */ -struct TALER_MERCHANTDB_AccountDetails -{ - /** - * Hash of the wire details (@e payto_uri and @e salt). - */ - struct TALER_MerchantWireHashP h_wire; - - /** - * Salt value used for hashing @e payto_uri. - */ - struct TALER_WireSaltP salt; - - /** - * Instance ID. Do not free (may be aliased with - * the instance ID given in the query!). - * FIXME: set in all functions involving this struct! - */ - const char *instance_id; - - /** - * Actual account address as a payto://-URI. - */ - struct TALER_FullPayto payto_uri; - - /** - * Where can the taler-merchant-wirewatch helper - * download information about incoming transfers? - * NULL if not available. - */ - char *credit_facade_url; - - /** - * JSON with credentials to use to access the - * @e credit_facade_url. - */ - json_t *credit_facade_credentials; - - /** - * Additional meta data to include in wire transfers to this - * account. Can be NULL if not used. - */ - char *extra_wire_subject_metadata; - - /** - * Is the account set for active use in new contracts? - */ - bool active; - -}; - - -/** - * Binary login token. Just a vanilla token made out - * of random bits. - */ -struct TALER_MERCHANTDB_LoginTokenP -{ - /** - * 32 bytes of entropy. - */ - uint64_t data[32 / 8]; -}; - -/** - * Authentication settings for an instance. - */ -struct TALER_MERCHANTDB_InstanceAuthSettings -{ - /** - * Hash used for authentication. All zero if authentication is off. - */ - struct TALER_MerchantAuthenticationHashP auth_hash; - - /** - * Salt used to hash the "Authentication" header, the result must then - * match the @e auth_hash. - */ - struct TALER_MerchantAuthenticationSaltP auth_salt; -}; - -/** - * General settings for an instance. - */ -struct TALER_MERCHANTDB_InstanceSettings -{ - /** - * prefix for the instance under "/instances/" - */ - char *id; - - /** - * legal name of the instance - */ - char *name; - - /** - * merchant's site url - */ - char *website; - - /** - * email contact for password reset / possibly admin / customers - */ - char *email; - - /** - * phone contact for password reset / possibly admin / customers - */ - char *phone; - - /** - * merchant's logo data uri - */ - char *logo; - - /** - * Address of the business - */ - json_t *address; - - /** - * jurisdiction of the business - */ - json_t *jurisdiction; - - /** - * Use STEFAN curves to determine acceptable - * fees by default (otherwise: accept no fees by default). - */ - bool use_stefan; - - /** - * True of @e phone was validated. - */ - bool phone_validated; - - /** - * True of @e email was validated. - */ - bool email_validated; - - /** - * If the frontend does NOT specify an execution date, how long should - * we tell the exchange to wait to aggregate transactions before - * executing the wire transfer? This delay is added to the current - * time when we generate the advisory execution time for the exchange. - */ - struct GNUNET_TIME_Relative default_wire_transfer_delay; - - /** - * If the frontend does NOT specify a payment deadline, how long should - * offers we make be valid by default? - */ - struct GNUNET_TIME_Relative default_pay_delay; - - /** - * If the frontend does NOT specify a refund deadline, how long should - * refunds be possible? - */ - struct GNUNET_TIME_Relative default_refund_delay; - - /** - * How much should we round up the wire transfer deadline computed by - * adding the @e default_wire_transfer_delay to the refund deadline. - */ - enum GNUNET_TIME_RounderInterval default_wire_transfer_rounding_interval; - -}; - - -/** - * Typically called by `lookup_instances`. - * - * @param cls closure - * @param merchant_pub public key of the instance - * @param merchant_priv private key of the instance, NULL if not available - * @param is general instance settings - * @param ias instance authentication settings - */ -typedef void -(*TALER_MERCHANTDB_InstanceCallback)( - 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); - - -/** - * Callback invoked with information about a bank account. - * - * @param cls closure - * @param merchant_priv private key of the merchant instance - * @param ad details about the account - */ -typedef void -(*TALER_MERCHANTDB_AccountCallback)( - void *cls, - const struct TALER_MerchantPrivateKeyP *merchant_priv, - const struct TALER_MERCHANTDB_AccountDetails *ad); - - -/** - * Determines the maximum @a amount for a particular - * type of operation for a given @a exchange_url. - * - * @param cls closure - * @param exchange_url base URL of the exchange to get - * the limit for - * @param[in,out] amount lowered to the maximum amount - * allowed at the exchange - */ -typedef void -(*TALER_MERCHANTDB_OperationLimitCallback)( - void *cls, - const char *exchange_url, - struct TALER_Amount *amount); - - -/** - * Typically called by `lookup_products`. - * - * @param cls a `json_t *` JSON array to build - * @param product_serial row ID of the product - * @param product_id ID of the product - */ -typedef void -(*TALER_MERCHANTDB_ProductsCallback)( - void *cls, - uint64_t product_serial, - const char *product_id); - - -/** - * Details about a product. - * - * FIXME: reuse TALER_MERCHANT_Product as a member in this structure! - */ -struct TALER_MERCHANTDB_ProductDetails -{ - /** - * Name of the product. - */ - char *product_name; - - /** - * Description of the product. - */ - char *description; - - /** - * Internationalized description. - */ - json_t *description_i18n; - - /** - * Unit in which the product is sold. - */ - char *unit; - - /** - * Optional list of per-unit prices. When NULL or empty, @e price - * must be used as the canonical single price. - */ - struct TALER_Amount *price_array; - - /** - * Number of entries in @e price_array. - */ - size_t price_array_length; - - /** - * Base64-encoded product image, or an empty string. - */ - char *image; - - /** - * Hash of the product image data, or NULL. - */ - char *image_hash; - - /** - * List of taxes the merchant pays for this product. Never NULL, - * but can be an empty array. - */ - json_t *taxes; - - /** - * Number of units of the product in stock in sum in total, including all - * existing sales and lost product, in product-specific units. UINT64_MAX - * indicates "infinite". - */ - uint64_t total_stock; - - /** - * Fractional part of stock in units of 1/1000000 of the base value. - */ - uint32_t total_stock_frac; - - /** - * Honor fractional stock if TRUE, else only integer stock. - */ - bool allow_fractional_quantity; - - /** - * Precision level (number of decimal places) to apply when - * fractional quantities are enabled. - */ - uint32_t fractional_precision_level; - - /** - * Number of units of the product in sold, in product-specific units. - */ - uint64_t total_sold; - - /** - * Fractional part of units sold in units of 1/1000000 of the base value. - */ - uint32_t total_sold_frac; - - /** - * Number of units of stock lost. - */ - uint64_t total_lost; - - /** - * Fractional part of lost units in units of 1/1000000 of the base value. - */ - uint32_t total_lost_frac; - - /** - * Identifies where the product is in stock, possibly an empty map. - */ - json_t *address; - - /** - * Identifies when the product will be restocked. 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for never. - */ - struct GNUNET_TIME_Timestamp next_restock; - - /** - * Minimum required age for consumers buying this product. - * Default is 0. Only enforced of an exchange supports age - * restrictions. - */ - uint32_t minimum_age; - - /** - * Group in which the product is in. 0 for default group. - */ - uint64_t product_group_id; - - /** - * Money pot into which sales of this product should go into by default. - */ - uint64_t money_pot_id; - - /** - * True if the price for this product is given in net, - * False if its the gross price. - */ - bool price_is_net; - -}; - -/** - * Minimal product details for inventory templates. - */ -struct TALER_MERCHANTDB_InventoryProductDetails -{ - /** - * Name of the product. - */ - char *product_name; - - /** - * Description of the product. - */ - char *description; - - /** - * Internationalized description. - */ - json_t *description_i18n; - - /** - * Unit in which the product is sold. - */ - char *unit; - - /** - * List of per-unit prices. - */ - struct TALER_Amount *price_array; - - /** - * Number of entries in @e price_array. - */ - size_t price_array_length; - - /** - * Hash of the product image data, or NULL. - */ - char *image_hash; - - /** - * Honor fractional stock if TRUE, else only integer stock. - */ - bool allow_fractional_quantity; - - /** - * Precision level (number of decimal places) to apply when - * fractional quantities are enabled. - */ - uint32_t fractional_precision_level; - - /** - * Remaining units after sold/lost/locked deductions. - */ - uint64_t remaining_stock; - - /** - * Fractional part of remaining units in units of 1/1000000 of the base value. - */ - uint32_t remaining_stock_frac; - - /** - * List of taxes the merchant pays for this product. Never NULL, - * but can be an empty array. - */ - json_t *taxes; -}; - - -/** - * Details about an inventory measurement unit. - */ -struct TALER_MERCHANTDB_UnitDetails -{ - - /** - * Database serial. - */ - uint64_t unit_serial; - - /** - * Backend identifier used in product payloads. - */ - char *unit; - - /** - * Default long label (fallback string). - */ - char *unit_name_long; - - /** - * Default short label (fallback string). - */ - char *unit_name_short; - - /** - * Internationalised long labels. - */ - json_t *unit_name_long_i18n; - - /** - * Internationalised short labels. - */ - json_t *unit_name_short_i18n; - - /** - * Whether fractional quantities are enabled by default. - */ - bool unit_allow_fraction; - - /** - * Maximum number of fractional digits honoured by default. - */ - uint32_t unit_precision_level; - - /** - * Hidden from selectors when false. - */ - bool unit_active; - - /** - * Built-in units cannot be deleted. - */ - bool unit_builtin; -}; - - -/** - * Typically called by `lookup_all_products`. - * - * @param cls a `json_t *` JSON array to build - * @param product_serial row ID of the product - * @param product_id ID of the product - * @param pd full product details - * @param num_categories length of @a categories array - * @param categories array of categories the - * product is in - */ -typedef void -(*TALER_MERCHANTDB_ProductCallback)( - void *cls, - uint64_t product_serial, - const char *product_id, - const struct TALER_MERCHANTDB_ProductDetails *pd, - size_t num_categories, - const uint64_t *categories); - -/** - * Typically called by `lookup_inventory_products`. - * - * @param cls a `json_t *` JSON array to build - * @param product_id ID of the product - * @param pd inventory product details - * @param num_categories length of @a categories array - * @param categories array of categories the - * product is in - */ -typedef void -(*TALER_MERCHANTDB_InventoryProductCallback)( - void *cls, - const char *product_id, - const struct TALER_MERCHANTDB_InventoryProductDetails *pd, - size_t num_categories, - const uint64_t *categories); - - -/** - * Typically called by `lookup_login_tokens`. - * - * @param cls a `json_t *` JSON array to build - * @param creation_time creation time of the token - * @param expiration_time expiration time of the token - * @param scope validity scope of the token - * @param description description of the token - * @param serial serial number of the token - */ -typedef void -(*TALER_MERCHANTDB_LoginTokensCallback)( - void *cls, - struct GNUNET_TIME_Timestamp creation_time, - struct GNUNET_TIME_Timestamp expiration_time, - uint32_t scope, - const char *description, - uint64_t serial); - - -/** - * Typically called by `lookup_templates`. - * - * @param cls closure - * @param template_id ID of the template - * @param template_description description of the template - */ -typedef void -(*TALER_MERCHANTDB_TemplatesCallback)( - void *cls, - const char *template_id, - const char *template_description); - - -/** - * Typically called by `lookup_otp_devices`. - * - * @param cls closure - * @param otp_id ID of the OTP device - * @param otp_description description of the OTP device - */ -typedef void -(*TALER_MERCHANTDB_OtpDeviceCallback)( - void *cls, - const char *otp_id, - const char *otp_description); - - -/** - * Details about a template. - */ -struct TALER_MERCHANTDB_TemplateDetails -{ - /** - * Description of the template. - */ - char *template_description; - - /** - * In this template contract, we can have additional information. - */ - json_t *template_contract; - - /** - * ID of the OTP device linked to the template, or NULL. - */ - char *otp_id; - - /** - * Editable default values for fields not specified - * in the @e template_contract. NULL if the user - * cannot edit anything. - */ - json_t *editable_defaults; - -}; - - -/** - * Details about an OTP device. - */ -struct TALER_MERCHANTDB_OtpDeviceDetails -{ - - /** - * Description of the device. - */ - char *otp_description; - - /** - * Current usage counter value. - */ - uint64_t otp_ctr; - - /** - * Base64-encoded key. - */ - char *otp_key; - - /** - * Algorithm used to compute purchase confirmations. - */ - enum TALER_MerchantConfirmationAlgorithm otp_algorithm; -}; - - -/** - * Typically called by `lookup_categories`. - * - * @param cls closure - * @param category_id ID of the category - * @param category_name name of the category - * @param category_name_i18n translations of the @a category_name - * @param product_count number of products in the category - */ -typedef void -(*TALER_MERCHANTDB_CategoriesCallback)( - void *cls, - uint64_t category_id, - const char *category_name, - const json_t *category_name_i18n, - uint64_t product_count); - - -/** - * Typically called by `lookup_units`. - * - * @param cls closure - * @param unit_serial database identifier - * @param ud measurement unit details (borrowed) - */ -typedef void -(*TALER_MERCHANTDB_UnitsCallback)( - void *cls, - uint64_t unit_serial, - const struct TALER_MERCHANTDB_UnitDetails *ud); - - -/** - * Details about a product category. - */ -struct TALER_MERCHANTDB_CategoryDetails -{ - - /** - * Name of the category. - */ - char *category_name; - - /** - * Translations of the name of the category. - */ - json_t *category_name_i18n; - -}; - - -/** - * Typically called by `lookup_webhooks`. - * - * @param cls a `json_t *` JSON array to build - * @param webhook_id ID of the webhook - * @param event_type event of the webhook - */ -typedef void -(*TALER_MERCHANTDB_WebhooksCallback)( - void *cls, - const char *webhook_id, - const char *event_type); - - -/** - * Details about a webhook. - */ -struct TALER_MERCHANTDB_WebhookDetails -{ - - /** - * event of the webhook. - */ - char *event_type; - - /** - * URL of the webhook. The customer will be redirected on this url. - */ - char *url; - - /** - * Http method used by the webhook. - */ - char *http_method; - - /** - * Header template of the webhook. - */ - char *header_template; - - /** - * Body template of the webhook. - */ - char *body_template; - -}; - - -/** - * Typically called by `lookup_webhook_by_event`. - * - * @param cls a `json_t *` JSON array to build - * @param webhook_serial reference to the configured webhook template. - * @param event_type which type of event triggers this type of webhook - * @param url the HTTP URL to make the webhook request to - * @param http_method HTTP method use for the webhook - * @param header_template template for the header of the webhook - * @param body_template template for the body of the webhook - */ -typedef void -(*TALER_MERCHANTDB_WebhookDetailCallback)( - void *cls, - uint64_t webhook_serial, - const char *event_type, - const char *url, - const char *http_method, - const char *header_template, - const char *body_template); - - -/** - * Typically called by `lookup_pending_webhooks`. - * - * @param cls a `json_t *` JSON array to build - * @param webhook_pending_serial reference to the configured webhook template. - * @param next_attempt is the time we should make the next request to the webhook. - * @param retries how often have we tried this request to the webhook. - * @param url to make request to - * @param http_method use for the webhook - * @param header of the webhook - * @param body of the webhook - */ -typedef void -(*TALER_MERCHANTDB_PendingWebhooksCallback)( - void *cls, - uint64_t webhook_pending_serial, - struct GNUNET_TIME_Absolute - next_attempt, - uint32_t retries, - const char *url, - const char *http_method, - const char *header, - const char *body); - - -/** - * Details about the pending webhook. - */ -struct TALER_MERCHANTDB_PendingWebhookDetails -{ - - /** - * Identifies when we should make the next request to the webhook. 0 for unknown, - * #GNUNET_TIME_UNIT_FOREVER_ABS for never. - */ - struct GNUNET_TIME_Absolute next_attempt; - - /** - * How often have we tried this request so far. - */ - uint32_t retries; - - /** - * URL of the webhook. The customer will be redirected on this url. - */ - char *url; - - /** - * Http method used for the webhook. - */ - char *http_method; - - /** - * Header of the webhook. - */ - char *header; - - /** - * Body of the webhook. - */ - char *body; - -}; - - -/** - * Filter preferences. - */ -struct TALER_MERCHANTDB_OrderFilter -{ - /** - * Filter orders by this fulfillment URL. - */ - const char *fulfillment_url; - - /** - * Filter orders by this session ID. - */ - const char *session_id; - - /** - * Filter by payment status. - */ - enum TALER_EXCHANGE_YesNoAll paid; - - /** - * Filter by refund status. - */ - enum TALER_EXCHANGE_YesNoAll refunded; - - /** - * Filter by wire transfer status. - */ - enum TALER_EXCHANGE_YesNoAll wired; - - /** - * Filter orders by date, exact meaning depends on @e delta. - */ - struct GNUNET_TIME_Timestamp date; - - /** - * Filter orders by order serial number, exact meaning depends on @e delta. - */ - uint64_t start_row; - - /** - * takes value of the form N (-N), so that at most N values strictly older - * (younger) than start and date are returned. - */ - int64_t delta; - - /** - * Timeout for long-polling. - */ - struct GNUNET_TIME_Relative timeout; - - /** - * Filter to apply on the summary of the order. - */ - const char *summary_filter; - -}; - - -/** - * Typically called by `lookup_orders`. - * - * @param cls a `json_t *` JSON array to build - * @param order_id ID of the order - * @param order_serial row of the order in the database - * @param timestamp creation time of the order in the database - */ -typedef void -(*TALER_MERCHANTDB_OrdersCallback)(void *cls, - const char *order_id, - uint64_t order_serial, - struct GNUNET_TIME_Timestamp timestamp); - - -/** - * Typically called by `select_order_blinded_sigs` - * - * @param cls closure - * @param hash hash of the token - * @param blinded_sig blinded signature for the token - */ -typedef void -(*TALER_MERCHANTDB_BlindedSigCallback)( - void *cls, - struct GNUNET_HashCode *hash, - struct GNUNET_CRYPTO_BlindedSignature *blinded_sig); - -/** - * Function called with information about a coin that was deposited. - * - * @param cls closure - * @param exchange_url exchange where @a coin_pub was deposited - * @param coin_pub public key of the coin - * @param amount_with_fee amount the exchange will deposit for this coin - * @param deposit_fee fee the exchange will charge for this coin - * @param refund_fee fee the exchange will charge for refunding this coin - */ -typedef void -(*TALER_MERCHANTDB_DepositsCallback)( - void *cls, - const char *exchange_url, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *deposit_fee, - const struct TALER_Amount *refund_fee); - - -/** - * Function called with information about a refund. - * - * @param cls closure - * @param coin_pub public coin from which the refund comes from - * @param refund_amount refund amount which is being taken from @a coin_pub - */ -typedef void -(*TALER_MERCHANTDB_RefundCallback)( - void *cls, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_Amount *refund_amount); - - -/** - * Typically called by `lookup_transfer_details_by_order`. - * - * @param cls closure - * @param wtid wire transfer subject of the wire transfer for the coin - * @param exchange_url base URL of the exchange that made the payment - * @param execution_time when was the payment made - * @param deposit_value contribution of the coin to the total wire transfer value - * @param deposit_fee deposit fee charged by the exchange for the coin - * @param transfer_confirmed did the merchant confirm that a wire transfer with - * @a wtid over the total amount happened? - * @param expected_credit_serial row of the expected wire transfer, usable - * as ``offset`` for the ``/private/incoming`` endpoint - */ -typedef void -(*TALER_MERCHANTDB_OrderTransferDetailsCallback)( - void *cls, - const struct TALER_WireTransferIdentifierRawP *wtid, - const char *exchange_url, - struct GNUNET_TIME_Timestamp execution_time, - const struct TALER_Amount *deposit_value, - const struct TALER_Amount *deposit_fee, - bool transfer_confirmed, - uint64_t expected_credit_serial); - - -/** - * Function called with detailed information about a refund. - * - * @param cls closure - * @param refund_serial unique serial number of the refund - * @param timestamp time of the refund (for grouping of refunds in the wallet UI) - * @param coin_pub public coin from which the refund comes from - * @param exchange_url URL of the exchange that issued @a coin_pub - * @param rtransaction_id identificator of the refund - * @param reason human-readable explanation of the refund - * @param refund_amount refund amount which is being taken from @a coin_pub - * @param pending true if the this refund was not yet processed by the wallet/exchange - */ -typedef void -(*TALER_MERCHANTDB_RefundDetailCallback)( - void *cls, - uint64_t refund_serial, - struct GNUNET_TIME_Timestamp timestamp, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const char *exchange_url, - uint64_t rtransaction_id, - const char *reason, - const struct TALER_Amount *refund_amount, - bool pending); - - -/** - * Function called from ``account_kyc_get_status`` - * with KYC status information for this merchant. - * - * @param cls closure - * @param h_wire hash of the wire account - * @param payto_uri payto:// URI of the merchant's bank account - * @param exchange_url base URL of the exchange for which this is a status - * @param last_check when did we last get an update on our KYC status from the exchange - * @param kyc_ok true if we satisfied the KYC requirements - * @param access_token access token for the KYC SPA, NULL if we cannot access it yet (need KYC auth wire transfer) - * @param last_http_status last HTTP status from /kyc-check - * @param last_ec last Taler error code from /kyc-check - * @param in_aml_review true if the account is pending review - * @param jlimits JSON array of applicable AccountLimits, or NULL if unknown (like defaults apply) - */ -typedef void -(*TALER_MERCHANTDB_KycCallback)( - void *cls, - const struct TALER_MerchantWireHashP *h_wire, - struct TALER_FullPayto payto_uri, - const char *exchange_url, - struct GNUNET_TIME_Timestamp last_check, - bool kyc_ok, - const struct TALER_AccountAccessTokenP *access_token, - unsigned int last_http_status, - enum TALER_ErrorCode last_ec, - bool in_aml_review, - const json_t *jlimits); - - -/** - * Function called from ``account_kyc_get_outdated`` - * with information about outdated KYC status information. - * - * @param cls closure - * @param instance_id which instance is this about - * @param exchange_url base URL of the exchange for which the status is dated - * @param h_wire hash of the wire account for which the status is dated - */ -typedef void -(*TALER_MERCHANTDB_KycOutdatedCallback)( - void *cls, - const char *instance_id, - const char *exchange_url, - const struct TALER_MerchantWireHashP *h_wire); - - -/** - * Function called about the ``/keys`` status of every exchange - * we are working with. - * - * @param cls closure - * @param exchange_url base URL of the exchange - * @param next_download when will be the next download - * @param keys_expiration when does the current ``/keys`` response expire - * @param http_status last HTTP status from ``/keys`` - * @param ec last error code from fetching ``/keys`` - */ -typedef void -(*TALER_MERCHANTDB_ExchangesCallback)( - void *cls, - const char *exchange_url, - struct GNUNET_TIME_Absolute next_download, - struct GNUNET_TIME_Absolute keys_expiration, - unsigned int http_status, - enum TALER_ErrorCode ec); - -/** - * Results from trying to increase a refund. - */ -enum TALER_MERCHANTDB_RefundStatus -{ - - /** - * Refund amount exceeds legal exchange limits. - */ - TALER_MERCHANTDB_RS_LEGAL_FAILURE = -5, - - /** - * Refund amount currency does not match original payment. - */ - TALER_MERCHANTDB_RS_BAD_CURRENCY = -4, - - /** - * Refund amount exceeds original payment. - */ - TALER_MERCHANTDB_RS_TOO_HIGH = -3, - - /** - * Hard database failure. - */ - TALER_MERCHANTDB_RS_HARD_ERROR = -2, - - /** - * Soft database failure. - */ - TALER_MERCHANTDB_RS_SOFT_ERROR = -1, - - /** - * Order not found. - */ - TALER_MERCHANTDB_RS_NO_SUCH_ORDER = 0, - - /** - * Refund is now at or above the requested amount. - */ - TALER_MERCHANTDB_RS_SUCCESS = 1 - -}; - - -/** - * Function called with information about a wire transfer identifier. - * - * @param cls closure - * @param order_id the order to which the deposits belong - * @param deposit_value the amount deposited under @a order_id - * @param deposit_fee the fee charged for @a deposit_value - */ -typedef void -(*TALER_MERCHANTDB_TransferSummaryCallback)( - void *cls, - const char *order_id, - const struct TALER_Amount *deposit_value, - const struct TALER_Amount *deposit_fee); - - -/** - * Function called with information about wire transfers - * that taler-merchant-exchange still needs to process. - * - * @param cls closure - * @param rowid row of the transfer in the merchant database - * @param instance_id instance that received the transfer - * @param exchange_url URL of the exchange that is making the deposit - * @param payto_uri account of the merchant that received the transfer - * @param wtid wire transfer subject identifying the aggregation - * @param next_attempt when should we next try to interact with the exchange - */ -typedef void -(*TALER_MERCHANTDB_OpenTransferCallback)( - void *cls, - uint64_t rowid, - const char *instance_id, - const char *exchange_url, - struct TALER_FullPayto payto_uri, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct GNUNET_TIME_Absolute next_attempt); - - -/** - * Callback for results from `lookup_pending_deposits`. - * - * @param cls NULL - * @param deposit_serial identifies the deposit operation - * @param wire_deadline when is the wire due - * @param retry_time when to next try the exchange again - * @param h_contract_terms hash of the contract terms - * @param merchant_priv private key of the merchant - * @param instance_id name of the instance - * @param h_wire hash of the merchant's wire account into - * @param amount_with_fee amount the exchange will deposit for this coin - * @param deposit_fee fee the exchange will charge for this coin which the deposit was made - * @param coin_pub public key of the deposited coin - */ -typedef void -(*TALER_MERCHANTDB_PendingDepositsCallback) ( - void *cls, - uint64_t deposit_serial, - struct GNUNET_TIME_Absolute wire_deadline, - struct GNUNET_TIME_Absolute retry_time, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_MerchantPrivateKeyP *merchant_priv, - const char *instance_id, - const struct TALER_MerchantWireHashP *h_wire, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *deposit_fee, - const struct TALER_CoinSpendPublicKeyP *coin_pub); - - -/** - * Function called with detailed information about a wire transfer and - * the underlying deposits that are being aggregated. - * - * @param cls closure - * @param current_offset offset in the exchange reply we are at - * @param ttd details about the transfer at @a current_offset - */ -typedef void -(*TALER_MERCHANTDB_TransferDetailsCallback)( - void *cls, - unsigned int current_offset, - const struct TALER_TrackTransferDetails *ttd); - - -/** - * Function called with information about a accounts - * the wirewatcher should monitor. - * - * @param cls closure - * @param instance instance that owns the account - * @param payto_uri account URI - * @param credit_facade_url URL for the credit facade - * @param credit_facade_credentials account access credentials - * @param last_serial last transaction serial (inclusive) we have seen from this account - */ -typedef void -(*TALER_MERCHANTDB_WirewatchWorkCallback)( - void *cls, - const char *instance, - struct TALER_FullPayto payto_uri, - const char *credit_facade_url, - const json_t *credit_facade_credentials, - uint64_t last_serial); - - -/** - * Function called with information about a wire transfer. - * - * @param cls closure with a `json_t *` array to build up the response - * @param expected_credit_amount how we expect to see wired to the merchant (minus fees), NULL if unknown - * @param wtid wire transfer identifier - * @param payto_uri target account that received the wire transfer - * @param exchange_url base URL of the exchange that made the wire transfer - * @param transfer_serial_id serial number identifying the transfer in the backend - * @param expected_transfer_serial_id serial number identifying the expected transfer in the backend, 0 if not @a expected - * @param execution_time when did the exchange make the transfer, #GNUNET_TIME_UNIT_FOREVER_ABS - * if it did not yet happen - * @param expected true if the merchant acknowledged the wire transfer reception - */ -typedef void -(*TALER_MERCHANTDB_TransferCallback)( - void *cls, - const struct TALER_Amount *expected_credit_amount, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct TALER_FullPayto payto_uri, - const char *exchange_url, - uint64_t transfer_serial_id, - uint64_t expected_transfer_serial_id, - struct GNUNET_TIME_Absolute execution_time, - bool expected); - - -/** - * Function called with information about expected incoming wire transfers. - * - * @param cls closure with a `json_t *` array to build up the response - * @param expected_credit_amount how we expect to see wired to the merchant (minus fees), NULL if unknown - * @param wtid wire transfer identifier - * @param payto_uri target account that received the wire transfer - * @param exchange_url base URL of the exchange that made the wire transfer - * @param expected_transfer_serial_id serial number identifying the expected transfer in the backend - * @param execution_time when did the exchange claim to have made the transfer - * @param confirmed true if the merchant confirmed this wire transfer - * false if it is so far only claimed to have been made by the exchange - * @param validated true if the reconciliation succeeded - * @param last_http_status HTTP status of our last request to the exchange for this transfer - * @param last_ec last error code we got back (otherwise #TALER_EC_NONE) - * @param last_error_detail last detail we got back (or NULL for none) - */ -typedef void -(*TALER_MERCHANTDB_IncomingCallback)( - void *cls, - const struct TALER_Amount *expected_credit_amount, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct TALER_FullPayto payto_uri, - const char *exchange_url, - uint64_t expected_transfer_serial_id, - struct GNUNET_TIME_Timestamp execution_time, - bool confirmed, - bool validated, - unsigned int last_http_status, - enum TALER_ErrorCode last_ec, - const char *last_error_detail); - - -/** - * If the given account is feasible, add it to the array - * of accounts we return. - * - * @param cls closure - * @param payto_uri URI of the account - * @param conversion_url URL of a conversion service - * @param debit_restrictions restrictions for debits from account - * @param credit_restrictions restrictions for credits to account - * @param master_sig signature affirming the account - */ -typedef void -(*TALER_MERCHANTDB_ExchangeAccountCallback) ( - void *cls, - struct TALER_FullPayto payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - const struct TALER_MasterSignatureP *master_sig); - - -/** - * Function called with information about a coin that was deposited. - * - * @param cls closure - * @param deposit_serial which deposit operation is this about - * @param exchange_url URL of the exchange that issued the coin - * @param h_wire hash of merchant's wire details - * @param deposit_timestamp when was the deposit made - * @param amount_with_fee amount the exchange will deposit for this coin - * @param deposit_fee fee the exchange will charge for this coin - * @param coin_pub public key of the coin - */ -typedef void -(*TALER_MERCHANTDB_DepositedCoinsCallback)( - void *cls, - uint64_t deposit_serial, - const char *exchange_url, - const struct TALER_MerchantWireHashP *h_wire, - struct GNUNET_TIME_Timestamp deposit_timestamp, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *deposit_fee, - const struct TALER_CoinSpendPublicKeyP *coin_pub); - - -/** - * Function called with information about a coin that was deposited. - * - * @param cls closure - * @param exchange_url URL of the exchange that issued the coin - * @param amount_with_fee amount the exchange will deposit for this coin - * @param deposit_fee fee the exchange will charge for this coin - * @param refund_fee fee the exchange will charge for refunding this coin - * @param wire_fee wire fee the exchange charges - * @param h_wire hash of merchant's wire details - * @param deposit_timestamp when did the exchange receive the deposit - * @param refund_deadline until when are refunds allowed - * @param exchange_sig signature by the exchange - * @param exchange_pub exchange signing key used for @a exchange_sig - */ -typedef void -(*TALER_MERCHANTDB_CoinDepositCallback)( - void *cls, - 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 TALER_MerchantWireHashP *h_wire, - struct GNUNET_TIME_Timestamp deposit_timestamp, - struct GNUNET_TIME_Timestamp refund_deadline, - const struct TALER_ExchangeSignatureP *exchange_sig, - const struct TALER_ExchangePublicKeyP *exchange_pub); - - -/** - * Possible token family kinds. - */ -enum TALER_MERCHANTDB_TokenFamilyKind -{ - - /** - * Token family representing a discount token - */ - TALER_MERCHANTDB_TFK_Discount = 0, - - /** - * Token family representing a subscription token - */ - TALER_MERCHANTDB_TFK_Subscription = 1, - -}; - - -/** - * Typically called by `lookup_token_families`. - * - * @param cls closure - * @param slug slug of the token family - * @param name name of the token family - * @param description description of the token family - * @param description_i18n Internationalized token family description. - * @param start_time start time of the token family's validity period - * @param expiration end time of the token family's validity period - * @param kind kind of the token family - */ -typedef void -(*TALER_MERCHANTDB_TokenFamiliesCallback)( - void *cls, - const char *slug, - const char *name, - const char *description, - const json_t *description_i18n, - struct GNUNET_TIME_Timestamp start_time, - struct GNUNET_TIME_Timestamp expiration, - const char *kind); - - -/** - * Typically called by `select_money_pots`. - * - * @param cls closure - * @param name set to name of the pot - * @param pot_total_len length of @a pot_totals array - * @param pot_totals amounts currently in the pot - */ -typedef void -(*TALER_MERCHANTDB_MoneyPotsCallback)( - void *cls, - uint64_t money_pot_id, - const char *name, - size_t pot_total_len, - const struct TALER_Amount *pot_totals); - - -/** - * Typically called by `select_reports`. - * - * @param cls closure - * @param name name of the report - * @param description description of the report - * @param frequency the report frequency - */ -typedef void -(*TALER_MERCHANTDB_ReportsCallback)( - void *cls, - uint64_t report_id, - const char *report_description, - struct GNUNET_TIME_Relative frequency); - - -/** - * Typically called by `lookup_reports_pending`. - * - * @param cls closure - * @param instance_id name of the instance - * @param report_id serial number of the report - * @param report_program_section configuration section of program - * for report generation - * @param report_description text describing the report - * @param mime_type mime type to request - * @param report_token token to authorize access to the data source - * @param target_address where to send report data - * @param frequency report frequency - * @param frequency_shift how much to shift the report time from a - * multiple of the report @a frequency - * @param next_transmission when is the next transmission of this report - * due - */ -typedef void -(*TALER_MERCHANTDB_ReportsPendingCallback)( - void *cls, - const char *instance_id, - uint64_t report_id, - const char *report_program_section, - const char *report_description, - const char *mime_type, - const struct TALER_MERCHANT_ReportToken *report_token, - const char *target_address, - struct GNUNET_TIME_Relative frequency, - struct GNUNET_TIME_Relative frequency_shift, - struct GNUNET_TIME_Absolute next_transmission); - - -/** - * Typically called by `select_product_groups`. - * - * @param cls closure - * @param product_group_id ID of the product group - * @param group_name set to name of the group - * @param group_description set to description of the group - */ -typedef void -(*TALER_MERCHANTDB_ProductGroupsCallback)( - void *cls, - uint64_t product_group_id, - const char *group_name, - const char *group_description); - - -/** - * Details about a token family. - */ -struct TALER_MERCHANTDB_TokenFamilyDetails -{ - /** - * Token family slug used for identification. - */ - char *slug; - - /** - * User readable name of the token family. - */ - char *name; - - /** - * Description of the token family. - */ - char *description; - - /** - * Internationalized token family description. - */ - json_t *description_i18n; - - /** - * Meta-data associated with the token family. - * Includes information like "trusted_domains" or - * "expected_domains", if set. - */ - json_t *extra_data; - - /** - * Cipher that should be used for this token family. Note: We do not expose - * this over the API and do not let clients set it. NULL for default (when - * calling database). - */ - char *cipher_spec; - - /** - * Start time of the token family duration. - */ - struct GNUNET_TIME_Timestamp valid_after; - - /** - * End time of the token family duration. - */ - struct GNUNET_TIME_Timestamp valid_before; - - /** - * Validity duration of the token family. Must be larger or - * equal to @a rounding plus @a start_offset_s. - */ - struct GNUNET_TIME_Relative duration; - - /** - * Rounding duration of the token family. - */ - struct GNUNET_TIME_Relative validity_granularity; - - /** - * Offset (in seconds) to subtract from the rounded - * validity start period. - */ - struct GNUNET_TIME_Relative start_offset; - - /** - * Token family kind. - */ - enum TALER_MERCHANTDB_TokenFamilyKind kind; - - /** - * Counter for each issued token of this family. - */ - uint64_t issued; - - /** - * Counter for each used token of this family. - */ - uint64_t used; -}; - - -/** - * Details about a token key. - */ -struct TALER_MERCHANTDB_TokenFamilyKeyDetails -{ - /** - * Tokens signed with this key are valid from this date on. - * This is the time the key was created. - */ - struct GNUNET_TIME_Timestamp signature_validity_start; // valid_after; - - /** - * Tokens signed with this key are valid until this date. - */ - struct GNUNET_TIME_Timestamp signature_validity_end; // valid_before; - - /** - * Private key expires for use at this time. Signatures can - * only be created until this point. - */ - struct GNUNET_TIME_Timestamp private_key_deleted_at; - - /** - * Token family public key. - */ - struct TALER_TokenIssuePublicKey pub; - - /** - * Token family private key. - */ - struct TALER_TokenIssuePrivateKey priv; - - /** - * Details about the token family this key belongs to. - */ - struct TALER_MERCHANTDB_TokenFamilyDetails token_family; -}; - - -/** - * Function called with applicable token keys. - * - * @param cls closure - * @param details details about an applicable key - */ -typedef void -(*TALER_MERCHANTDB_TokenKeyCallback) ( - void *cls, - const struct TALER_MERCHANTDB_TokenFamilyKeyDetails *details); - - -/** - * Details about a spent token. - */ -struct TALER_MERCHANTDB_SpentTokenDetails -{ - /** - * Public key of the spent token. - */ - struct TALER_TokenUsePublicKeyP pub; - - /** - * Signature that this token was spent on the specified order. - */ - struct TALER_TokenUseSignatureP sig; - - /** - * Blind signature for the spent token to prove validity of it. - */ - struct TALER_BlindedTokenIssueSignature blind_sig; -}; - - -/** - * Function called with information about a token that was used. - * - * @param cls closure - * @param spent_token_serial which used token is this about - * @param h_contract_terms hash of the contract terms this token was used on - * @param h_issue_pub hash of the token issue public key - * @param use_pub token use public key - * @param use_sig token use signature - * @param issue_sig unblinded token issue signature - */ -typedef void -(*TALER_MERCHANTDB_UsedTokensCallback)( - void *cls, - uint64_t spent_token_serial, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_TokenIssuePublicKeyHashP *h_issue_pub, - const struct TALER_TokenUsePublicKeyP *use_pub, - const struct TALER_TokenUseSignatureP *use_sig, - const struct TALER_TokenIssueSignature *issue_sig); - - -/** - * Returns amount-valued statistics by bucket. - * Called by `lookup_statistics_amount_by_bucket`. - * - * @param cls closure - * @param description description of the statistic - * @param bucket_start start time of the bucket - * @param bucket_end end time of the bucket - * @param bucket_range range of the bucket - * @param cumulative_amounts_len the length of @a cumulative_amounts - * @param cumulative_amounts the cumulative amounts array - */ -typedef void -(*TALER_MERCHANTDB_AmountByBucketStatisticsCallback)( - void *cls, - const char *description, - struct GNUNET_TIME_Timestamp bucket_start, - struct GNUNET_TIME_Timestamp bucket_end, - const char *bucket_range, - unsigned int cumulative_amounts_len, - const struct TALER_Amount cumulative_amounts[static cumulative_amounts_len]); - - -/** - * Returns amount-valued statistics by bucket. - * Called by `lookup_statistics_amount_by_bucket2`. - * - * @param cls closure - * @param bucket_start start time of the bucket - * @param cumulative_amounts_len the length of @a cumulative_amounts - * @param cumulative_amounts the cumulative amounts array - */ -typedef void -(*TALER_MERCHANTDB_AmountByBucketStatisticsCallback2)( - void *cls, - struct GNUNET_TIME_Timestamp bucket_start, - unsigned int cumulative_amounts_len, - const struct TALER_Amount cumulative_amounts[static cumulative_amounts_len]); - - -/** - * Returns amount-valued statistics over a particular time interval. - * Called by `lookup_statistics_amount_by_interval`. - * - * @param cls closure - * @param description description of the statistic - * @param interval_start start time of the bucket - * @param cumulative_amounts_len the length of @a cumulative_amounts - * @param cumulative_amounts the cumulative amounts array - */ -typedef void -(*TALER_MERCHANTDB_AmountByIntervalStatisticsCallback)( - void *cls, - const char *description, - struct GNUNET_TIME_Timestamp interval_start, - unsigned int cumulative_amounts_len, - const struct TALER_Amount cumulative_amounts[static cumulative_amounts_len]); - - -/** - * Function returning integer-valued statistics for a bucket. - * Called by `lookup_statistics_counter_by_bucket`. - * - * @param cls closure - * @param description description of the statistic - * @param bucket_start start time of the bucket - * @param bucket_end end time of the bucket - * @param bucket_range range of the bucket - * @param cumulative_counter counter value - */ -typedef void -(*TALER_MERCHANTDB_CounterByBucketStatisticsCallback)( - void *cls, - const char *description, - struct GNUNET_TIME_Timestamp bucket_start, - struct GNUNET_TIME_Timestamp bucket_end, - const char *bucket_range, - uint64_t cumulative_counter); - - -/** - * Function returning reconciliation details for an - * expected incoming wire transfer. - * Called by `lookup_reconciliation_details`. - * - * @param cls closure - * @param order_id order that was paid and then aggregated - * @param remaining_deposit deposited amount minus any refunds - * @param deposit_fee deposit fees paid to the exchange for the order - */ -typedef void -(*TALER_MERCHANTDB_ReconciliationDetailsCallback)( - void *cls, - const char *order_id, - const struct TALER_Amount *remaining_deposit, - const struct TALER_Amount *deposit_fee); - - -/** - * Details about a statistic with counter. - */ -struct TALER_MERCHANTDB_StatisticsCounterByBucketDetails -{ - /** - * Start time of the bucket (inclusive). - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * End time of the bucket (exclusive). - */ - struct GNUNET_TIME_Timestamp end_time; - - /** - * Description of the statistic - */ - char*description; - - /** - * Range of the bucket - */ - char *range; - - /** - * Sum of all counters falling under the given - * SLUG within this timeframe - */ - uint64_t cumulative_number; -}; - -/** - * Details about a statistic with counter. - */ -struct TALER_MERCHANTDB_StatisticsCounterByIntervalDetails -{ - /** - * Start time of the interval. - * The interval always ends at the response generation time. - */ - struct GNUNET_TIME_Timestamp start_time; - - /** - * Sum of all counters falling under the given - * SLUG within this timeframe - */ - uint64_t cumulative_counter; -}; - - -/** - * Function returning integer-valued statistics for a time interval. - * Called by `lookup_statistics_counter_by_interval`. - * - * @param cls closure - * @param description description of the statistic - * @param interval_start start time of the interval - * @param cumulative_counter counter value - */ -typedef void -(*TALER_MERCHANTDB_CounterByIntervalStatisticsCallback)( - void *cls, - const char *description, - struct GNUNET_TIME_Timestamp interval_start, - uint64_t cumulative_counter); - - -/** - * Function returning integer-valued statistics for a bucket. - * Called by `lookup_statistics_counter_by_bucket2`. - * - * @param cls closure - * @param bucket_start start time of the bucket - * @param counters_len the length of @a cumulative_amounts - * @param descriptions description for the counter in the bucket - * @param counters the counters in the bucket - */ -typedef void -(*TALER_MERCHANTDB_CounterByBucketStatisticsCallback2)( - void *cls, - struct GNUNET_TIME_Timestamp bucket_start, - unsigned int counters_len, - const char *descriptions[static counters_len], - uint64_t counters[static counters_len]); - - -/** - * Handle to interact with the database. - * - * Functions ending with "_TR" run their OWN transaction scope - * and MUST NOT be called from within a transaction setup by the - * caller. Functions ending with "_NT" require the caller to - * setup a transaction scope. Functions without a suffix are - * simple, single SQL queries that MAY be used either way. - */ -struct TALER_MERCHANTDB_Plugin -{ - - /** - * Closure for all callbacks. - */ - void *cls; - - /** - * Name of the library which generated this plugin. Set by the - * plugin loader. - */ - char *library_name; - - /** - * Connect to the database. - * - * @param cls closure - */ - enum GNUNET_GenericReturnValue - (*connect)(void *cls); - - /** - * Drop merchant tables. Used for testcases and to reset the DB. - * - * @param cls closure - * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure - */ - enum GNUNET_GenericReturnValue - (*drop_tables)(void *cls); - - /** - * Garbage collect database. Removes unnecessary data. - * - * @param cls closure - * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure - */ - enum GNUNET_GenericReturnValue - (*gc)(void *cls); - - /** - * Initialize merchant tables - * - * @param cls closure - * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure - */ - enum GNUNET_GenericReturnValue - (*create_tables)(void *cls); - - /** - * Register callback to be invoked on events of type @a es. - * - * @param cls database context to use - * @param es specification of the event to listen for - * @param timeout how long to wait for the event - * @param cb function to call when the event happens, possibly - * multiple times (until cancel is invoked) - * @param cb_cls closure for @a cb - * @return handle useful to cancel the listener - */ - struct GNUNET_DB_EventHandler * - (*event_listen)(void *cls, - const struct GNUNET_DB_EventHeaderP *es, - struct GNUNET_TIME_Relative timeout, - GNUNET_DB_EventCallback cb, - void *cb_cls); - - /** - * Stop notifications. - * - * @param eh handle to unregister. - */ - void - (*event_listen_cancel)(struct GNUNET_DB_EventHandler *eh); - - - /** - * Notify all that listen on @a es of an event. - * - * @param cls database context to use - * @param es specification of the event to generate - * @param extra additional event data provided - * @param extra_size number of bytes in @a extra - */ - void - (*event_notify)(void *cls, - const struct GNUNET_DB_EventHeaderP *es, - const void *extra, - size_t extra_size); - - - /** - * Do a pre-flight check that we are not in an uncommitted transaction. If - * we are, die. Does not return anything, as we will continue regardless of - * the outcome. - * - * @param cls the `struct PostgresClosure` with the plugin-specific state - */ - void - (*preflight) (void *cls); - - /** - * Start a transaction. - * - * @param cls the `struct PostgresClosure` with the plugin-specific state - * @param name unique name identifying the transaction (for debugging), - * must point to a constant - * @return #GNUNET_OK on success - */ - enum GNUNET_GenericReturnValue - (*start)(void *cls, - const char *name); - - /** - * Start a transaction with isolation level 'read committed'. - * - * @param cls the `struct PostgresClosure` with the plugin-specific state - * @param name unique name identifying the transaction (for debugging), - * must point to a constant - * @return #GNUNET_OK on success - */ - enum GNUNET_GenericReturnValue - (*start_read_committed)(void *cls, - const char *name); - - /** - * Roll back the current transaction of a database connection. - * - * @param cls the `struct PostgresClosure` with the plugin-specific state - */ - void - (*rollback) (void *cls); - - /** - * Commit the current transaction of a database connection. - * - * @param cls the `struct PostgresClosure` with the plugin-specific state - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*commit)(void *cls); - - /** - * Lookup all of the instances this backend has configured. - * - * @param cls closure - * @param active_only only find 'active' instances - * @param cb function to call on all instances found - * @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 one of the instances this backend has configured. - * - * @param cls closure - * @param id ID of instance to look up - * @param active_only only find 'active' instances - * @param cb function to call on all instances found - * @param cb_cls closure for @a cb - */ - enum GNUNET_DB_QueryStatus - (*lookup_instance)(void *cls, - const char *id, - bool active_only, - TALER_MERCHANTDB_InstanceCallback cb, - void *cb_cls); - - /** - * Lookup authentication data of an instance. - * - * @param cls closure - * @param instance_id instance to query - * @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); - - - /** - * Insert information about an instance into our database. - * - * @param cls closure - * @param merchant_pub public key of the instance - * @param merchant_priv private key of the instance - * @param is details about the instance - * @param validation_needed true if validation is - * required before the instance can be used - * @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, - bool validation_needed); - - - /** - * Insert information about an instance's account into our database. - * - * @param cls closure - * @param account_details details about the account - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_account)( - void *cls, - const struct TALER_MERCHANTDB_AccountDetails *account_details); - - - /** - * Insert instance login token into our database. - * - * @param cls closure - * @param id identifier of the instance - * @param token value of the token - * @param creation_time the current time - * @param expiration_time when does the token expire - * @param validity_scope scope of the token - * @param description description of the token - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_login_token)( - void *cls, - const char *id, - const struct TALER_MERCHANTDB_LoginTokenP *token, - struct GNUNET_TIME_Timestamp creation_time, - struct GNUNET_TIME_Timestamp expiration_time, - uint32_t validity_scope, - const char *description); - - - /** - * Lookup information about a login token from database. - * - * @param cls closure - * @param id identifier of the instance - * @param token value of the token - * @param[out] expiration_time set to expiration time - * @param[out] validity_scope set to scope of the token - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_login_token)( - void *cls, - const char *id, - const struct TALER_MERCHANTDB_LoginTokenP *token, - struct GNUNET_TIME_Timestamp *expiration_time, - uint32_t *validity_scope); - - /** - * Lookup login tokens for instance. - * - * @param cls closure - * @param instance_id instance to lookup tokens for - * @param offset transfer_serial number of the transfer we want to offset from - * @param limit number of entries to return, negative for descending, - * positive for ascending - * @param cb function to call on all products found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_login_tokens)(void *cls, - const char *instance_id, - uint64_t offset, - int64_t limit, - TALER_MERCHANTDB_LoginTokensCallback cb, - void *cb_cls); - - /** - * Delete login token from database. - * - * @param cls closure - * @param id identifier of the instance - * @param token value of the token - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_login_token)( - void *cls, - const char *id, - const struct TALER_MERCHANTDB_LoginTokenP *token); - - /** - * Delete login token from database by serial. - * - * @param cls closure - * @param id identifier of the instance - * @param serial serial of the token - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_login_token_serial)( - void *cls, - const char *id, - uint64_t serial); - - - /** - * Update information about an instance's account into our database. - * - * @param cls closure - * @param id identifier of the instance - * @param h_wire which account to update - * @param extra_wire_subject_metadata additional metadata to include in wire transfer subjects - * @param credit_facade_url new facade URL, can be NULL - * @param credit_facade_credentials new credentials, can be NULL - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_account)( - void *cls, - const char *id, - const struct TALER_MerchantWireHashP *h_wire, - const char *extra_wire_subject_metadata, - const char *credit_facade_url, - const json_t *credit_facade_credentials); - - - /** - * Obtain information about an instance's accounts. - * - * @param cls closure - * @param id identifier of the instance - * @param cb function to call on each account - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_accounts)( - void *cls, - const char *id, - TALER_MERCHANTDB_AccountCallback cb, - void *cb_cls); - - - /** - * Obtain detailed information about an instance's account. - * - * @param cls closure - * @param id identifier of the instance - * @param h_wire wire hash of the account - * @param[out] ad account details returned - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_account)( - void *cls, - const char *id, - const struct TALER_MerchantWireHashP *h_wire, - struct TALER_MERCHANTDB_AccountDetails *ad); - - - /** - * Obtain detailed information about an instance's account. - * - * @param cls closure - * @param id identifier of the instance - * @param payto_uri URI of the account - * @param[out] ad account details returned - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_account_by_uri)( - void *cls, - const char *id, - struct TALER_FullPayto payto_uri, - struct TALER_MERCHANTDB_AccountDetails *ad); - - - /** - * Delete private key of an instance from our database. - * - * @param cls closure - * @param merchant_id identifier of the instance - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_instance_private_key)( - void *cls, - const char *merchant_id); - - /** - * Purge an instance and all associated information from our database. - * Highly likely to cause undesired data loss. Use with caution. - * - * @param cls closure - * @param merchant_id identifier of the instance - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*purge_instance)(void *cls, - const char *merchant_id); - - /** - * Update information about an instance into our database. - * - * @param cls closure - * @param is details about the instance - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_instance)(void *cls, - const struct TALER_MERCHANTDB_InstanceSettings *is); - - /** - * Update information about an instance's authentication settings - * into our database. - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param ias instance auth settings - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*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". - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param h_wire hash of the wire account to set to inactive - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*inactivate_account)(void *cls, - const char *merchant_id, - const struct TALER_MerchantWireHashP *h_wire); - - - /** - * Set an instance's account in our database to "active". - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param h_wire hash of the wire account to set to active - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*activate_account)(void *cls, - const char *merchant_id, - const struct TALER_MerchantWireHashP *h_wire); - - - /** - * Check an instance's account's KYC status. Triggers - * a request to taler-merchant-kyccheck to get a - * KYC status update as a side-effect! - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param h_wire hash of the wire account to check, - * NULL to check all accounts of the merchant - * @param exchange_url base URL of the exchange to check, - * NULL to check all exchanges - * @param kyc_cb KYC status callback to invoke - * @param kyc_cb_cls closure for @a kyc_cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*account_kyc_get_status)( - void *cls, - const char *merchant_id, - const struct TALER_MerchantWireHashP *h_wire, - const char *exchange_url, - TALER_MERCHANTDB_KycCallback kyc_cb, - void *kyc_cb_cls); - - - /** - * Find accounts requiring KYC checks. - * - * @param cls closure - * @param kyc_cb status callback to invoke - * @param kyc_cb_cls closure for @a kyc_cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*account_kyc_get_outdated)( - void *cls, - TALER_MERCHANTDB_KycOutdatedCallback kyc_cb, - void *kyc_cb_cls); - - - /** - * Check an account's KYC status at an exchange. - * - * @param cls closure - * @param merchant_payto_uri merchant backend instance ID - * @param instance_id the instance for which to check - * @param exchange_url base URL of the exchange - * @param[out] auth_ok true if @a access_token was set - * @param[out] access_token set to access token for /kyc-info - * @param[out] kyc_ok true if no urgent KYC work must be done for this account - * @param[out] last_http_status set to last HTTP status from exchange on /kyc-check - * @param[out] last_ec set to last Taler error code from exchange on /kyc-check - * @param[out] rule_gen set to decision row at the exchange, 0 if no - * known decision of the exchange exists for this record; used - * for long-polling for changes to exchange decisions - * @param[out] last_kyc_check set to time of last KYC check - * @param[out] next_kyc_poll when should we check the KYC status next - * @param[out] kyc_backoff current back-off frequency for KYC checks - * @param[out] aml_review set to true if the account is under AML review (if this exposed) - * @param[out] jlimits set to JSON array with AccountLimits, NULL if unknown (and likely defaults apply or KYC auth is urgently needed, see @a auth_ok) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*get_kyc_status)( - void *cls, - struct TALER_FullPayto merchant_account_uri, - const char *instance_id, - const char *exchange_url, - bool *auth_ok, - struct TALER_AccountAccessTokenP *access_token, - bool *kyc_ok, - unsigned int *last_http_status, - enum TALER_ErrorCode *last_ec, - uint64_t *rule_gen, - struct GNUNET_TIME_Timestamp *last_kyc_check, - struct GNUNET_TIME_Absolute *next_kyc_poll, - struct GNUNET_TIME_Relative *kyc_backoff, - bool *aml_review, - json_t **jlimits); - - - /** - * Check an account's KYC limits at an exchange. - * - * @param cls closure - * @param merchant_payto_uri merchant backend instance ID - * @param instance_id the instance for which to check - * @param exchange_url base URL of the exchange - * @param[out] kyc_ok true if no urgent KYC work must be done for this account - * @param[out] no_access_token true if we do not have a valid KYC access token (KYC auth missing) - * @param[out] jlimits set to JSON array with AccountLimits, NULL if unknown (and likely defaults apply or KYC auth is urgently needed, see @a auth_ok) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*get_kyc_limits)( - void *cls, - struct TALER_FullPayto merchant_account_uri, - const char *instance_id, - const char *exchange_url, - bool *kyc_ok, - bool *no_access_token, - json_t **jlimits); - - - /** - * Update an instance's account's KYC status. - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param h_wire hash of the wire account to check - * @param exchange_url base URL of the exchange to check - * @param timestamp timestamp to store - * @param next_time when should we next check the KYC status - * @param kyc_backoff what is the current backoff between KYC status checks - * @param exchange_http_status HTTP status code returned last by the exchange - * @param exchange_ec_code Taler error code returned last by the exchange - * @param rule_gen generation of the rule in the exchange database - * (useful for long-polling to wait for rule changes) - * @param access_token access token for the KYC process, NULL for none - * @param jlimits JSON array with AccountLimits returned by the exchange - * @param in_aml_review true if the exchange says the account is under review - * @param kyc_ok current KYC status (true for satisfied) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*account_kyc_set_status)( - void *cls, - const char *merchant_id, - const struct TALER_MerchantWireHashP *h_wire, - const char *exchange_url, - struct GNUNET_TIME_Timestamp timestamp, - struct GNUNET_TIME_Absolute next_time, - struct GNUNET_TIME_Relative kyc_backoff, - unsigned int exchange_http_status, - enum TALER_ErrorCode exchange_ec_code, - uint64_t rule_gen, - const struct TALER_AccountAccessTokenP *access_token, - const json_t *jlimits, - bool in_aml_review, - bool kyc_ok); - - - /** - * Set an instance's account's KYC status to failed. - * - * @param cls closure - * @param merchant_id merchant backend instance ID - * @param h_wire hash of the wire account to check - * @param exchange_url base URL of the exchange to check - * @param timestamp timestamp to store - * @param exchange_http_status HTTP status code returned last by the exchange - * @param kyc_ok current KYC status (should be false) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*account_kyc_set_failed)( - void *cls, - const char *merchant_id, - const struct TALER_MerchantWireHashP *h_wire, - const char *exchange_url, - struct GNUNET_TIME_Timestamp timestamp, - unsigned int exchange_http_status, - bool kyc_ok); - - - /** - * Lookup all of the products the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param offset transfer_serial number of the transfer we want to offset from - * @param limit number of entries to return, negative for descending, - * positive for ascending - * @param category_filter filter products by category, NULL to not filter; - * uses the Postgresql "LIKE" pattern matcher, so - * "%" stands for any sequence of zero or more characters, - * "_" stands for any single character; - * use "\%" and "\_" to exactly match "%" or "_". - * We will always use case-insensitive searches, for case-sensitive - * matching the client should filter the result set. - * @param name_filter filter products by name, NULL to not filter - * uses the Postgresql "LIKE" pattern matcher, so - * "%" stands for any sequence of zero or more characters, - * "_" stands for any single character - * use "\%" and "\_" to exactly match "%" or "_". - * We will always use case-insensitive searches, for case-sensitive - * matching the client should filter the result set. - * @param description_filter filter products by description, NULL to not filter - * uses the Postgresql "LIKE" pattern matcher, so - * "%" stands for any sequence of zero or more characters, - * "_" stands for any single character - * use "\%" and "\_" to exactly match "%" or "_". - * We will always use case-insensitive searches, for case-sensitive - * matching the client should filter the result set. - * @param cb function to call on all products found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_products)(void *cls, - const char *instance_id, - uint64_t offset, - int64_t limit, - const char *category_filter, - const char *name_filter, - const char *description_filter, - TALER_MERCHANTDB_ProductsCallback cb, - void *cb_cls); - - - /** - * Lookup full details of all of the products the given instance has configured (expensive). - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param cb function to call on all products found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_all_products)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_ProductCallback cb, - void *cb_cls); - - /** - * Lookup inventory details for all products of an instance. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param cb function to call on all products found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_inventory_products)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_InventoryProductCallback cb, - void *cb_cls); - - /** - * Lookup inventory details for a subset of products. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param product_ids product IDs to include (can be NULL/empty) - * @param num_product_ids number of entries in @a product_ids - * @param categories category IDs to include (can be NULL/empty) - * @param num_categories number of entries in @a categories - * @param cb function to call on all products found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_inventory_products_filtered)( - void *cls, - const char *instance_id, - const char *const *product_ids, - size_t num_product_ids, - const uint64_t *categories, - size_t num_categories, - TALER_MERCHANTDB_InventoryProductCallback cb, - void *cb_cls); - - /** - * Call @a cb on each exchange we have in the database. - * - * @param cls closure - * @param cb callback to invoke - * @param cb_cls closure for @a cb - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*select_exchanges) (void *cls, - TALER_MERCHANTDB_ExchangesCallback cb, - void *cb_cls); - - /** - * Lookup details about a particular product. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param product_id product to lookup - * @param[out] pd set to the product details on success, can be NULL - * (in that case we only want to check if the product exists) - * @param[out] num_categories set to length of @a categories array - * @param[out] categories set to array of categories the - * product is in, caller must free() it. - * @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, - size_t *num_categories, - uint64_t **categories); - - /** - * Lookup product image by its hash. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param image_hash lowercase hexadecimal representation of the SHA256 hash - * @param[out] image set to base64-encoded data URL on success, caller must free() - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_product_image_by_hash)(void *cls, - const char *instance_id, - const char *image_hash, - char **image); - - /** - * Delete information about a product. Note that the transaction must - * enforce that no stocks are currently locked. - * - * @param cls closure - * @param instance_id instance to delete product of - * @param product_id product to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if locks prevent deletion OR product unknown - */ - enum GNUNET_DB_QueryStatus - (*delete_product)(void *cls, - const char *instance_id, - const char *product_id); - - /** - * Insert details about a particular product. - * - * @param cls closure - * @param instance_id instance to insert product for - * @param product_id product identifier of product to insert - * @param pd the product details to insert - * @param num_cats length of @a cats array - * @param cats array of categories the product is in - * @param[out] no_instance set to true if @a instance_id is unknown - * @param[out] conflict set to true if a conflicting - * product already exists in the database - * @param[out] no_cat set to index of non-existing category from @a cats, or -1 if all @a cats were found - * @param[out] no_group set to true if the product group in @a pd is unknown - * @param[out] no_pot set to true if the money pot in @a pd is unknown - * @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, - size_t num_cats, - const uint64_t *cats, - bool *no_instance, - bool *conflict, - ssize_t *no_cat, - bool *no_group, - bool *no_pot); - - /** - * Update details about a particular product. Note that the - * transaction must enforce that the sold/stocked/lost counters - * are not reduced (i.e. by expanding the WHERE clause on the existing - * values). - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param product_id product to lookup - * @param pd product details with updated values - * @param num_cats length of @a cats array - * @param cats number of categories the product is in - * @param[out] no_instance the update failed as the instance is unknown - * @param[out] no_cat set to -1 on success, otherwise the update failed and this is set - * to the index of a category in @a cats that is unknown - * @param[out] no_product the @a product_id is unknown - * @param[out] lost_reduced the update failed as the counter of units lost would have been lowered - * @param[out] sold_reduced the update failed as the counter of units sold would have been lowered - * @param[out] stocked_reduced the update failed as the counter of units stocked would have been lowered - * @param[out] no_group set to true if the product group in @a pd is unknown - * @param[out] no_pot set to true if the money pot in @a pd is unknown - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_product)(void *cls, - const char *instance_id, - const char *product_id, - const struct TALER_MERCHANTDB_ProductDetails *pd, - size_t num_cats, - const uint64_t *cats, - bool *no_instance, - ssize_t *no_cat, - bool *no_product, - bool *lost_reduced, - bool *sold_reduced, - bool *stocked_reduced, - bool *no_group, - bool *no_pot); - - - /** - * Lock stocks of a particular product. Note that the transaction must - * enforce that the "stocked-sold-lost >= locked" constraint holds. - * - * @param cls closure - * @param instance_id instance to lookup products for - * @param product_id product to lookup - * @param uuid the UUID that holds the lock - * @param quantity how many units should be locked - * @param quantity_frac fractional component of units to lock, in units of - * 1/1000000 of the base value - * @param expiration_time when should the lock expire - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the - * 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, - uint32_t quantity_frac, - struct GNUNET_TIME_Timestamp expiration_time); - - - /** - * Release all expired product locks, including - * those from expired offers -- across all - * instances. - * - * @param cls closure - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*expire_locks)(void *cls); - - - /** - * Delete information about an order. Note that the transaction must - * enforce that the order is not awaiting payment anymore. - * - * @param cls closure - * @param instance_id instance to delete order of - * @param order_id order to delete - * @param force force deletion of claimed but unpaid orders - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if locks prevent deletion OR order unknown - */ - enum GNUNET_DB_QueryStatus - (*delete_order)(void *cls, - const char *instance_id, - const char *order_id, - bool force); - - - /** - * Retrieve order given its @a order_id and the @a instance_id. - * - * @param cls closure - * @param instance_id instance to obtain order of - * @param order_id order id used to perform the lookup - * @param[out] claim_token the claim token generated for the order, - * NULL to only test if the order exists - * @param[out] h_post_data set to the hash of the POST data that created the order - * @param[out] contract_terms where to store the retrieved contract terms, - * NULL to only test if the order exists - * @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 TALER_MerchantPostDataHashP *h_post_data, - json_t **contract_terms); - - - /** - * Retrieve order summary given its @a order_id and the @a instance_id. - * - * @param cls closure - * @param instance_id instance to obtain order of - * @param order_id order id used to perform the lookup - * @param[out] timestamp when was the order created - * @param[out] order_serial under which serial do we keep this order - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_order_summary)(void *cls, - const char *instance_id, - const char *order_id, - struct GNUNET_TIME_Timestamp *timestamp, - uint64_t *order_serial); - - - /** - * Retrieve orders given the @a instance_id. - * - * @param cls closure - * @param instance_id instance to obtain order of - * @param of filter to apply when looking up orders - * @param[out] contract_terms where to store the retrieved contract terms, - * NULL to only test if the order exists - * @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); - - - /** - * Insert order into db. - * - * @param cls closure - * @param instance_id identifies the instance responsible for the order - * @param order_id alphanumeric string that uniquely identifies the order - * @param session_id session ID for the order - * @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 - * @param pos_key encoded key for payment verification - * @param pos_algorithm algorithm to compute the payment verification - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_order)(void *cls, - const char *instance_id, - const char *order_id, - const char *session_id, - const struct TALER_MerchantPostDataHashP *h_post_data, - struct GNUNET_TIME_Timestamp pay_deadline, - const struct TALER_ClaimTokenP *claim_token, - const json_t *contract_terms, - const char *pos_key, - enum TALER_MerchantConfirmationAlgorithm pos_algorithm); - - - /** - * Insert unclaim signature into DB and unclaim the order. - * - * @param cls closure - * @param instance_id instance of the operation (checked) - * @param merchant_pub public key of the instance (for notifications) - * @param order_id identifies the order to unclaim - * @param nonce claim nonce of the original claim - * @param h_contract hash of the contract to unclaim - * @param nsig signature by the nonce private key authorizing the unclaim - * @return transaction status, 0 if an order with this @a nonce - * and @a h_contract was not found; 1 if the request is idempotent - */ - enum GNUNET_DB_QueryStatus - (*insert_unclaim_signature)( - void *cls, - const char *instance_id, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const char *order_id, - const struct GNUNET_CRYPTO_EddsaPublicKey *nonce, - const struct GNUNET_HashCode *h_contract, - const struct GNUNET_CRYPTO_EddsaSignature *nsig); - - - /** - * Insert blinded signatures for an order. - * - * @param cls closure - * @param order_id order ID to insert blinded signatures for - * @param i index of the blinded signature in the output array - * @param hash hash of the token - * @param blinded_sigs JSON array of blinded signatures - */ - enum GNUNET_DB_QueryStatus - (*insert_order_blinded_sigs)( - void *cls, - const char *order_id, - uint32_t i, - const struct GNUNET_HashCode *hash, - const struct GNUNET_CRYPTO_BlindedSignature *blind_sig); - - - /** - * Release an inventory lock by UUID. Releases ALL stocks locked under - * the given UUID. - * - * @param cls closure - * @param uuid the UUID to release locks for - * @return transaction status, - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS means there are no locks under @a uuid - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT indicates success - */ - enum GNUNET_DB_QueryStatus - (*unlock_inventory)(void *cls, - const struct GNUNET_Uuid *uuid); - - - /** - * Lock inventory stock to a particular order. - * - * @param cls closure - * @param instance_id identifies the instance responsible for the order - * @param order_id alphanumeric string that uniquely identifies the order - * @param product_id uniquely identifies the product to be locked - * @param quantity how many units should be locked to the @a order_id - * @param quantity_frac fractional component of the quantity to be locked, - * in units of 1/1000000 of the base value - * @return transaction status, - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS means there are insufficient stocks - * #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, - uint32_t quantity_frac); - - - /** - * Select blinded signatures for an order. - * - * @param cls closure - * @param order_id order ID to select blinded signatures for - * @param cb callback to call for each blinded signature found - * @param cb_cls closure for @a cb - */ - enum GNUNET_DB_QueryStatus - (*select_order_blinded_sigs)( - void *cls, - const char *order_id, - TALER_MERCHANTDB_BlindedSigCallback cb, - void *cb_cls); - - - /** - * Retrieve contract terms given its @a order_id - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order_id used to lookup. - * @param[out] contract_terms where to store the result, NULL to only check for existence - * @param[out] order_serial set to the order's serial number - * @param[out] paid set to true if the order is fully paid - * @param[out] claim_token set to the claim token, NULL to only check for existence - * @param[out] pos_key encoded key for payment verification - * @param[out] pos_algorithm set to algorithm to compute the payment verification - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_contract_terms2)( - void *cls, - const char *instance_id, - const char *order_id, - json_t **contract_terms, - uint64_t *order_serial, - bool *paid, - struct TALER_ClaimTokenP *claim_token, - char **pos_key, - enum TALER_MerchantConfirmationAlgorithm *pricing_algorithm); - - - /** - * Retrieve contract terms given its @a order_id - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order_id used to lookup - * @param session_id session_id to compare, can be NULL - * @param[out] contract_terms where to store the result, NULL to only check for existence - * @param[out] order_serial set to the order's serial number - * @param[out] paid set to true if the order is fully paid - * @param[out] wired set to true if the exchange wired the funds - * @param[out] session_matches set to true if @a session_id matches session stored for this contract - * @param[out] claim_token set to the claim token, NULL to only check for existence - * @param[out] choice_index set to the choice index, -1 if not set - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_contract_terms3)( - void *cls, - const char *instance_id, - const char *order_id, - const char *session_id, - json_t **contract_terms, - uint64_t *order_serial, - bool *paid, - bool *wired, - bool *session_matches, - struct TALER_ClaimTokenP *claim_token, - int16_t *choice_index); - - - /** - * Retrieve contract terms given its @a order_id - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order_id used to lookup. - * @param[out] contract_terms where to store the result, NULL to only check for existence - * @param[out] order_serial set to the order's serial number - * @param[out] claim_token set to the claim token, NULL to only check for existence - * @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, - struct TALER_ClaimTokenP *claim_token); - - - /** - * Store contract terms given its @a order_id. Note that some attributes are - * expected to be calculated inside of the function, like the hash of the - * contract terms (to be hashed), the creation_time and pay_deadline (to be - * obtained from the merchant_orders table). The "session_id" should be - * initially set to the empty string. The "fulfillment_url" and "refund_deadline" - * must be extracted from @a contract_terms. - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order_id used to store - * @param claim_token the token belonging to the order - * @param[out] order_serial set to the serial of the order - * @return transaction status, #GNUNET_DB_STATUS_HARD_ERROR if @a contract_terms - * is malformed - */ - enum GNUNET_DB_QueryStatus - (*insert_contract_terms)( - void *cls, - const char *instance_id, - const char *order_id, - json_t *contract_terms, - uint64_t *order_serial); - - - /** - * Update the contract terms stored for @a order_id. Note that some attributes are - * expected to be calculated inside of the function, like the hash of the - * contract terms (to be hashed), the creation_time and pay_deadline (to be - * obtained from the merchant_orders table). The "session_id" should be - * initially set to the empty string. The "fulfillment_url" and "refund_deadline" - * must be extracted from @a contract_terms. - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order_id used to store - * @param contract_terms contract to store - * @return transaction status, #GNUNET_DB_STATUS_HARD_ERROR if @a contract_terms - * is malformed - */ - enum GNUNET_DB_QueryStatus - (*update_contract_terms)(void *cls, - const char *instance_id, - const char *order_id, - json_t *contract_terms); - - - /** - * Delete information about a contract. Note that the transaction must - * enforce that the contract is not awaiting payment anymore AND was not - * paid, or is past the legal expiration. - * - * @param cls closure - * @param instance_id instance to delete order of - * @param order_id order to delete - * @param legal_expiration how long do we need to keep (paid) contracts on - * file for legal reasons (i.e. taxation) - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * 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); - - - /** - * Lookup information about coins that were successfully deposited for a - * given contract. - * - * @param cls closure - * @param instance_id instance to lookup deposits for - * @param h_contract_terms proposal data's hashcode - * @param cb function to call with payment data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_deposits)(void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms - , - TALER_MERCHANTDB_DepositsCallback cb, - void *cb_cls); - - - /** - * Insert an exchange signing key into our database. - * - * @param cls closure - * @param master_pub exchange master public key used for @a master_sig - * @param exchange_pub exchange signing key to insert - * @param start_date when does the signing key become valid - * @param expire_date when does the signing key stop being used - * @param end_date when does the signing key become void as proof - * @param master_sig signature of @a master_pub over the @a exchange_pub and the dates - */ - enum GNUNET_DB_QueryStatus - (*insert_exchange_signkey)( - void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - const struct TALER_ExchangePublicKeyP *exchange_pub, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp expire_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - - - /** - * Insert deposit confirmation from the exchange into the database. - * - * @param cls closure - * @param instance_id instance to lookup deposits for - * @param deposit_timestamp time when the exchange generated the deposit confirmation - * @param h_contract_terms proposal data's hashcode - * @param exchange_url URL of the exchange that issued @a coin_pub - * @param wire_transfer_deadline when do we expect the wire transfer from the exchange - * @param total_without_fees deposited total in the batch without fees - * @param wire_fee wire fee the exchange charges - * @param h_wire hash of the wire details of the target account of the merchant - * @param exchange_sig signature from exchange that coin was accepted - * @param exchange_pub signing key that was used for @a exchange_sig - * @param[out] batch_deposit_serial_id set to the table row - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_deposit_confirmation)( - void *cls, - const char *instance_id, - struct GNUNET_TIME_Timestamp deposit_timestamp, - const struct TALER_PrivateContractHashP *h_contract_terms, - const char *exchange_url, - struct GNUNET_TIME_Timestamp wire_transfer_deadline, - const struct TALER_Amount *total_without_fees, - const struct TALER_Amount *wire_fee, - const struct TALER_MerchantWireHashP *h_wire, - const struct TALER_ExchangeSignatureP *exchange_sig, - const struct TALER_ExchangePublicKeyP *exchange_pub, - uint64_t *batch_deposit_serial_id); - - - /** - * Insert information about coin deposited as part of - * a batch into the database. - * - * @param cls closure - * @param offset offset of the coin in the batch - * @param deposit_confirmation_serial_id deposit confirmation for the batch the coin is part of - * @param coin_pub public key of the coin - * @param coin_sig deposit signature of the coin - * @param amount_with_fee amount the exchange will deposit for this coin - * @param deposit_fee fee the exchange will charge for this coin - * @param refund_fee fee the exchange will charge for refunds of coin - * @param check_time at what time should we check the deposit status - * with the exchange (for settlement) - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_deposit)( - void *cls, - uint32_t offset, - uint64_t deposit_confirmation_serial_id, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *deposit_fee, - const struct TALER_Amount *refund_fee, - struct GNUNET_TIME_Absolute check_time); - - - /** - * Obtain refunds associated with a contract. - * - * @param cls closure, typically a connection to the db - * @param instance_id instance to lookup refunds for - * @param h_contract_terms hash code of the contract - * @param rc function to call for each coin on which there is a refund - * @param rc_cls closure for @a rc - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_refunds)(void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - TALER_MERCHANTDB_RefundCallback rc, - void *rc_cls); - - - /** - * Retrieve details about tokens that were used for an order. - * - * @param cls closure - * @param order_serial identifies the order - * @param cb function to call for each used token - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_spent_tokens_by_order)(void *cls, - uint64_t order_serial, - TALER_MERCHANTDB_UsedTokensCallback cb, - void *cb_cls); - - - /** - * Mark contract as paid and store the current @a session_id - * for which the contract was paid. Deletes the underlying order - * and marks the locked stocks of the order as sold. - * - * @param cls closure - * @param instance_id instance to mark contract as paid for - * @param h_contract_terms hash of the contract that is now paid - * @param session_id the session that paid the contract - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*mark_contract_paid)( - void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - const char *session_id, - int16_t choice_index); - - - /** - * Update session associated with a contract and return - * the fulfillment URL and the refund status. - * - * @param cls closure - * @param instance_id instance to mark contract as paid for - * @param h_contract_terms hash of the contract that is now paid - * @param session_id the session that paid the contract - * @param[out] fulfillment_url set to the fulfillment URL (possibly NULL) - * @param[out] refunded set to true if the order was refunded - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*update_contract_session)( - void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - const char *session_id, - char **fulfillment_url, - bool *refunded); - - - /** - * Function called during aborts to refund a coin. Marks the - * respective coin as refunded. - * - * @param cls closure - * @param instance_id instance to refund payment for - * @param h_contract_terms hash of the contract to refund coin for - * @param refund_timestamp timestamp of when the coin was refunded - * @param coin_pub public key of the coin to refund (fully) - * @param reason text justifying the refund - * @return transaction status - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if @a coin_pub is unknown to us; - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the request is valid, - * regardless of whether it actually increased the refund - */ - enum GNUNET_DB_QueryStatus - (*refund_coin)(void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - struct GNUNET_TIME_Timestamp refund_timestamp, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const char *reason); - - - /** - * Retrieve contract terms given its @a order_id - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_id order to lookup contract for - * @param[out] h_contract_terms set to the hash of the contract. - * @param[out] paid set to the payment status of the contract - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_order_status)(void *cls, - const char *instance_id, - const char *order_id, - struct TALER_PrivateContractHashP *h_contract_terms, - bool *paid); - - /** - * Retrieve contract terms given its @a order_serial - * - * @param cls closure - * @param instance_id instance's identifier - * @param order_serial serial ID of the order to look up - * @param[out] order_id set to ID of the order - * @param[out] h_contract_terms set to the hash of the contract. - * @param[out] paid set to the payment status of the contract - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_order_status_by_serial)(void *cls, - const char *instance_id, - uint64_t order_serial, - char **order_id, - struct TALER_PrivateContractHashP * - h_contract_terms, - bool *paid); - - - /** - * Retrieve details about coins that were deposited for an order. - * - * @param cls closure - * @param order_serial identifies the order - * @param cb function to call for each deposited coin - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_deposits_by_order)(void *cls, - uint64_t order_serial, - TALER_MERCHANTDB_DepositedCoinsCallback cb, - void *cb_cls); - - - /** - * Retrieve wire transfer details for all deposits associated with - * a given @a order_serial. - * - * @param cls closure - * @param order_serial identifies the order - * @param cb function called with the wire transfer details - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_transfer_details_by_order)( - void *cls, - uint64_t order_serial, - TALER_MERCHANTDB_OrderTransferDetailsCallback cb, - void *cb_cls); - - - /** - * Update transfer status. - * - * @param cls closure - * @param exchange_url the exchange that made the transfer - * @param wtid wire transfer subject - * @param next_attempt when should we try again (if ever) - * @param http_status last HTTP status code from the server, 0 for timeout - * @param ec current error state of checking the transfer - * @param detail last error detail from the server, possibly NULL - * @param needs_retry true if we should retry the request - * @return database transaction status - */ - enum GNUNET_DB_QueryStatus - (*update_transfer_status)( - void *cls, - const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct GNUNET_TIME_Absolute next_attempt, - unsigned int http_status, - enum TALER_ErrorCode ec, - const char *detail, - bool needs_retry); - - - /** - * Finalize transfer status with success. - * - * @param cls closure - * @param exchange_url the exchange that made the transfer - * @param wtid wire transfer subject - * @param h_details hash over all of the aggregated deposits - * @param total_amount total amount exchange claimed to have transferred - * @param wire_fee wire fee charged by the exchange - * @param exchange_pub key used to make @e exchange_sig - * @param exchange_sig signature of the exchange over reconciliation data - * @return database transaction status - */ - enum GNUNET_DB_QueryStatus - (*finalize_transfer_status)( - void *cls, - const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct GNUNET_HashCode *h_details, - const struct TALER_Amount *total_amount, - const struct TALER_Amount *wire_fee, - const struct TALER_ExchangePublicKeyP *exchange_pub, - const struct TALER_ExchangeSignatureP *exchange_sig); - - - /** - * Retrieve wire transfer details of wire details - * that taler-merchant-exchange still needs to - * investigate. - * - * @param cls closure - * @param limit maximum number of results to return - * @param cb function called with the wire transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*select_open_transfers)( - void *cls, - uint64_t limit, - TALER_MERCHANTDB_OpenTransferCallback cb, - void *cb_cls); - - - /** - * Insert wire transfer details for a deposit. - * - * @param cls closure - * @param deposit_serial serial number of the deposit - * @param h_wire hash of the merchant's account that should receive the deposit - * @param exchange_url URL of the exchange that is making the deposit - * @param dd deposit transfer data from the exchange to store - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_deposit_to_transfer)(void *cls, - uint64_t deposit_serial, - const struct TALER_MerchantWireHashP *h_wire, - const char *exchange_url, - const struct TALER_EXCHANGE_DepositData *dd); - - - /** - * Set 'wired' status for an order to 'true'. - * - * @param cls closure - * @param order_serial serial number of the order - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*mark_order_wired)(void *cls, - uint64_t order_serial); - - - /** - * Function called when some backoffice staff decides to award or - * increase the refund on an existing contract. This function - * MUST be called from within a transaction scope setup by the - * caller as it executes multiple SQL statements. - * - * @param cls closure - * @param instance_id instance identifier - * @param order_id the order to increase the refund for - * @param refund maximum refund to return to the customer for this contract - * @param olc function to call to obtain legal refund - * limits per exchange, NULL for no limits - * @param olc_cls closure for @a olc - * @param reason 0-terminated UTF-8 string giving the reason why the customer - * got a refund (free form, business-specific) - * @return transaction status - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if @a refund is ABOVE the amount we - * were originally paid and thus the transaction failed; - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if the request is valid, - * regardless of whether it actually increased the refund beyond - * 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, - TALER_MERCHANTDB_OperationLimitCallback olc, - void *olc_cls, - const char *reason); - - - /** - * Obtain detailed refund data associated with a contract. - * - * @param cls closure, typically a connection to the db - * @param instance_id instance to lookup refunds for - * @param h_contract_terms hash code of the contract - * @param rc function to call for each coin on which there is a refund - * @param rc_cls closure for @a rc - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_refunds_detailed)( - void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - TALER_MERCHANTDB_RefundDetailCallback rc, - void *rc_cls); - - /** - * Insert refund proof data from the exchange into the database. - * - * @param cls closure - * @param refund_serial serial number of the refund - * @param exchange_sig signature from exchange that coin was refunded - * @param exchange_pub signing key that was used for @a exchange_sig - * @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 used token into the database. - * - * @param cls closure - * @param h_contract_terms hash of the contract the token was used for - * @param h_issue_pub hash of the token issue public key - * @param use_pub token use public key - * @param use_sig token use signature - * @param issue_sig token issue signature - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_spent_token)( - void *cls, - const struct TALER_PrivateContractHashP * - h_contract_terms, - const struct TALER_TokenIssuePublicKeyHashP *h_issue_pub, - const struct TALER_TokenUsePublicKeyP *use_pub, - const struct TALER_TokenUseSignatureP *use_sig, - const struct TALER_TokenIssueSignature *issue_sig); - - - /** - * Insert issued token into the database. - * - * @param cls closure - * @param h_contract_terms hash of the contract the token was issued for - * @param h_issue_pub hash of the token issue public key used to sign the issued token - * @param blind_sig resulting blind token issue signature - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_issued_token)( - void *cls, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_TokenIssuePublicKeyHashP *h_issue_pub, - const struct TALER_BlindedTokenIssueSignature *blind_sig); - - - /** - * Lookup refund proof data. - * - * @param cls closure - * @param refund_serial serial number of the refund - * @param[out] exchange_sig set to signature from exchange - * @param[out] exchange_pub signing key that was used for @a exchange_sig - * @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); - - - /** - * Retrieve the order ID that was used to pay for a resource within a session. - * - * @param cls closure - * @param instance_id instance to lookup the order from - * @param fulfillment_url URL that canonically identifies the resource - * being paid for - * @param session_id session id - * @param allow_refunded_for_repurchase true to include refunded orders in repurchase detection - * @param[out] order_id location to store the order ID that was used when - * paying for the resource URL - * @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, - bool allow_refunded_for_repurchase, - char **order_id); - - /** - * Update information about progress made by taler-merchant-wirewatch. - * - * @param cls closure - * @param instance which instance does the account belong to - * @param payto_uri which account is this about - * @param last_serial last serial imported from the bank - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*update_wirewatch_progress)( - void *cls, - const char *instance, - struct TALER_FullPayto payto_uri, - uint64_t last_serial); - - - /** - * Select information about accounts which taler-merchant-wirewatch should work on. - * - * @param cls closure - * @param cb function to call with results - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*select_wirewatch_accounts)( - void *cls, - TALER_MERCHANTDB_WirewatchWorkCallback cb, - void *cb_cls); - - - /** - * Insert information about a wire transfer the merchant has received. - * Idempotent, will do nothing if the same wire transfer is already known. - * Updates the @a bank_serial_id if an equivalent transfer exists where - * the @a bank_serial_id was set to 0 (unknown). - * - * @param cls closure - * @param instance_id instance to lookup the order from - * @param exchange_url which exchange made the transfer - * @param wtid identifier of the wire transfer - * @param credit_amount how much did we receive - * @param payto_uri what is the merchant's bank account that received the transfer - * @param bank_serial_id bank serial transfer ID, 0 for none (use NULL in DB!) - * @param[out] no_instance instance unknown to backend - * @param[out] no_account bank account with @a payto_uri unknown to backend - * @param[out] conflict transfer with same @a wtid but different @a credit_amount exists - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_transfer)( - void *cls, - const char *instance_id, - const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_Amount *credit_amount, - struct TALER_FullPayto payto_uri, - uint64_t bank_serial_id, - bool *no_instance, - bool *no_account, - bool *conflict); - - - /** - * Delete information about a transfer. Note that transfers - * confirmed by the exchange cannot be deleted anymore. - * - * @param cls closure - * @param instance_id instance to delete transfer of - * @param transfer_serial_id transfer to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * 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); - - - /** - * Check if information about a transfer exists with the - * backend. Returns no data, only the query status. - * - * @param cls closure - * @param instance_id instance to delete transfer of - * @param transfer_serial_id transfer to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT - * if the transfer record exists - */ - enum GNUNET_DB_QueryStatus - (*check_transfer_exists)(void *cls, - const char *instance_id, - uint64_t transfer_serial_id); - - - /** - * Lookup account serial by payto URI. - * - * @param cls closure - * @param instance_id instance to lookup the account from - * @param payto_uri what is the merchant's bank account to lookup - * @param[out] account_serial serial number of the account - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_account)(void *cls, - const char *instance_id, - struct TALER_FullPayto payto_uri, - uint64_t *account_serial); - - - /** - * Insert information about a wire transfer the merchant has received. - * - * @param cls closure - * @param instance_id instance to provide transfer details for - * @param exchange_url which exchange made the transfer - * @param payto_uri what is the merchant's bank account that received the transfer - * @param wtid identifier of the wire transfer - * @param td transfer details to store - * @return transaction status, - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the @a wtid and @a exchange_uri are not known for this @a instance_id - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT on success - */ - enum GNUNET_DB_QueryStatus - (*insert_transfer_details)( - void *cls, - const char *instance_id, - const char *exchange_url, - struct TALER_FullPayto payto_uri, - const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_EXCHANGE_TransferData *td); - - - /** - * Obtain information about wire fees charged by an exchange, - * including signature (so we have proof). - * - * @param cls closure - * @param master_pub master public key of the exchange - * @param h_wire_method hash of wire method - * @param contract_date date of the contract to use for the lookup - * @param[out] fees set to wire fees charged - * @param[out] start_date start of fee being used - * @param[out] end_date end of fee being used - * @param[out] master_sig signature of exchange over fee structure - * @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_Timestamp contract_date, - struct TALER_WireFeeSet *fees, - struct GNUNET_TIME_Timestamp *start_date, - struct GNUNET_TIME_Timestamp *end_date, - struct TALER_MasterSignatureP *master_sig); - - - /** - * Obtain information about an expected incoming wire transfer. - * - * @param cls closure - * @param instance_id instance to lookup payments for - * @param expected_incoming_serial serial number of the transfer - * @param[out] expected_time expected date of the transfer - * @param[out] wtid expected wire transfer subject - * @param[out] payto_uri target bank account - * @param[out] exchange_url URL of the exchange - * @param[out] execution_time, set to 0 if unknown - * @param[out] confirmed set if the transfer was confirmed - * @param[out] master_pub master public key of the exchange - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*lookup_expected_transfer)( - void *cls, - const char *instance_id, - uint64_t expected_incoming_serial, - struct GNUNET_TIME_Timestamp *expected_time, - struct TALER_Amount *expected_credit_amount, - struct TALER_WireTransferIdentifierRawP *wtid, - struct TALER_FullPayto *payto_uri, - char **exchange_url, - struct GNUNET_TIME_Timestamp *execution_time, - bool *confirmed, - struct TALER_MasterPublicKeyP *master_pub); - - - /** - * Obtain reconciliation details for an expected incoming wire transfer. - * - * @param cls closure - * @param instance_id instance to lookup payments for - * @param expected_incoming_serial serial number of the transfer - * @param cb callback to invoke - * @param cb_cls closure for @a cb - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*lookup_reconciliation_details)( - void *cls, - const char *instance_id, - uint64_t expected_incoming_serial, - TALER_MERCHANTDB_ReconciliationDetailsCallback cb, - void *cb_cls); - - - /** - * Lookup information about coin payments by @a h_contract_terms and - * @a coin_pub. - * - * @param cls closure - * @param instance_id instance to lookup payments for - * @param h_contract_terms proposal data's hashcode - * @param coin_pub public key to use for the search - * @param cb function to call with payment data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_deposits_by_contract_and_coin)( - void *cls, - const char *instance_id, - const struct TALER_PrivateContractHashP *h_contract_terms, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - TALER_MERCHANTDB_CoinDepositCallback cb, - void *cb_cls); - - - /** - * Lookup transfer summary (used if we already verified the details). - * - * @param cls closure - * @param exchange_url the exchange that made the transfer - * @param wtid wire transfer subject - * @param cb function to call with detailed transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_transfer_summary)( - void *cls, - const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, - TALER_MERCHANTDB_TransferSummaryCallback cb, - void *cb_cls); - - - /** - * Lookup transfer details. Used if we still need to verify the details. - * - * @param cls closure - * @param exchange_url the exchange that made the transfer - * @param wtid wire transfer subject - * @param cb function to call with detailed transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_transfer_details)( - void *cls, - const char *exchange_url, - const struct TALER_WireTransferIdentifierRawP *wtid, - TALER_MERCHANTDB_TransferDetailsCallback cb, - void *cb_cls); - - - /** - * Lookup transfers. - * - * @param cls closure - * @param instance_id instance to lookup payments for - * @param payto_uri account that we are interested in transfers to - * @param before timestamp for the earliest transfer we care about - * @param after timestamp for the last transfer we care about - * @param limit number of entries to return, negative for descending in execution time, - * positive for ascending in execution time - * @param offset transfer_serial number of the transfer we want to offset from - * @param expected filter for transfers that were expected - * @param cb function to call with detailed transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_transfers)( - void *cls, - const char *instance_id, - struct TALER_FullPayto payto_uri, - struct GNUNET_TIME_Timestamp before, - struct GNUNET_TIME_Timestamp after, - int64_t limit, - uint64_t offset, - enum TALER_EXCHANGE_YesNoAll expected, - TALER_MERCHANTDB_TransferCallback cb, - void *cb_cls); - - - /** - * Lookup expected incoming transfers. - * - * @param cls closure - * @param instance_id instance to lookup payments for - * @param payto_uri account that we are interested in transfers to - * @param before timestamp for the earliest transfer we care about - * @param after timestamp for the last transfer we care about - * @param limit number of entries to return, negative for descending in execution time, - * positive for ascending in execution time - * @param offset expected_transfer_serial number of the transfer we want to offset from - * @param confirmed filter by confirmation status - * @param verified filter by verification status - * @param cb function to call with detailed transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_expected_transfers)( - void *cls, - const char *instance_id, - struct TALER_FullPayto payto_uri, - struct GNUNET_TIME_Timestamp before, - struct GNUNET_TIME_Timestamp after, - int64_t limit, - uint64_t offset, - enum TALER_EXCHANGE_YesNoAll confirmed, - enum TALER_EXCHANGE_YesNoAll verified, - TALER_MERCHANTDB_IncomingCallback cb, - void *cb_cls); - - - /** - * Store information about wire fees charged by an exchange, - * including signature (so we have proof). - * - * @param cls closure - * @param master_pub master public key of the exchange - * @param h_wire_method hash of wire method - * @param fees wire fees charged - * @param start_date start of fee being used - * @param end_date end of fee being used - * @param master_sig signature of exchange over fee structure - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*store_wire_fee_by_exchange)( - void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - const struct GNUNET_HashCode *h_wire_method, - const struct TALER_WireFeeSet *fees, - struct GNUNET_TIME_Timestamp start_date, - struct GNUNET_TIME_Timestamp end_date, - const struct TALER_MasterSignatureP *master_sig); - - - /** - * Delete information about wire accounts of an exchange. (Used when we got new account data.) - * - * @param cls closure - * @param master_pub public key of the exchange - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*delete_exchange_accounts)( - void *cls, - const struct TALER_MasterPublicKeyP *master_pub); - - - /** - * Return information about wire accounts of an exchange. - * - * @param cls closure - * @param master_pub public key of the exchange - * @param cb function to call on each account - * @param cb_cls closure for @a cb - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*select_accounts_by_exchange)( - void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - TALER_MERCHANTDB_ExchangeAccountCallback cb, - void *cb_cls); - - - /** - * Insert information about a wire account of an exchange. - * - * @param cls closure - * @param master_pub public key of the exchange - * @param payto_uri URI of the bank account - * @param conversion_url conversion service, NULL if there is no conversion required - * @param debit_restrictions JSON array of debit restrictions on the account - * @param credit_restrictions JSON array of debit restrictions on the account - * @param master_sig signature affirming the account of the exchange - * @return transaction status code - */ - enum GNUNET_DB_QueryStatus - (*insert_exchange_account)( - void *cls, - const struct TALER_MasterPublicKeyP *master_pub, - const struct TALER_FullPayto payto_uri, - const char *conversion_url, - const json_t *debit_restrictions, - const json_t *credit_restrictions, - const struct TALER_MasterSignatureP *master_sig); - - - /** - * Lookup all of the templates the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param cb function to call on all template found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_templates)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_TemplatesCallback cb, - void *cb_cls); - - - /** - * Lookup details about a particular template. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param template_id template to lookup - * @param[out] td set to the template details on success, can be NULL - * (in that case we only want to check if the template exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_template)(void *cls, - const char *instance_id, - const char *template_id, - struct TALER_MERCHANTDB_TemplateDetails *td); - - /** - * Delete information about a template. - * - * @param cls closure - * @param instance_id instance to delete template of - * @param template_id template to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if template unknown. - */ - enum GNUNET_DB_QueryStatus - (*delete_template)(void *cls, - const char *instance_id, - const char *template_id); - - - /** - * Insert details about a particular template. - * - * @param cls closure - * @param instance_id instance to insert template for - * @param template_id template identifier of template to insert - * @param otp_serial_id 0 if no OTP device is associated - * @param td the template details to insert - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_template)(void *cls, - const char *instance_id, - const char *template_id, - uint64_t otp_serial_id, - const struct TALER_MERCHANTDB_TemplateDetails *td); - - - /** - * Update details about a particular template. - * - * @param cls closure - * @param instance_id instance to update template for - * @param template_id template to update - * @param td update to the template details on success, can be NULL - * (in that case we only want to check if the template exists) - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the template - * does not yet exist. - */ - enum GNUNET_DB_QueryStatus - (*update_template)(void *cls, - const char *instance_id, - const char *template_id, - const struct TALER_MERCHANTDB_TemplateDetails *td); - - - /** - * Delete information about an OTP device. - * - * @param cls closure - * @param instance_id instance to delete OTP device of - * @param otp_id otp device to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if template unknown. - */ - enum GNUNET_DB_QueryStatus - (*delete_otp)(void *cls, - const char *instance_id, - const char *otp_id); - - /** - * Insert details about a particular OTP device. - * - * @param cls closure - * @param instance_id instance to insert OTP device for - * @param otp_id otp identifier of OTP device to insert - * @param td the OTP device details to insert - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_otp)(void *cls, - const char *instance_id, - const char *otp_id, - const struct TALER_MERCHANTDB_OtpDeviceDetails *td); - - - /** - * Update details about a particular OTP device. - * - * @param cls closure - * @param instance_id instance to update OTP device for - * @param otp_id OTP device to update - * @param td update to the OTP device details on success, can be NULL - * (in that case we only want to check if the template exists) - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the template - * does not yet exist. - */ - enum GNUNET_DB_QueryStatus - (*update_otp)(void *cls, - const char *instance_id, - const char *otp_id, - const struct TALER_MERCHANTDB_OtpDeviceDetails *td); - - /** - * Lookup all of the OTP devices the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup OTP devices for - * @param cb function to call on all OTP devices found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_otp_devices)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_OtpDeviceCallback cb, - void *cb_cls); - - - /** - * Lookup details about an OTP device. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param otp_id OTP device to lookup - * @param[out] td set to the OTP device details on success, can be NULL - * (in that case we only want to check if the template exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_otp)(void *cls, - const char *instance_id, - const char *otp_id, - struct TALER_MERCHANTDB_OtpDeviceDetails *td); - - - /** - * Lookup serial number of an OTP device. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param otp_id OTP device to lookup - * @param[out] serial set to the OTP device serial number * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_otp_serial)(void *cls, - const char *instance_id, - const char *otp_id, - uint64_t *serial); - - /** - * Delete information about a measurement unit. - * - * @param cls closure - * @param instance_id instance to delete unit from - * @param unit_id symbolic identifier of the unit - * @param[out] no_instance set to true if @a instance_id is unknown - * @param[out] no_unit set to true if the unit does not exist - * @param[out] builtin_conflict set to true if the unit is builtin and may not be deleted - * @return DB status code - */ - enum GNUNET_DB_QueryStatus - (*delete_unit)(void *cls, - const char *instance_id, - const char *unit_id, - bool *no_instance, - bool *no_unit, - bool *builtin_conflict); - - /** - * Insert a measurement unit definition. - * - * @param cls closure - * @param instance_id instance to insert unit for - * @param ud unit details to store (unit_serial ignored) - * @param[out] no_instance set to true if @a instance_id is unknown - * @param[out] conflict set to true if a conflicting unit already exists - * @param[out] unit_serial set to the inserted serial on success - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_unit)(void *cls, - const char *instance_id, - const struct TALER_MERCHANTDB_UnitDetails *ud, - bool *no_instance, - bool *conflict, - uint64_t *unit_serial); - - /** - * Update a measurement unit definition. - * - * @param cls closure - * @param instance_id instance owning the unit - * @param unit_id symbolic identifier of the unit - * @param unit_name_long optional new long label (NULL to keep current) - * @param unit_name_long_i18n optional new long-label translations (NULL to keep current) - * @param unit_name_short optional new short label (NULL to keep current) - * @param unit_name_short_i18n optional new short-label translations (NULL to keep current) - * @param unit_allow_fraction optional new fractional toggle (NULL to keep current) - * @param unit_precision_level optional new fractional precision (NULL to keep current) - * @param unit_active optional new visibility flag (NULL to keep current) - * @param[out] no_instance set if instance unknown - * @param[out] no_unit set if unit unknown - * @param[out] builtin_conflict set if immutable builtin fields touched - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_unit)(void *cls, - const char *instance_id, - const char *unit_id, - const char *unit_name_long, - const json_t *unit_name_long_i18n, - const char *unit_name_short, - const json_t *unit_name_short_i18n, - const bool *unit_allow_fraction, - const uint32_t *unit_precision_level, - const bool *unit_active, - bool *no_instance, - bool *no_unit, - bool *builtin_conflict); - - /** - * Lookup all measurement units of an instance. - * - * @param cls closure - * @param instance_id instance to fetch units for - * @param cb function to call per unit - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_units)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_UnitsCallback cb, - void *cb_cls); - - /** - * Lookup custom measurement units by name. - * - * @param cls closure - * @param instance_id instance to fetch units for - * @param units array of unit identifiers - * @param num_units length of @a units - * @param cb function to call per unit - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_custom_units_by_names)(void *cls, - const char *instance_id, - const char *const *units, - size_t num_units, - TALER_MERCHANTDB_UnitsCallback cb, - void *cb_cls); - /** - * Lookup a single measurement unit. - * - * @param cls closure - * @param instance_id instance to fetch unit for - * @param unit_id symbolic identifier - * @param[out] ud unit details on success; may be NULL to test existence - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_unit)(void *cls, - const char *instance_id, - const char *unit_id, - struct TALER_MERCHANTDB_UnitDetails *ud); - - - /** - * Delete information about a product category. - * - * @param cls closure - * @param instance_id instance to delete category of - * @param category_id identifies the category to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if template unknown. - */ - enum GNUNET_DB_QueryStatus - (*delete_category)(void *cls, - const char *instance_id, - uint64_t category_id); - - /** - * Insert new product category. - * - * @param cls closure - * @param instance_id instance to insert OTP device for - * @param category_name name of the category - * @param category_name_i18n translations of the category name - * @param[out] category_id set to the category id on success - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_category)(void *cls, - const char *instance_id, - const char *category_name, - const json_t *category_name_i18n, - uint64_t *category_id); - - - /** - * Update descriptions of a product category. - * - * @param cls closure - * @param instance_id instance to update OTP device for - * @param category_id category to update - * @param category_name name of the category - * @param category_name_i18n translations of the category name - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the template - * does not yet exist. - */ - enum GNUNET_DB_QueryStatus - (*update_category)(void *cls, - const char *instance_id, - uint64_t category_id, - const char *category_name, - const json_t *category_name_i18n); - - /** - * Lookup all of the product categories the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup OTP devices for - * @param cb function to call on all categories found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_categories)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_CategoriesCallback cb, - void *cb_cls); - - /** - * Lookup product categories by ID. - * - * @param cls closure - * @param instance_id instance to lookup categories for - * @param category_ids array of category IDs - * @param num_category_ids length of @a category_ids - * @param cb function to call on all categories found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_categories_by_ids)(void *cls, - const char *instance_id, - const uint64_t *category_ids, - size_t num_category_ids, - TALER_MERCHANTDB_CategoriesCallback cb, - void *cb_cls); - - - /** - * Lookup details about product category. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param category_id category to update - * @param[out] cd set to the category details on success, can be NULL - * (in that case we only want to check if the category exists) - * @param[out] num_products set to length of @a products array - * @param[out] products set to buffer with @a num_products 0-terminated strings with the product IDs, caller must free() it. - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_category)(void *cls, - const char *instance_id, - uint64_t category_id, - struct TALER_MERCHANTDB_CategoryDetails *cd, - size_t *num_products, - char **products); - - - /** - * Lookup details about product category by name. - * - * @param cls closure - * @param instance_id instance to lookup template for - * @param category_name category name to look for - * @param[out] name_i18n category name translation - * @param[out] category_id category ID - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_category_by_name)(void *cls, - const char *instance_id, - const char *category_name, - json_t **name_i18n, - uint64_t *category_id); - - - /** - * Lookup all of the webhooks the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup webhook for - * @param cb function to call on all webhook found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_webhooks)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_WebhooksCallback cb, - void *cb_cls); - - - /** - * Lookup details about a particular webhook. - * - * @param cls closure - * @param instance_id instance to lookup webhook for - * @param webhook_id webhook to lookup - * @param[out] wb set to the webhook details on success, can be NULL - * (in that case we only want to check if the webhook exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_webhook)(void *cls, - const char *instance_id, - const char *webhook_id, - struct TALER_MERCHANTDB_WebhookDetails *wb); - - /** - * Delete information about a webhook. - * - * @param cls closure - * @param instance_id instance to delete webhook of - * @param webhook_id webhook to delete - * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * if webhook unknown. - */ - enum GNUNET_DB_QueryStatus - (*delete_webhook)(void *cls, - const char *instance_id, - const char *webhook_id); - - - /** - * Insert details about a particular webhook. - * - * @param cls closure - * @param instance_id instance to insert webhook for - * @param webhook_id webhook identifier of webhook to insert - * @param wb the webhook details to insert - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_webhook)(void *cls, - const char *instance_id, - const char *webhook_id, - const struct TALER_MERCHANTDB_WebhookDetails *wb); - - - /** - * Update details about a particular webhook. - * - * @param cls closure - * @param instance_id instance to update webhook for - * @param webhook_id webhook to update - * @param wb update to the webhook details on success, can be NULL - * (in that case we only want to check if the webhook exists) - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the webhook - * does not yet exist. - */ - enum GNUNET_DB_QueryStatus - (*update_webhook)(void *cls, - const char *instance_id, - const char *webhook_id, - const struct TALER_MERCHANTDB_WebhookDetails *wb); - - /** - * Lookup webhook by event - * - * @param cls closure - * @param instance_id instance to lookup webhook for - * @param event_type event that we need to put in the pending webhook - * @param[out] cb set to the webhook details on success - * @param cb_cls callback closure - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_webhook_by_event)(void *cls, - const char *instance_id, - const char *event_type, - TALER_MERCHANTDB_WebhookDetailCallback cb, - void *cb_cls); - - /** - * Insert webhook in the pending webhook. - * - * @param cls closure - * @param instance_id instance to insert webhook for - * @param webhook_serial webhook to insert in the pending webhook - * @param url to make the request to - * @param http_method for the webhook - * @param header of the webhook - * @param body of the webhook - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_pending_webhook)(void *cls, - const char *instance_id, - uint64_t webhook_serial, - const char *url, - const char *http_method, - const char *header, - const char *body); - /** - * Lookup the webhook that need to be send in priority. These webhooks are not successfully - * send. - * - * @param cls closure - * @param cb pending webhook callback - * @param cb_cls callback closure - */ - // WHERE next_attempt <= now ORDER BY next_attempt ASC - enum GNUNET_DB_QueryStatus - (*lookup_pending_webhooks)(void *cls, - TALER_MERCHANTDB_PendingWebhooksCallback cb, - void *cb_cls); - - /** - * Lookup future webhook in the pending webhook that need to be send. - * With that we can know how long the system can 'sleep'. - * - * @param cls closure - * @param cb pending webhook callback - * @param cb_cls callback closure - */ - // ORDER BY next_attempt ASC LIMIT 1 - enum GNUNET_DB_QueryStatus - (*lookup_future_webhook)(void *cls, - TALER_MERCHANTDB_PendingWebhooksCallback cb, - void *cb_cls); - - /** - * Lookup all the webhooks in the pending webhook. - * Use by the administrator - * - * @param cls closure - * @param instance_id to lookup webhooks for this instance particularly - * @param min_row to see the list of the pending webhook that it is started with this minimum row. - * @param max_results to see the list of the pending webhook that it is end with this max results. - * @param cb pending webhook callback - * @param cb_cls callback closure - */ - // WHERE webhook_pending_serial > min_row ORDER BY webhook_pending_serial ASC LIMIT max_results - enum GNUNET_DB_QueryStatus - (*lookup_all_webhooks)(void *cls, - const char *instance_id, - uint64_t min_row, - uint32_t max_results, - TALER_MERCHANTDB_PendingWebhooksCallback cb, - void *cb_cls); - - - /** - * Update the pending webhook. It is use if the webhook can't be send. - * - * @param cls closure - * @param webhook_serial webhook that need to be update - * @param next_attempt when we should make the next request to the webhook - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_pending_webhook)(void *cls, - uint64_t webhook_pending_serial, - struct GNUNET_TIME_Absolute next_attempt); - // maybe add: http status of failure? - - - /** - * Delete a webhook in the pending webhook after the - * webhook was completed successfully. - * - * @param cls closure - * @param webhook_serial webhook that need to be delete in the pending webhook - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_pending_webhook)(void *cls, - uint64_t webhook_pending_serial); - - - /** - * Retrieve exchange's keys from the database. - * - * @param cls plugin closure - * @param exchange_url base URL of the exchange - * @param[out] first_retry set to earliest we may retry fetching the keys - * @param[out] keys set to the keys of the exchange - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*select_exchange_keys)(void *cls, - const char *exchange_url, - struct GNUNET_TIME_Absolute *first_retry, - struct TALER_EXCHANGE_Keys **keys); - - - /** - * Insert or update @a keys into the database. - * - * @param cls plugin closure - * @param exchange_url base URL of the exchange - * @param keys data to store - * @param first_retry earliest we may retry fetching the keys - * @param http_status latest HTTP status of the exchange - * @param ec latest error code from fetching /keys - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*insert_exchange_keys)(void *cls, - const char *exchange_url, - const struct TALER_EXCHANGE_Keys *keys, - struct GNUNET_TIME_Absolute first_retry, - uint32_t http_status, - enum TALER_ErrorCode ec); - - - /** - * Lookup all of the token families the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup token families for - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_token_families)(void *cls, - const char *instance_id, - TALER_MERCHANTDB_TokenFamiliesCallback cb, - void *cb_cls); - - /** - * Lookup details about a particular token family. - * - * @param cls closure - * @param instance_id instance to lookup token family for - * @param token_family_slug token family to lookup - * @param[out] details set to the token family details on success, can be NULL - * (in that case we only want to check if the token family exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_token_family)(void *cls, - const char *instance_id, - const char *token_family_slug, - struct TALER_MERCHANTDB_TokenFamilyDetails *details); - - /** - * Delete information about a token family. - * - * @param cls closure - * @param instance_id instance to delete token family of - * @param token_family_slug slug of token family to delete - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_token_family)(void *cls, - const char *instance_id, - const char *token_family_slug); - - /** - * Update details about a particular token family. - * - * @param cls closure - * @param instance_id instance to update token family for - * @param token_family_slug slug of token family to update - * @param details set to the updated token family on success, can be NULL - * (in that case we only want to check if the token family exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_token_family)( - void *cls, - const char *instance_id, - const char *token_family_slug, - const struct TALER_MERCHANTDB_TokenFamilyDetails *details); - - - /** - * Insert details about a particular token family. - * - * @param cls closure - * @param instance_id instance to insert token family for - * @param token_family_slug slug of token family to insert - * @param details the token family details to insert - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_token_family)( - void *cls, - const char *instance_id, - const char *token_family_slug, - const struct TALER_MERCHANTDB_TokenFamilyDetails *details); - - - /** - * Lookup details about a particular token family key. - * - * @param cls closure - * @param instance_id instance to lookup token family key for - * @param token_family_slug slug of token family to lookup - * @param valid_at find a key with a validity period that includes this time - * @param sign_until find a private key that can sign until this time - * @param[out] details set to the token family key details on success, can be NULL - * (in that case we only want to check if the token family key exists) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_token_family_key)( - void *cls, - const char *instance_id, - const char *token_family_slug, - struct GNUNET_TIME_Timestamp valid_at, - struct GNUNET_TIME_Timestamp sign_until, - struct TALER_MERCHANTDB_TokenFamilyKeyDetails *details); - - - /** - * Lookup token family keys that may be used for a payment. - * - * @param cls closure - * @param instance_id instance to lookup token family key for - * @param token_family_slug slug of token family to lookup - * @param start_time signature validity start the keys must fall into - * @param end_time signature validity end the keys must fall into - * @param cb function to call with each matching key - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_token_family_keys)( - void *cls, - const char *instance_id, - const char *token_family_slug, - struct GNUNET_TIME_Timestamp start_time, - struct GNUNET_TIME_Timestamp end_time, - TALER_MERCHANTDB_TokenKeyCallback cb, - void *cb_cls); - - - /** - * Insert details a key pair for a token family. - * - * @param cls closure - * @param merchant_id instance name - * @param token_family_slug slug of token family to insert the key pair for - * @param pub token family public key - * @param priv token family private key - * @param key_expires when does the private key expire (because - * the validity period of the next token family key starts) - * @param valid_after start of validity period for signatures with this key - * @param valid_before end of validity period for signatures with this key - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_token_family_key)( - void *cls, - const char *merchant_id, - const char *token_family_slug, - const struct TALER_TokenIssuePublicKey *pub, - const struct TALER_TokenIssuePrivateKey *priv, - struct GNUNET_TIME_Timestamp key_expires, - struct GNUNET_TIME_Timestamp valid_after, - struct GNUNET_TIME_Timestamp valid_before); - - /** - * Lookup deposits that are finished and awaiting a wire transfer. - * - * @param cls closure - * @param exchange_url exchange to filter deposits by - * @param limit maximum number of deposits to return - * @param allow_future true to allow deposits with wire deadline in the future - * @param cb function to call with deposit data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*lookup_pending_deposits)( - void *cls, - const char *exchange_url, - uint64_t limit, - bool allow_future, - TALER_MERCHANTDB_PendingDepositsCallback cb, - void *cb_cls); - - - /** - * Update the deposit confirmation status associated with - * the given @a deposit_serial. - * - * @param cls closure - * @param deposit_serial deposit to update status for - * @param retry_needed true if the HTTP request should be retried - * @param retry_time when should we ask the exchange again - * @param last_http_status HTTP status code of the last reply - * @param last_ec Taler error code of the last reply - * @param last_detail detail from error message to record, possibly NULL - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_deposit_confirmation_status)( - void *cls, - uint64_t deposit_serial, - bool retry_needed, - struct GNUNET_TIME_Timestamp retry_time, - uint32_t last_http_status, - enum TALER_ErrorCode last_ec, - const char *last_detail); - - - /** - * Update the amount of receipts for a Donau instance. - * - * @param cls closure - * @param donau_instances_serial serial number of the Donau instance - * @param new_amount new receipts_to_date amount - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_donau_instance_receipts_amount)( - void *cls, - uint64_t *donau_instances_serial, - const struct TALER_Amount *new_amount - ); - - - /** - * Check if a new matching multi-factor authorization (MFA) challenge - * exists in the database. - * - * @param cls closure - * @param challenge_id set to the ID of the challenge - * @param h_body hash of the request body - * @param[out] salt salt used to compute @a h_body - * @param[out] required address set to where the challenge is to be send - * @param[out] op operation that triggered the MFA request - * @param[out] confirmation_date when was the challenge solved, - * set to "GNUNET_TIME_ABSOLUTE_NEVER" if unsolved - * @param[out] retransmission_date set to when a fresh challenge - * may be transmitted - * @param[out] retry_counter set to the number of attempts that remain - * for solving the challenge (after this time) - * @param[out] tan_channel which channel was used - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_mfa_challenge)( - void *cls, - uint64_t challenge_id, - const struct TALER_MERCHANT_MFA_BodyHash *h_body, - struct TALER_MERCHANT_MFA_BodySalt *salt, - char **required_address, - enum TALER_MERCHANT_MFA_CriticalOperation *op, - struct GNUNET_TIME_Absolute *confirmation_date, - struct GNUNET_TIME_Absolute *retransmission_date, - uint32_t *retry_counter, - enum TALER_MERCHANT_MFA_Channel *tan_channel); - - - /** - * Attempt to solve new multi-factor authorization (MFA) challenge. - * Checks the solution against the code in the database and updates - * the solution state and (on failure) retry counter depending on - * the result. - * - * @param cls closure - * @param challenge_id challenge ID to be solved - * @param h_body body of the operation the challenge authorizes - * @param solution proposed solution to be checked against the actual code - * @param[out] solved set to true if the challenge was solved by - * @a solution - * @param[out] retry_counter set to the number of attempts that remain - * for solving the challenge (after this time) - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*solve_mfa_challenge)( - void *cls, - uint64_t challenge_id, - const struct TALER_MERCHANT_MFA_BodyHash *h_body, - const char *solution, - bool *solved, - uint32_t *retry_counter); - - - /** - * Update the state of an MFA challenge as we have now - * retransmitted the challenge code. - * - * @param cls closure - * @param challenge_id challenge ID to be solved - * @param code new challenge code - * @param retry_counter number of attempts that remain - * for solving the challenge - * @param expiration_date when should the challenge expire - * @param retransmission_date set to when a fresh challenge - * may be transmitted next - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_mfa_challenge)( - void *cls, - uint64_t challenge_id, - const char *code, - uint32_t retry_counter, - struct GNUNET_TIME_Absolute expiration_date, - struct GNUNET_TIME_Absolute retransmission_date); - - - /** - * Create new multi-factor authorization (MFA) challenge in the database. - * - * @param cls closure - * @param op operation that triggered the MFA request - * @param h_body hash of the request body - * @param salt salt used to compute @a h_body - * @param code challenge code sent to the user - * @param expiration_date when should the challenge expire - * @param retansmission_date when do we next allow retransmission - * of the challenge - * @param tan_channel which channel was used - * @param required_address address - * where the challenge is to be sent - * @param[out] challenge_id set to the ID of the new challenge - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*create_mfa_challenge)( - void *cls, - enum TALER_MERCHANT_MFA_CriticalOperation op, - const struct TALER_MERCHANT_MFA_BodyHash *h_body, - const struct TALER_MERCHANT_MFA_BodySalt *salt, - const char *code, - struct GNUNET_TIME_Absolute expiration_date, - struct GNUNET_TIME_Absolute retransmission_date, - enum TALER_MERCHANT_MFA_Channel tan_channel, - const char *required_address, - uint64_t *challenge_id); - - -#ifdef HAVE_DONAU_DONAU_SERVICE_H - /** - * Insert information about a Donau instance. - * - * @param cls closure - * @param donau_url URL of the Donau instance - * @param charity details of the charity - * @param charity_id charity ID of the Donau instance - */ - enum GNUNET_DB_QueryStatus - (*insert_donau_instance)( - void *cls, - const char *donau_url, - const struct DONAU_Charity *charity, - uint64_t charity_id - ); - - - /** - * Check if information about a Donau instance exists. - * - * @param cls closure - * @param merchant_pub public key of the instance - * @param donau_url URL of the Donau instance - * @param charity_id charity ID of the Donau instance - */ - enum GNUNET_DB_QueryStatus - (*check_donau_instance)( - void *cls, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const char *donau_url, - uint64_t charity_id - ); - - /** - * Select donau instance by serial number. - * - * @param cls closure - * @param serial serial number of the Donau instance in DB - * @param[out] donau_url set to the URL of the Donau instance - * @param[out] charity_id set to the charity ID of the Donau instance - */ - enum GNUNET_DB_QueryStatus - (*select_donau_instance_by_serial)( - void *cls, - uint64_t serial, - char **donau_url, - uint64_t *charity_id); - - /** - * Select all Donau instances. Note that this callback only - * returns Donau instances for which we have successfully - * retrieved /keys. - * - * @param cls closure - * @param id instance to restrict to - * @param cb function to call on all Donau instances found - * @param cb_cls closure for @a cb - */ - enum GNUNET_DB_QueryStatus - (*select_donau_instances)( - void *cls, - const char *id, - TALER_MERCHANTDB_DonauInstanceCallback cb, - void *cb_cls); - - - /** - * Select all Donau instances, regardless of instance and also - * regardless of whether we got a /keys response. - * - * @param cls closure - * @param cb function to call on all Donau instances found - * @param cb_cls closure for @a cb - */ - enum GNUNET_DB_QueryStatus - (*select_all_donau_instances)( - void *cls, - TALER_MERCHANTDB_DonauInstanceCallback cb, - void *cb_cls); - - - /** - * Select all Donau instances, but only the donau_url - * and charity_max_per_year. - * - * @param cls closure - * @param cb function to call on all Donau instances found - * @param cb_cls closure for @a cb - */ - enum GNUNET_DB_QueryStatus - (*select_donau_instances_filtered)( - void *cls, - const char *currency, - TALER_MERCHANTDB_DonauInstanceFilteredCallback cb, - void *cb_cls); - - /** - * Lookup Donau keys by URL. - * - * @param cls closure - * @param donau_url URL of the Donau instance - * @param[out] keys set to the Donau keys on success - */ - enum GNUNET_DB_QueryStatus - (*lookup_donau_keys)( - void *cls, - const char *donau_url, - struct GNUNET_TIME_Absolute *first_retry, - struct DONAU_Keys **keys); - - /** - * Lookup a Donau instance by its instance ID and URL. - * - * @param cls closure - * @param instance_id instance ID of the Donau instance - * @param donau_url URL of the Donau instance - * @param charity_id set to the charity ID of the Donau instance - * @param charity_priv set to the private key of the charity - * @param charity_max_per_year set to the maximum amount - * the charity can receive per year - * @param charity_receipts_to_date set to the total amount - * the charity has received to date - * @param donau_keys_json set to the JSON representation of the - * Donau keys - */ - enum GNUNET_DB_QueryStatus - (*lookup_order_charity)( - void *cls, - const char *instance_id, - const char *donau_url, - uint64_t *charity_id, - struct DONAU_CharityPrivateKeyP *charity_priv, - struct TALER_Amount *charity_max_per_year, - struct TALER_Amount *charity_receipts_to_date, - json_t **donau_keys_json, - uint64_t *donau_instance_serial); - - /** - * Upsert Donau keys into the database. - * - * @param cls closure - * @param keys Donau keys to insert or update - */ - enum GNUNET_DB_QueryStatus - (*upsert_donau_keys)( - void *cls, - const struct DONAU_Keys *keys, - struct GNUNET_TIME_Absolute first_retry); - - /** - * Update information about a Donau instance. - * - * @param cls closure - * @param donau_url URL of the Donau instance - * @param charity details of the charity - * @param charity_id charity ID of the Donau instance - */ - enum GNUNET_DB_QueryStatus - (*update_donau_instance)( - void *cls, - const char *donau_url, - const struct DONAU_Charity *charity, - uint64_t charity_id); - -#endif - - /** - * Delete information about a Donau instance. - * - * @param cls closure - * @param charity_id charity ID of the Donau instance to delete - */ - enum GNUNET_DB_QueryStatus - (*delete_donau_instance)( - void *cls, - const char *id, - uint64_t charity_id); - - /** - * Lookup amount statistics for instance and slug by bucket. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param slug instance to lookup statistics for - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_amount_by_bucket)( - void *cls, - const char *instance_id, - const char *slug, - TALER_MERCHANTDB_AmountByBucketStatisticsCallback cb, - void *cb_cls); - - /** - * Lookup amount statistics for instance and slug by bucket, - * restricting to a fixed number of buckets at a given granularity. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param slug instance to lookup statistics for - * @param granularity limit to buckets of this size - * @param counter requested number of buckets - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_amount_by_bucket2)( - void *cls, - const char *instance_id, - const char *slug, - const char *granularity, - uint64_t counter, - TALER_MERCHANTDB_AmountByBucketStatisticsCallback2 cb, - void *cb_cls); - - - /** - * Lookup counter statistics for instance and slug by bucket. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param slug instance to lookup statistics for - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_counter_by_bucket)( - void *cls, - const char *instance_id, - const char *slug, - TALER_MERCHANTDB_CounterByBucketStatisticsCallback cb, - void *cb_cls); - - /** - * Lookup counter statistics for instance and slug-prefix by bucket. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param prefix slug prefix to lookup statistics under - * @param granularity limit to buckets of this size - * @param counter requested number of buckets - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_counter_by_bucket2)( - void *cls, - const char *instance_id, - const char *prefix, - const char *granularity, - uint64_t counter, - TALER_MERCHANTDB_CounterByBucketStatisticsCallback2 cb, - void *cb_cls); - - - /** - * Lookup amount statistics for instance and slug by interval. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param slug instance to lookup statistics for - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_amount_by_interval)( - void *cls, - const char *instance_id, - const char *slug, - TALER_MERCHANTDB_AmountByIntervalStatisticsCallback cb, - void *cb_cls); - - /** - * Lookup counter statistics for instance and slug by interval. - * - * @param cls closure - * @param instance_id instance to lookup statistics for - * @param slug instance to lookup statistics for - * @param cb function to call on all token families found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_statistics_counter_by_interval)( - void *cls, - const char *instance_id, - const char *slug, - TALER_MERCHANTDB_CounterByIntervalStatisticsCallback cb, - void *cb_cls); - - - /** - * Lookup all of the money pots the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup money pots for - * @param limit number of entries to return, negative for descending in execution time, - * positive for ascending in execution time - * @param offset number of the money pot we want to offset from - * @param cb function to call on all money pots found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_money_pots)(void *cls, - const char *instance_id, - int64_t limit, - uint64_t offset, - TALER_MERCHANTDB_MoneyPotsCallback cb, - void *cb_cls); - - - /** - * Check that all of the money pots given exist at the instance, - * returning one that does *not* exist (for generating an error) - * if the check fails. - * - * @param cls closure - * @param instance_id instance to lookup token families for - * @param pots_len length of the @a pots array - * @param pots money pot identifiers to check if they exist - * @param[out] pot_missing set to ID of pot not known at the instance - * @return transaction status, - * #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS means that all pots exist - * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT indicates that - * @a pot_missing was initialized to a missing pot - */ - enum GNUNET_DB_QueryStatus - (*check_money_pots)(void *cls, - const char *instance_id, - unsigned int pots_len, - uint64_t pots[static pots_len], - uint64_t *pot_missing); - - /** - * Lookup details about a particular money pot. - * - * @param cls closure - * @param instance_id instance to lookup money pot for - * @param money_pot_id serial number of the pot to lookup - * @param [out] name set to name of the pot, - * must be freed by caller - * @param[out] description set to description of the pot, - * must be freed by caller - * @param[out] pot_total_len set to length of @a pot_totals array - * @param[out] pot_totals set to amounts currently in the pot; - * array must be freed by caller - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_money_pot)(void *cls, - const char *instance_id, - uint64_t money_pot_id, - char **name, - char **description, - size_t *pot_total_len, - struct TALER_Amount **pot_totals); - - /** - * Delete information about a money pot. - * - * @param cls closure - * @param instance_id instance to delete money pot of - * @param money_pot_id serial number of the pot to delete - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_money_pot)(void *cls, - const char *instance_id, - uint64_t money_pot_id); - - /** - * Update details about a particular money pot. - * - * @param cls closure - * @param instance_id instance to update money pot for - * @param money_pot_id serial number of the pot to delete - * @param name set to name of the pot - * @param description set to description of the pot - * @param opt_len length of @a old_pot_totals - * @param old_pot_totals amounts expected currently in the pot, - * NULL to not check (non-NULL but @a opt_len=0 checks for []) - * @param npt_len length of @a new_pot_totals - * @param new_pot_totals new amounts in the pot, - * NULL to not update (non-NULL but @a npt_len=0 resets to []) - * @param[out] conflict_total set to true if @a old_pot_total does not match - * @param[out] conflict_name set to true if @a name is used by another pot - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_money_pot)( - void *cls, - const char *instance_id, - uint64_t money_pot_id, - const char *name, - const char *description, - size_t opt_len, - const struct TALER_Amount *old_pot_totals, - size_t npt_len, - const struct TALER_Amount *new_pot_totals, - bool *conflict_total, - bool *conflict_name); - - - /** - * Increment amounts in money pots. If a money pot does not exist, - * it is simply skipped (without causing an error!). - * - * @param cls closure - * @param instance_id instance to update money pot for - * @param money_pots_len length of the @a money_pots_ids - * and @a pot_increments arrays - * @param money_pot_ids serial numbers of the pots to increment - * @param pot_increments new amounts to add to the respective pot - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*increment_money_pots)( - void *cls, - const char *instance_id, - size_t money_pots_len, - const uint64_t *money_pot_ids, - const struct TALER_Amount *pot_increments); - - - /** - * Insert details about a particular pot. - * - * @param cls closure - * @param instance_id instance to insert pot for - * @param name set to name of the pot - * @param description set to description of the pot - * @param[out] money_pot_id serial number of the new pot - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * on conflict (@a name already in use at @a instance_id). - */ - enum GNUNET_DB_QueryStatus - (*insert_money_pot)( - void *cls, - const char *instance_id, - const char *name, - const char *description, - uint64_t *money_pot_id); - - // Reports - - /** - * Lookup all of the reports the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup reports for - * @param limit number of entries to return, negative for descending in execution time, - * positive for ascending in execution time - * @param offset expected_transfer_serial number of the transfer we want to offset from - * @param cb function to call on all reports found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_reports)(void *cls, - const char *instance_id, - int64_t limit, - uint64_t offset, - TALER_MERCHANTDB_ReportsCallback cb, - void *cb_cls); - - - /** - * Lookup all of the reports pending for the given backend. - * - * @param cls closure - * @param cb function to call on all reports found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*lookup_reports_pending)(void *cls, - TALER_MERCHANTDB_ReportsPendingCallback cb, - void *cb_cls); - - /** - * Lookup details about a particular report. - * - * @param cls closure - * @param instance_id instance to lookup reports for - * @param report_id serial number of the report to lookup - * @param[out] report_program_section configuration section of program - * for report generation - * @param[out] report_description text describing the report - * @param[out] mime_type mime type to request from the @a data_source - * @param[out] data_source relative URL (to instance base URL) - * to request report data from - * @param[out] target_address where to send report data - * @param[out] frequency report frequency - * @param[out] frequency_shift how much to shift the report time from a - * multiple of the report @a frequency - * @param[out] next_transmission when will the report be generated next - * @param[out] last_error_code status of the last report - * @param[out] last_error_detail details about failures of last generation - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_report)(void *cls, - const char *instance_id, - uint64_t report_id, - char **report_program_section, - char **report_description, - char **mime_type, - char **data_source, - char **target_address, - struct GNUNET_TIME_Relative *frequency, - struct GNUNET_TIME_Relative *frequency_shift, - struct GNUNET_TIME_Absolute *next_transmission, - enum TALER_ErrorCode *last_error_code, - char **last_error_detail); - - /** - * Check that a particular report is scheduled under the - * given @a report_id and @a report_token. Does not - * validate that the report is actually due. - * - * @param cls closure - * @param report_id serial number of the report to lookup - * @param report_token report token to check - * @param mime_type mime type to request from the @a data_source - * @param[out] instance_id instance to lookup reports for - * @param[out] data_source relative URL (to instance base URL) - * to request report data from - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*check_report)(void *cls, - uint64_t report_id, - const struct TALER_MERCHANT_ReportToken *report_token, - const char *mime_type, - char **instance_id, - char **data_source); - - - /** - * Delete information about a report. - * - * @param cls closure - * @param instance_id instance to delete report of - * @param report_id serial number of the pot to delete - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_report)(void *cls, - const char *instance_id, - uint64_t report_id); - - /** - * Update transmission status about a particular report. - * - * @param cls closure - * @param instance_id instance to update report for - * @param report_id serial number of the pot to update - * @param next_tranmission when should the report be generated next - * @param last_error_code #TALER_EC_NONE on success - * @param last_error_detail NULL on success - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_report_status)( - void *cls, - const char *instance_id, - uint64_t report_id, - struct GNUNET_TIME_Timestamp next_transmission, - enum TALER_ErrorCode last_error_code, - const char *last_error_detail); - - - /** - * Update details about a particular report. - * - * @param cls closure - * @param instance_id instance to update report for - * @param report_id serial number of the report to update - * @param report_program_section configuration section of program - * for report generation - * @param report_description text describing the report - * @param mime_type mime type to request from the @a data_source - * @param data_source relative URL (to instance base URL) - * to request report data from - * @param target_address where to send report data - * @param frequency report frequency - * @param frequency_shift how much to shift the report time from a - * multiple of the report @a frequency - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_report)( - void *cls, - const char *instance_id, - uint64_t report_id, - const char *report_program_section, - const char *report_description, - const char *mime_type, - const char *data_source, - const char *target_address, - struct GNUNET_TIME_Relative frequency, - struct GNUNET_TIME_Relative frequency_shift); - - - /** - * Insert details about a particular report. - * - * @param cls closure - * @param instance_id instance to insert report for - * @param report_program_section configuration section of program - * for report generation - * @param report_description text describing the report - * @param mime_type mime type to request from the @a data_source - * @param data_source relative URL (to instance base URL) - * to request report data from - * @param target_address where to send report data - * @param frequency report frequency - * @param frequency_shift how much to shift the report time from a - * multiple of the report @a frequency - * @param[out] report_id serial number of the new pot - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*insert_report)( - void *cls, - const char *instance_id, - const char *report_program_section, - const char *report_description, - const char *mime_type, - const char *data_source, - const char *target_address, - struct GNUNET_TIME_Relative frequency, - struct GNUNET_TIME_Relative frequency_shift, - uint64_t *report_id); - - - // groups - - /** - * Lookup all of the product groups the given instance has configured. - * - * @param cls closure - * @param instance_id instance to lookup product groups for - * @param limit number of entries to return, negative for descending in execution time, - * positive for ascending in execution time - * @param offset expected_transfer_serial number of the transfer we want to offset from - * @param cb function to call on all groups found - * @param cb_cls closure for @a cb - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*select_product_groups)(void *cls, - const char *instance_id, - int64_t limit, - uint64_t offset, - TALER_MERCHANTDB_ProductGroupsCallback cb, - void *cb_cls); - - /** - * Delete information about a product group. - * - * @param cls closure - * @param instance_id instance to delete product group of - * @param product_group_id serial number of the group to delete - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*delete_product_group)(void *cls, - const char *instance_id, - uint64_t product_group_id); - - /** - * Update details about a particular product group. - * - * @param cls closure - * @param instance_id instance to update product group for - * @param product_group_id serial number of the group to update - * @param name set to name of the group - * @param description set to description of the group - * @param[out] conflict set to true if @a name is already used - * @return database result code - */ - enum GNUNET_DB_QueryStatus - (*update_product_group)( - void *cls, - const char *instance_id, - uint64_t product_group_id, - const char *name, - const char *description, - bool *conflict); - - - /** - * Insert details about a particular product group. - * - * @param cls closure - * @param instance_id instance to insert group for - * @param name set to name of the group - * @param description set to description of the group - * @param[out] product_group_id serial number of the new group - * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS - * on conflict (@a name already in use at @a instance_id). - */ - enum GNUNET_DB_QueryStatus - (*insert_product_group)( - void *cls, - const char *instance_id, - const char *name, - const char *description, - uint64_t *product_group_id); - -}; - -#endif diff --git a/src/lib/merchant_api_common.c b/src/lib/merchant_api_common.c @@ -20,14 +20,14 @@ * @author Christian Grothoff * @author Priscilla Huang */ -#include "platform.h" +#include "taler/platform.h" #include "microhttpd.h" #include <curl/curl.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include <gnunet/gnunet_uri_lib.h> #include <taler/taler_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" static void diff --git a/src/lib/merchant_api_common.h b/src/lib/merchant_api_common.h @@ -22,7 +22,7 @@ */ #ifndef MERCHANT_API_COMMON_H #define MERCHANT_API_COMMON_H -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" /** diff --git a/src/lib/merchant_api_curl_defaults.c b/src/lib/merchant_api_curl_defaults.c @@ -19,7 +19,7 @@ * @brief curl easy handle defaults * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_curl_lib.h> #include "merchant_api_curl_defaults.h" diff --git a/src/lib/merchant_api_curl_defaults.h b/src/lib/merchant_api_curl_defaults.h @@ -25,7 +25,7 @@ #define _TALER_CURL_DEFAULTS_H -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_curl_lib.h> diff --git a/src/lib/merchant_api_delete_account.c b/src/lib/merchant_api_delete_account.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /private/account/$H_WIRE request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_donau_instance.c b/src/lib/merchant_api_delete_donau_instance.c @@ -21,18 +21,18 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> /* DONAU RELATED IMPORTS */ -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_donau.h" #include <donau/donau_service.h> diff --git a/src/lib/merchant_api_delete_instance.c b/src/lib/merchant_api_delete_instance.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /instance/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_instance_token.c b/src/lib/merchant_api_delete_instance_token.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /instance/$ID/private/token request of the merchant's HTTP API * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_order.c b/src/lib/merchant_api_delete_order.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /orders/$ORDER_ID request of the merchant's HTTP API * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_otp_device.c b/src/lib/merchant_api_delete_otp_device.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /otp-devices/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_product.c b/src/lib/merchant_api_delete_product.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /product/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_template.c b/src/lib/merchant_api_delete_template.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /templates/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_transfer.c b/src/lib/merchant_api_delete_transfer.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /transfer/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_delete_unit.c b/src/lib/merchant_api_delete_unit.c @@ -18,13 +18,13 @@ * @brief Implementation of DELETE /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_delete_webhook.c b/src/lib/merchant_api_delete_webhook.c @@ -19,13 +19,13 @@ * @brief Implementation of the DELETE /webhooks/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_account.c b/src/lib/merchant_api_get_account.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /accounts/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_accounts.c b/src/lib/merchant_api_get_accounts.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /accounts request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_config.c b/src/lib/merchant_api_get_config.c @@ -19,13 +19,13 @@ * @brief Implementation of the /config request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_donau_instance.c b/src/lib/merchant_api_get_donau_instance.c @@ -20,18 +20,18 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> /* DONAU RELATED IMPORTS */ -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_donau.h" #include <donau/donau_service.h> /** diff --git a/src/lib/merchant_api_get_instance.c b/src/lib/merchant_api_get_instance.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /instance/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_kyclogic_lib.h> diff --git a/src/lib/merchant_api_get_instances.c b/src/lib/merchant_api_get_instances.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /instances request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_kyc.c b/src/lib/merchant_api_get_kyc.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /kyc request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_orders.c b/src/lib/merchant_api_get_orders.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /private/orders request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_otp_device.c b/src/lib/merchant_api_get_otp_device.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /otp-devices/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_otp_devices.c b/src/lib/merchant_api_get_otp_devices.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /otp-devices request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_product.c b/src/lib/merchant_api_get_product.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /product/$ID request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_product_image.c b/src/lib/merchant_api_get_product_image.c @@ -19,7 +19,7 @@ * @brief Implementation of the GET /products/$HASH/image request * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> @@ -27,7 +27,7 @@ #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_error_codes.h> #include <taler/taler_json_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" diff --git a/src/lib/merchant_api_get_products.c b/src/lib/merchant_api_get_products.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /products request of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_statistics.c b/src/lib/merchant_api_get_statistics.c @@ -19,7 +19,7 @@ * @brief Implementation of the GET /statistics-[counter,amount]/$SLUG request of the merchant's HTTP API * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> @@ -27,7 +27,7 @@ #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_template.c b/src/lib/merchant_api_get_template.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /templates/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_templates.c b/src/lib/merchant_api_get_templates.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /templates request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_tokenfamily.c b/src/lib/merchant_api_get_tokenfamily.c @@ -19,7 +19,7 @@ * @brief Implementation of the GET /tokenfamily/$ID request of the merchant's HTTP API * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> @@ -27,7 +27,7 @@ #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_transfers.c b/src/lib/merchant_api_get_transfers.c @@ -20,13 +20,13 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_get_unit.c b/src/lib/merchant_api_get_unit.c @@ -18,13 +18,13 @@ * @brief Implementation of GET /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_get_units.c b/src/lib/merchant_api_get_units.c @@ -20,13 +20,13 @@ * @brief Implementation of GET /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_get_webhook.c b/src/lib/merchant_api_get_webhook.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /webhooks/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_get_webhooks.c b/src/lib/merchant_api_get_webhooks.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /webhooks request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_lock_product.c b/src/lib/merchant_api_lock_product.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_merchant_get_order.c b/src/lib/merchant_api_merchant_get_order.c @@ -21,13 +21,13 @@ * @author Marcello Stanisci * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_patch_account.c b/src/lib/merchant_api_patch_account.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> @@ -83,8 +83,8 @@ struct TALER_MERCHANT_AccountPatchHandle */ static void handle_patch_account_finished (void *cls, - long response_code, - const void *response) + long response_code, + const void *response) { struct TALER_MERCHANT_AccountPatchHandle *tph = cls; const json_t *json = response; diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_order_forget.c b/src/lib/merchant_api_patch_order_forget.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_otp_device.c b/src/lib/merchant_api_patch_otp_device.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_product.c b/src/lib/merchant_api_patch_product.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_template.c b/src/lib/merchant_api_patch_template.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_unit.c b/src/lib/merchant_api_patch_unit.c @@ -18,12 +18,12 @@ * @brief Implementation of PATCH /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_patch_webhook.c b/src/lib/merchant_api_patch_webhook.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_account.c b/src/lib/merchant_api_post_account.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_categories.c b/src/lib/merchant_api_post_categories.c @@ -20,12 +20,12 @@ * @brief Implementation of POST /private/categories * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_donau_instance.c b/src/lib/merchant_api_post_donau_instance.c @@ -23,12 +23,12 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> @@ -36,7 +36,7 @@ #include <taler/taler_curl_lib.h> #include <taler/taler_kyclogic_lib.h> /* DONAU RELATED IMPORTS */ -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_donau.h" #include <donau/donau_service.h> diff --git a/src/lib/merchant_api_post_instance_auth.c b/src/lib/merchant_api_post_instance_auth.c @@ -19,13 +19,13 @@ * @brief Implementation of the POST /instance/$ID/private/auth request * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_post_instance_token.c b/src/lib/merchant_api_post_instance_token.c @@ -19,13 +19,13 @@ * @brief Implementation of the POST /instance/$ID/private/token request * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c @@ -23,13 +23,13 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_order_claim.c b/src/lib/merchant_api_post_order_claim.c @@ -22,13 +22,13 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_post_order_paid.c b/src/lib/merchant_api_post_order_paid.c @@ -22,13 +22,13 @@ * of the merchant's HTTP API * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_order_pay.c b/src/lib/merchant_api_post_order_pay.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> @@ -31,7 +31,7 @@ #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <stdio.h> diff --git a/src/lib/merchant_api_post_order_refund.c b/src/lib/merchant_api_post_order_refund.c @@ -20,13 +20,13 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_orders.c b/src/lib/merchant_api_post_orders.c @@ -22,13 +22,13 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> @@ -211,7 +211,8 @@ TALER_MERCHANT_orders_post3 ( char unit_quantity_buf[64]; TALER_MERCHANT_format_quantity_string (inventory_products[i].quantity, - inventory_products[i].quantity_frac, + inventory_products[i].quantity_frac + , unit_quantity_buf, sizeof (unit_quantity_buf)); diff --git a/src/lib/merchant_api_post_otp_devices.c b/src/lib/merchant_api_post_otp_devices.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_products.c b/src/lib/merchant_api_post_products.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_templates.c b/src/lib/merchant_api_post_templates.c @@ -22,17 +22,17 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> #include <taler/taler_curl_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /* FIXME: Bohdan is to stupid to figure out how util can be used here */ static enum TALER_MERCHANT_TemplateType diff --git a/src/lib/merchant_api_post_tokenfamilies.c b/src/lib/merchant_api_post_tokenfamilies.c @@ -22,14 +22,14 @@ * of the merchant's HTTP API * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <gnunet/gnunet_json_lib.h> #include <gnunet/gnunet_time_lib.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_transfers.c b/src/lib/merchant_api_post_transfers.c @@ -20,12 +20,12 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_curl_lib.h> diff --git a/src/lib/merchant_api_post_units.c b/src/lib/merchant_api_post_units.c @@ -18,12 +18,12 @@ * @brief Implementation of POST /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_using_templates.c b/src/lib/merchant_api_post_using_templates.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_post_webhooks.c b/src/lib/merchant_api_post_webhooks.c @@ -22,12 +22,12 @@ * of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_wallet_get_order.c b/src/lib/merchant_api_wallet_get_order.c @@ -21,13 +21,13 @@ * @author Marcello Stanisci * @author Florian Dold */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include "merchant_api_common.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/merchant_api_wallet_get_template.c b/src/lib/merchant_api_wallet_get_template.c @@ -19,13 +19,13 @@ * @brief Implementation of the GET /templates/$ID request of the merchant's HTTP API * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> diff --git a/src/lib/merchant_api_wallet_post_order_refund.c b/src/lib/merchant_api_wallet_post_order_refund.c @@ -19,13 +19,13 @@ * @brief Implementation of the (public) POST /orders/ID/refund request * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <jansson.h> #include <microhttpd.h> /* just for HTTP status codes */ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <taler/taler_json_lib.h> diff --git a/src/lib/taler_merchant_pay_service.c b/src/lib/taler_merchant_pay_service.c @@ -20,7 +20,7 @@ * merchant_api_post_order_pay.c * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <curl/curl.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> @@ -28,8 +28,8 @@ #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_curl_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_pay_service.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_pay_service.h" #include "merchant_api_common.h" #include "merchant_api_curl_defaults.h" #include <stdio.h> diff --git a/src/lib/test_merchant_api_common.c b/src/lib/test_merchant_api_common.c @@ -19,8 +19,8 @@ * @brief Unit test for test_merchant_api_common.c * @author Florian Dold */ -#include "platform.h" -#include "taler_merchant_service.h" +#include "taler/platform.h" +#include "taler/taler_merchant_service.h" int diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c @@ -22,11 +22,11 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_util.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/merchant-tools/taler-merchant-dbinit.c b/src/merchant-tools/taler-merchant-dbinit.c @@ -19,11 +19,11 @@ * @author Florian Dold * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" /** diff --git a/src/merchant-tools/taler-merchant-passwd.c b/src/merchant-tools/taler-merchant-passwd.c @@ -18,13 +18,13 @@ * @brief Reset access tokens for instances. * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <taler/taler_dbevents.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_util.h" -#include "taler_merchantdb_lib.h" -#include "taler_merchantdb_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchantdb_lib.h" +#include "taler/taler_merchantdb_lib.h" /** * Instance to set password for. diff --git a/src/merchant-tools/taler-merchant-setup-reserve.c b/src/merchant-tools/taler-merchant-setup-reserve.c @@ -18,11 +18,11 @@ * @brief Create reserve for tipping * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <microhttpd.h> #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_service.h" +#include "taler/taler_merchant_service.h" /** * How often do we try before giving up? diff --git a/src/testing/test_key_rotation.conf b/src/testing/test_key_rotation.conf @@ -5,11 +5,10 @@ TALER_CONFIG_HOME = $TALER_HOME/.config/taler/ TALER_CACHE_HOME = $TALER_HOME/.cache/taler/ TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/ -[taler] +[exchange] CURRENCY = TESTKUDOS CURRENCY_ROUND_UNIT = TESTKUDOS:0.01 - -[exchange] +TINY_AMOUNT = TESTKUDOS:0.01 MAX_KEYS_CACHING = forever DB = postgres SERVE = tcp diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <taler/taler_signatures.h> #include <taler/taler_exchange_service.h> @@ -34,7 +34,7 @@ #include <taler/taler_fakebank_lib.h> #include <taler/taler_testing_lib.h> #include <taler/taler_error_codes.h> -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/test_kyc_api.conf b/src/testing/test_kyc_api.conf @@ -40,6 +40,7 @@ AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv DB = postgres PUBLIC_KEY = A29P1DRGXVTJZV1HFG251QPAW3ZTC681ZJWXB1T0RWGPE2HQSGZG TALER_AUDITOR_SALT = test +TINY_AMOUNT = EUR:0.01 [auditordb-postgres] CONFIG = postgres:///talercheck @@ -47,6 +48,7 @@ CONFIG = postgres:///talercheck [exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 +TINY_AMOUNT = EUR:0.01 PORT = 8081 MASTER_PUBLIC_KEY = KHA6YSPRQV1ZFCF144SY8KJNR588XA8DA0F6510FKJW30DJFJNAG BASE_URL = "http://localhost:8081/" diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_time_lib.h> #include <taler/taler_util.h> #include <taler/taler_signatures.h> @@ -36,8 +36,8 @@ #include <taler/taler_fakebank_lib.h> #include <taler/taler_testing_lib.h> #include <taler/taler_error_codes.h> -#include "taler_merchant_util.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_util.h" +#include "taler/taler_merchant_testing_lib.h" #ifdef HAVE_DONAU_DONAU_SERVICE_H #include <donau/donau_testing_lib.h> @@ -49,7 +49,7 @@ * commands should NOT wait for this timeout! */ #define POLL_ORDER_TIMEOUT \ - GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) /** * The 'poll-orders-conclude-1x' and other 'conclude' @@ -57,7 +57,7 @@ * here we use a short value! */ #define POLL_ORDER_SHORT_TIMEOUT \ - GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) /** * Configuration file we use. One (big) configuration is used @@ -288,8 +288,8 @@ cmd_exec_wirewatch (const char *label) * @param label label to use for the command. */ #define CMD_EXEC_AGGREGATOR(label) \ - TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \ - TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file) + TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \ + TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file) /** diff --git a/src/testing/test_merchant_api.conf b/src/testing/test_merchant_api.conf @@ -59,6 +59,7 @@ CURRENCY = EUR [exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 +TINY_AMOUNT = EUR:0.01 PORT = 8081 MASTER_PUBLIC_KEY = KHA6YSPRQV1ZFCF144SY8KJNR588XA8DA0F6510FKJW30DJFJNAG BASE_URL = "http://localhost:8081/" @@ -74,6 +75,7 @@ AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}/auditor/offline-keys/auditor.priv DB = postgres PUBLIC_KEY = A29P1DRGXVTJZV1HFG251QPAW3ZTC681ZJWXB1T0RWGPE2HQSGZG TALER_AUDITOR_SALT = test +TINY_AMOUNT = EUR:0.01 [auditordb-postgres] CONFIG = postgres:///talercheck diff --git a/src/testing/test_merchant_api_twisted.c b/src/testing/test_merchant_api_twisted.c @@ -25,7 +25,7 @@ * @author Florian Dold <dold@taler.net> */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_util.h> #include <taler/taler_signatures.h> #include <taler/taler_exchange_service.h> @@ -36,7 +36,7 @@ #include <taler/taler_bank_service.h> #include <taler/taler_fakebank_lib.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" #include <taler/taler_twister_testing_lib.h> #include <taler/taler_twister_service.h> diff --git a/src/testing/test_reconciliation.c b/src/testing/test_reconciliation.c @@ -23,7 +23,7 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_time_lib.h> #include <taler/taler_util.h> #include <taler/taler_signatures.h> @@ -36,7 +36,7 @@ #include <taler/taler_fakebank_lib.h> #include <taler/taler_testing_lib.h> #include <taler/taler_error_codes.h> -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/test_template.conf b/src/testing/test_template.conf @@ -10,6 +10,7 @@ DISABLED = YES [exchange] CURRENCY = TESTKUDOS CURRENCY_ROUND_UNIT = TESTKUDOS:0.01 +TINY_AMOUNT = TESTKUDOS:0.01 AML_THRESHOLD = TESTKUDOS:1000000 MAX_KEYS_CACHING = forever DB = postgres diff --git a/src/testing/testing_api_cmd_abort_order.c b/src/testing/testing_api_cmd_abort_order.c @@ -21,12 +21,12 @@ * @brief command to test the abort feature. * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include <taler/taler_signatures.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** * State for a " abort" CMD. @@ -141,7 +141,8 @@ build_coins (struct TALER_MERCHANT_AbortCoin **ac, } GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_exchange_url (coin_cmd, - &icoin->exchange_url)); + &icoin->exchange_url) + ); { const struct TALER_Amount *denom_value; diff --git a/src/testing/testing_api_cmd_checkserver.c b/src/testing/testing_api_cmd_checkserver.c @@ -22,13 +22,13 @@ * @brief Implement a CMD to run an Checkserver service for faking the legitimation service * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler/taler_json_lib.h" #include <gnunet/gnunet_curl_lib.h> #include "taler/taler_testing_lib.h" #include "taler/taler_mhd_lib.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" #include <taler/taler_exchange_service.h> diff --git a/src/testing/testing_api_cmd_claim_order.c b/src/testing/testing_api_cmd_claim_order.c @@ -22,11 +22,11 @@ * @brief command to claim an order * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** * State for a "order claim" CMD. Not used by diff --git a/src/testing/testing_api_cmd_config.c b/src/testing/testing_api_cmd_config.c @@ -23,11 +23,11 @@ * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_account.c b/src/testing/testing_api_cmd_delete_account.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /account/$H_WIRE * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -149,9 +149,9 @@ delete_account_run (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Command %s did not return H_WIRE\n", das->create_account_ref); - GNUNET_break (0); - TALER_TESTING_FAIL (is); - return; + GNUNET_break (0); + TALER_TESTING_FAIL (is); + return; } GNUNET_assert (NULL != h_wire); das->adh = TALER_MERCHANT_account_delete ( diff --git a/src/testing/testing_api_cmd_delete_donau_instances.c b/src/testing/testing_api_cmd_delete_donau_instances.c @@ -20,11 +20,11 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_donau.h" /** * State for DELETE /donau/$charity_id testing command. diff --git a/src/testing/testing_api_cmd_delete_instance.c b/src/testing/testing_api_cmd_delete_instance.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /instance/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_order.c b/src/testing/testing_api_cmd_delete_order.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /orders/$ORDER_ID * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_otp_device.c b/src/testing/testing_api_cmd_delete_otp_device.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /otp-devices/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -70,7 +70,7 @@ struct DeleteOtpDeviceState */ static void delete_otp_device_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr) + const struct TALER_MERCHANT_HttpResponse *hr) { struct DeleteOtpDeviceState *dis = cls; diff --git a/src/testing/testing_api_cmd_delete_product.c b/src/testing/testing_api_cmd_delete_product.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /product/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_template.c b/src/testing/testing_api_cmd_delete_template.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /templates/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_transfer.c b/src/testing/testing_api_cmd_delete_transfer.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /transfers/$TRANSFER_ID * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_unit.c b/src/testing/testing_api_cmd_delete_unit.c @@ -21,10 +21,10 @@ * @brief command to test DELETE /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_delete_webhook.c b/src/testing/testing_api_cmd_delete_webhook.c @@ -21,11 +21,11 @@ * @brief command to test DELETE /webhooks/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_depositcheck.c b/src/testing/testing_api_cmd_depositcheck.c @@ -22,12 +22,12 @@ * @author Priscilla HUANG * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler/taler_json_lib.h" #include <gnunet/gnunet_curl_lib.h> #include "taler/taler_signatures.h" #include "taler/taler_testing_lib.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_exec_donaukeyupdate.c b/src/testing/testing_api_cmd_exec_donaukeyupdate.c @@ -21,11 +21,11 @@ * @brief run the taler-merchant-donaukeyupdate command * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_signatures.h> -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_forget_order.c b/src/testing/testing_api_cmd_forget_order.c @@ -22,11 +22,11 @@ * @brief command to forget fields of an order * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_donau_instances.c b/src/testing/testing_api_cmd_get_donau_instances.c @@ -22,12 +22,12 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_donau.h" /** * State of a "GET donau instances" CMD. diff --git a/src/testing/testing_api_cmd_get_instance.c b/src/testing/testing_api_cmd_get_instance.c @@ -21,11 +21,11 @@ * @brief command to test GET /instance/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_instances.c b/src/testing/testing_api_cmd_get_instances.c @@ -21,11 +21,11 @@ * @brief command to test GET /instances * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_orders.c b/src/testing/testing_api_cmd_get_orders.c @@ -21,11 +21,11 @@ * @brief command to test GET /orders * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_otp_device.c b/src/testing/testing_api_cmd_get_otp_device.c @@ -21,11 +21,11 @@ * @brief command to test GET /otp-devices/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -102,7 +102,8 @@ get_otp_device_cb (void *cls, gis->otp_device_reference); if (GNUNET_OK != TALER_TESTING_get_trait_otp_device_description (otp_device_cmd, - &expected_description)) + &expected_description) + ) TALER_TESTING_interpreter_fail (gis->is); if (0 != strcmp (tgr->details.ok.otp_device_description, expected_description)) diff --git a/src/testing/testing_api_cmd_get_otp_devices.c b/src/testing/testing_api_cmd_get_otp_devices.c @@ -21,11 +21,11 @@ * @brief command to test GET /otp-devices * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -75,7 +75,7 @@ struct GetOtpDevicesState */ static void get_otp_devices_cb (void *cls, - const struct TALER_MERCHANT_OtpDevicesGetResponse *tgr) + const struct TALER_MERCHANT_OtpDevicesGetResponse *tgr) { struct GetOtpDevicesState *gis = cls; diff --git a/src/testing/testing_api_cmd_get_product.c b/src/testing/testing_api_cmd_get_product.c @@ -21,11 +21,11 @@ * @brief command to test GET /product/$ID * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -216,7 +216,8 @@ get_product_cb (void *cls, { const uint32_t *expected_precision; bool have_precision = GNUNET_OK == - TALER_TESTING_get_trait_product_unit_precision_level ( + TALER_TESTING_get_trait_product_unit_precision_level + ( product_cmd, &expected_precision); bool override_precision = (NULL != ue) && diff --git a/src/testing/testing_api_cmd_get_product_image.c b/src/testing/testing_api_cmd_get_product_image.c @@ -21,11 +21,11 @@ * @brief command to test GET /products/$HASH/image * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_products.c b/src/testing/testing_api_cmd_get_products.c @@ -21,11 +21,11 @@ * @brief command to test GET /products * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_statisticsamount.c b/src/testing/testing_api_cmd_get_statisticsamount.c @@ -21,11 +21,11 @@ * @brief command to test GET /statistics-amount/$SLUG * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_statisticscounter.c b/src/testing/testing_api_cmd_get_statisticscounter.c @@ -21,11 +21,11 @@ * @brief command to test GET /statistics-counter/$SLUG * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c @@ -21,11 +21,11 @@ * @brief command to test GET /templates/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -139,7 +139,8 @@ get_template_cb (void *cls, if (GNUNET_OK != TALER_TESTING_get_trait_template_contract (template_cmd, - &expected_template_contract)) + &expected_template_contract + )) TALER_TESTING_interpreter_fail (gis->is); if (1 != json_equal (tgr->details.ok.template_contract, expected_template_contract)) diff --git a/src/testing/testing_api_cmd_get_templates.c b/src/testing/testing_api_cmd_get_templates.c @@ -21,11 +21,11 @@ * @brief command to test GET /templates * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_transfers.c b/src/testing/testing_api_cmd_get_transfers.c @@ -22,11 +22,11 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_unit.c b/src/testing/testing_api_cmd_get_unit.c @@ -21,11 +21,11 @@ * @brief command to test GET /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_units.c b/src/testing/testing_api_cmd_get_units.c @@ -21,11 +21,11 @@ * @brief command to test GET /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c @@ -21,11 +21,11 @@ * @brief command to test GET /webhooks/$ID * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_get_webhooks.c b/src/testing/testing_api_cmd_get_webhooks.c @@ -21,11 +21,11 @@ * @brief command to test GET /webhooks * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_instance_auth.c b/src/testing/testing_api_cmd_instance_auth.c @@ -21,11 +21,11 @@ * @brief command to test /private/auth POSTing * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_instance_token.c b/src/testing/testing_api_cmd_instance_token.c @@ -21,11 +21,11 @@ * @brief command to test /private/token POSTing * @author Martin Schanzenbach */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_kyc_get.c b/src/testing/testing_api_cmd_kyc_get.c @@ -21,11 +21,11 @@ * @brief command to test kyc_get request * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_lock_product.c b/src/testing/testing_api_cmd_lock_product.c @@ -21,11 +21,11 @@ * @brief command to test LOCK /product * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c @@ -21,11 +21,11 @@ * @brief command to test GET /private/orders/$ORDER_ID. * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_patch_instance.c b/src/testing/testing_api_cmd_patch_instance.c @@ -21,11 +21,11 @@ * @brief command to test PATCH /instance * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_patch_otp_device.c b/src/testing/testing_api_cmd_patch_otp_device.c @@ -21,11 +21,11 @@ * @brief command to test PATCH /otp-device * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -136,8 +136,8 @@ patch_otp_device_cb (void *cls, */ static void patch_otp_device_run (void *cls, - const struct TALER_TESTING_Command *cmd, - struct TALER_TESTING_Interpreter *is) + const struct TALER_TESTING_Command *cmd, + struct TALER_TESTING_Interpreter *is) { struct PatchOtpDeviceState *pis = cls; @@ -174,7 +174,8 @@ patch_otp_device_traits (void *cls, { struct PatchOtpDeviceState *pts = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_otp_device_description (pts->otp_device_description), + TALER_TESTING_make_trait_otp_device_description (pts->otp_device_description + ), TALER_TESTING_make_trait_otp_key (pts->otp_key), TALER_TESTING_make_trait_otp_alg (&pts->otp_alg), TALER_TESTING_make_trait_otp_id (pts->otp_device_id), diff --git a/src/testing/testing_api_cmd_patch_product.c b/src/testing/testing_api_cmd_patch_product.c @@ -21,11 +21,11 @@ * @brief command to test PATCH /product * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" #include "merchant_api_common.h" diff --git a/src/testing/testing_api_cmd_patch_template.c b/src/testing/testing_api_cmd_patch_template.c @@ -21,11 +21,11 @@ * @brief command to test PATCH /template * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_patch_unit.c b/src/testing/testing_api_cmd_patch_unit.c @@ -21,10 +21,10 @@ * @brief command to test PATCH /private/units/$ID * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_patch_webhook.c b/src/testing/testing_api_cmd_patch_webhook.c @@ -21,11 +21,11 @@ * @brief command to test PATCH /webhook * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c @@ -22,7 +22,7 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> #include <gnunet/gnunet_time_lib.h> @@ -32,9 +32,9 @@ #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include <taler/taler_signatures.h> -#include "taler_merchant_service.h" -#include "taler_merchant_pay_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_pay_service.h" +#include "taler/taler_merchant_testing_lib.h" #ifdef HAVE_DONAU_DONAU_SERVICE_H #include <donau/donau_service.h> diff --git a/src/testing/testing_api_cmd_post_account.c b/src/testing/testing_api_cmd_post_account.c @@ -21,11 +21,11 @@ * @brief command to test POST /account * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_categories.c b/src/testing/testing_api_cmd_post_categories.c @@ -18,12 +18,12 @@ * @brief command to test POST /private/categories * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <jansson.h> #include <microhttpd.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** * State of a "POST /private/categories" CMD. diff --git a/src/testing/testing_api_cmd_post_donau_charity_merchant.c b/src/testing/testing_api_cmd_post_donau_charity_merchant.c @@ -22,13 +22,13 @@ * @author Bohdan Potuzhnyi * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include <taler/taler_signatures.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_donau.h" #include <donau/donau_service.h> #include <donau/donau_testing_lib.h> diff --git a/src/testing/testing_api_cmd_post_donau_instances.c b/src/testing/testing_api_cmd_post_donau_instances.c @@ -23,12 +23,12 @@ * @author Vlada Svirsh */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_donau.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_donau.h" #include <donau/donau_testing_lib.h> /** diff --git a/src/testing/testing_api_cmd_post_instances.c b/src/testing/testing_api_cmd_post_instances.c @@ -21,11 +21,11 @@ * @brief command to test POST /instances * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c @@ -23,18 +23,18 @@ * @author Marcello Stanisci */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_time_lib.h> #include <jansson.h> #include <stdint.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <stdlib.h> #include <math.h> #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** * State for a "POST /orders" CMD. diff --git a/src/testing/testing_api_cmd_post_orders_paid.c b/src/testing/testing_api_cmd_post_orders_paid.c @@ -21,11 +21,11 @@ * @brief command to test POST /orders/$ID/paid. * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_otp_devices.c b/src/testing/testing_api_cmd_post_otp_devices.c @@ -21,11 +21,11 @@ * @brief command to test POST /otp-devices * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** @@ -90,7 +90,7 @@ struct PostOtpDevicesState */ static void post_otp_devices_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr) + const struct TALER_MERCHANT_HttpResponse *hr) { struct PostOtpDevicesState *tis = cls; @@ -137,8 +137,8 @@ post_otp_devices_cb (void *cls, */ static void post_otp_devices_run (void *cls, - const struct TALER_TESTING_Command *cmd, - struct TALER_TESTING_Interpreter *is) + const struct TALER_TESTING_Command *cmd, + struct TALER_TESTING_Interpreter *is) { struct PostOtpDevicesState *tis = cls; @@ -174,13 +174,14 @@ post_otp_devices_run (void *cls, */ static enum GNUNET_GenericReturnValue post_otp_devices_traits (void *cls, - const void **ret, - const char *trait, - unsigned int index) + const void **ret, + const char *trait, + unsigned int index) { struct PostOtpDevicesState *pts = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_otp_device_description (pts->otp_device_description), + TALER_TESTING_make_trait_otp_device_description (pts->otp_device_description + ), TALER_TESTING_make_trait_otp_key (pts->otp_key), TALER_TESTING_make_trait_otp_alg (&pts->otp_alg), TALER_TESTING_make_trait_otp_id (pts->otp_device_id), diff --git a/src/testing/testing_api_cmd_post_products.c b/src/testing/testing_api_cmd_post_products.c @@ -21,11 +21,11 @@ * @brief command to test POST /products * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" #include "merchant_api_common.h" diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c @@ -21,11 +21,11 @@ * @brief command to test POST /templates * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_tokenfamilies.c b/src/testing/testing_api_cmd_post_tokenfamilies.c @@ -22,12 +22,12 @@ * @brief command to run POST /tokenfamilies * @author Christian Blättler */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_time_lib.h> #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_transfers.c b/src/testing/testing_api_cmd_post_transfers.c @@ -21,11 +21,11 @@ * @brief command to test POST /transfers * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_units.c b/src/testing/testing_api_cmd_post_units.c @@ -21,10 +21,10 @@ * @brief command to test POST /private/units * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c @@ -21,11 +21,11 @@ * @brief command to test POST /using-templates * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_post_webhooks.c b/src/testing/testing_api_cmd_post_webhooks.c @@ -21,11 +21,11 @@ * @brief command to test POST /webhooks * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_refund_order.c b/src/testing/testing_api_cmd_refund_order.c @@ -22,11 +22,11 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_testserver.c b/src/testing/testing_api_cmd_testserver.c @@ -22,13 +22,13 @@ * @brief Implement a CMD to run an Testserver service for faking the legitimation service * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler/taler_json_lib.h" #include <gnunet/gnunet_curl_lib.h> #include "taler/taler_testing_lib.h" #include "taler/taler_mhd_lib.h" -#include "taler_merchant_testing_lib.h" -#include "taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" #include <taler/taler_exchange_service.h> /** diff --git a/src/testing/testing_api_cmd_tme.c b/src/testing/testing_api_cmd_tme.c @@ -21,12 +21,12 @@ * @brief run the taler-merchant-reconciliation command * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include "taler/taler_json_lib.h" #include <gnunet/gnunet_curl_lib.h> #include "taler/taler_signatures.h" #include "taler/taler_testing_lib.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_wallet_get_order.c b/src/testing/testing_api_cmd_wallet_get_order.c @@ -21,11 +21,11 @@ * @brief command to test GET /order/$ORDER_ID * @author Jonathan Buchanan */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_wallet_get_template.c b/src/testing/testing_api_cmd_wallet_get_template.c @@ -18,12 +18,12 @@ * @brief command to test GET /templates/$ID (wallet) * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <microhttpd.h> #include <jansson.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** * State of a "GET template" wallet CMD. diff --git a/src/testing/testing_api_cmd_wallet_post_orders_refund.c b/src/testing/testing_api_cmd_wallet_post_orders_refund.c @@ -22,11 +22,11 @@ * @author Marcello Stanisci * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_service.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_service.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_cmd_webhook.c b/src/testing/testing_api_cmd_webhook.c @@ -21,12 +21,12 @@ * @brief run the taler-merchant-webhook command * @author Priscilla HUANG */ -#include "platform.h" +#include "taler/platform.h" #include "taler/taler_json_lib.h" #include <gnunet/gnunet_curl_lib.h> #include "taler/taler_signatures.h" #include "taler/taler_testing_lib.h" -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" /** diff --git a/src/testing/testing_api_helpers.c b/src/testing/testing_api_helpers.c @@ -22,10 +22,10 @@ * @brief helper functions for test library. * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> -#include "taler_merchant_testing_lib.h" +#include "taler/taler_merchant_testing_lib.h" char * diff --git a/src/testing/testing_api_traits.c b/src/testing/testing_api_traits.c @@ -22,8 +22,8 @@ * @author Christian Grothoff * @author Marcello Stanisci */ -#include "platform.h" -#include "taler_merchant_testing_lib.h" +#include "taler/platform.h" +#include "taler/taler_merchant_testing_lib.h" TALER_MERCHANT_TESTING_SIMPLE_TRAITS (TALER_TESTING_MAKE_IMPL_SIMPLE_TRAIT) diff --git a/src/util/amount_quantity.c b/src/util/amount_quantity.c @@ -18,11 +18,11 @@ * @brief Parsing quantities and other decimal fractions * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/util/contract_parse.c b/src/util/contract_parse.c @@ -19,7 +19,7 @@ * @author Iván Ávalos * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> @@ -27,7 +27,7 @@ #include <stdint.h> #include <taler/taler_json_lib.h> #include <taler/taler_util.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/util/contract_serialize.c b/src/util/contract_serialize.c @@ -20,13 +20,13 @@ * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_json_lib.h> #include <gnunet/gnunet_common.h> #include <taler/taler_json_lib.h> #include <jansson.h> #include "taler/taler_util.h" -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** * Get JSON representation of merchant details. diff --git a/src/util/json.c b/src/util/json.c @@ -18,13 +18,13 @@ * @brief helper functions to parse JSON * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> #include <taler/taler_json_lib.h> #include <taler/taler_util.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/util/mfa.c b/src/util/mfa.c @@ -18,12 +18,12 @@ * @brief helper functions for MFA processing * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> -#include <taler_merchant_util.h> +#include <taler/taler_merchant_util.h> #include <jansson.h> /** diff --git a/src/util/os_installation.c b/src/util/os_installation.c @@ -23,9 +23,9 @@ * @brief initialize libgnunet OS subsystem for taler-merchant. * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/util/taler-merchant-config.c b/src/util/taler-merchant-config.c @@ -23,8 +23,8 @@ * @brief tool to access and manipulate Taler merchant configuration files * @author Christian Grothoff */ -#include "platform.h" -#include "taler_merchant_util.h" +#include "taler/platform.h" +#include "taler/taler_merchant_util.h" /** diff --git a/src/util/template_parse.c b/src/util/template_parse.c @@ -18,14 +18,14 @@ * @brief shared logic for template contract parsing * @author Bohdan Potuzhnyi */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> #include <string.h> #include <taler/taler_json_lib.h> #include <taler/taler_util.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <regex.h> diff --git a/src/util/test_contract.c b/src/util/test_contract.c @@ -20,11 +20,11 @@ * @author Iván Ávalos (ivan@avalos.me) */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <jansson.h> const char *contract_common = "{\n" diff --git a/src/util/test_validators.c b/src/util/test_validators.c @@ -19,9 +19,9 @@ * @brief Tests for validators. * @author Christian Grothoff (ivan@avalos.me) */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" static bool check_email (void) diff --git a/src/util/validators.c b/src/util/validators.c @@ -18,11 +18,11 @@ * @brief Input validators * @author Christian Grothoff */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" #include <regex.h> bool diff --git a/src/util/value_kinds.c b/src/util/value_kinds.c @@ -19,11 +19,11 @@ * @author Christian Grothoff * @author Bohdan */ -#include "platform.h" +#include "taler/platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_db_lib.h> #include <taler/taler_json_lib.h> -#include "taler_merchant_util.h" +#include "taler/taler_merchant_util.h" enum GNUNET_GenericReturnValue