From 42bc31744b9810509aef344c54bfee2f4e2a7ccb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 4 Feb 2020 21:59:43 +0100 Subject: implement /config in fakebank and taler_bank_lib.h (#6066) --- src/include/taler_bank_service.h | 73 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) (limited to 'src/include/taler_bank_service.h') diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h index 98a1017c2..c9c93fac5 100644 --- a/src/include/taler_bank_service.h +++ b/src/include/taler_bank_service.h @@ -89,6 +89,73 @@ struct TALER_BANK_AuthenticationData }; +/* ********************* /config *********************** */ + +/** + * @brief A /config Handle + */ +struct TALER_BANK_ConfigHandle; + +/** + * Configuration data provided by the bank. + */ +struct TALER_BANK_Configuration +{ + /** + * Current protocol version. Libtool style. + */ + const char *version; + + /** + * Currency used by the bank. + */ + const char *currency; +}; + + +/** + * Function called with configuration details from the bank. + * + * @param cls closure + * @param http status code + * @param ec taler error code + * @param config the configuration, NULL on error + */ +typedef void +(*TALER_BANK_ConfigCallback)(void *cls, + unsigned int http_status, + enum TALER_ErrorCode ec, + const struct TALER_BANK_Configuration *config); + +/** + * Request the configuration of the bank. + * + * @param ctx curl context for the event loop + * @param auth authentication data to use + * @param hres_cb the callback to call with the + * configuration + * @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_BANK_ConfigHandle * +TALER_BANK_configuration (struct GNUNET_CURL_Context *ctx, + const struct TALER_BANK_AuthenticationData *auth, + TALER_BANK_ConfigCallback hres_cb, + void *hres_cb_cls); + + +/** + * Cancel a configuration request. This function cannot be + * used on a request handle if a response is already + * served for it. + * + * @param ch the configuration request handle + */ +void +TALER_BANK_configuration_cancel (struct TALER_BANK_ConfigHandle *ch); + /* ********************* /admin/add/incoming *********************** */ @@ -160,7 +227,7 @@ TALER_BANK_admin_add_incoming_cancel (struct TALER_BANK_AdminAddIncomingHandle *aai); -/* ********************* /taler/transfer *********************** */ +/* ********************* /transfer *********************** */ /** * Prepare for exeuction of a wire transfer. @@ -243,7 +310,7 @@ TALER_BANK_execute_wire_transfer_cancel (struct TALER_BANK_WireExecuteHandle *weh); -/* ********************* /taler/credits *********************** */ +/* ********************* /history/incoming *********************** */ /** * Handle for querying the bank for transactions @@ -347,7 +414,7 @@ void TALER_BANK_credit_history_cancel (struct TALER_BANK_CreditHistoryHandle *hh); -/* ********************* /taler/debits *********************** */ +/* ********************* /history/outgoing *********************** */ /** * Handle for querying the bank for transactions -- cgit v1.2.3