summaryrefslogtreecommitdiff
path: root/src/include/taler_bank_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-04 21:59:43 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-04 21:59:43 +0100
commit42bc31744b9810509aef344c54bfee2f4e2a7ccb (patch)
tree92ece6674b23f5e985755992a2ddb840cdd2de7f /src/include/taler_bank_service.h
parente6d6987e5685b35f6c3137f59894a02a63d09766 (diff)
downloadexchange-42bc31744b9810509aef344c54bfee2f4e2a7ccb.tar.gz
exchange-42bc31744b9810509aef344c54bfee2f4e2a7ccb.tar.bz2
exchange-42bc31744b9810509aef344c54bfee2f4e2a7ccb.zip
implement /config in fakebank and taler_bank_lib.h (#6066)
Diffstat (limited to 'src/include/taler_bank_service.h')
-rw-r--r--src/include/taler_bank_service.h73
1 files changed, 70 insertions, 3 deletions
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