summaryrefslogtreecommitdiff
path: root/src/include/taler_exchangedb_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-02 14:24:45 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-02 14:29:44 +0200
commitcb55c1a3af9f56a6da38e5589e72df0b70d355b1 (patch)
tree5f9a3af7d9073249f77ce56c690844a6cb27c3e7 /src/include/taler_exchangedb_lib.h
parent7a20062bafed42f937c5388aed09042aad7014c0 (diff)
downloadexchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.tar.gz
exchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.tar.bz2
exchange-cb55c1a3af9f56a6da38e5589e72df0b70d355b1.zip
Changing configuration structure to enable multiple accounts.
This change enables using multiple wire plugins at the same time. Also, we now distinguish between the wire plugin (i.e. EBICS or taler_bank) and the wire method (i.e. SEPA or x-taler-bank) that the wire plugin is implementing. The "taler-bank" wire method was renamed from "test" to "x-taler-bank". This also changes the format of the /wire response of the exchange, as we now need to return multiple accounts. Note that wire fees are specified per wire method, not per wire account. taler-exchange-keyup now automatically signs all of the /wire responses in the location specified by the configuration. Account identification in wire plugins was changed to use payto://-URLs instead of method-specific JSON fields. Signing and validation of /wire responses was moved from each wire plugin to a generic validation method in libtalerutil (crypto) or libtalerjson (for JSON-formatted inputs). Convenience methods were added to generate JSON for wire accounts (salting, signing). Various section and option names were adjusted to streamline the configuration and make it more consistent overall. Documentation was updated as well.
Diffstat (limited to 'src/include/taler_exchangedb_lib.h')
-rw-r--r--src/include/taler_exchangedb_lib.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/include/taler_exchangedb_lib.h b/src/include/taler_exchangedb_lib.h
index e4284c27f..b89dd087d 100644
--- a/src/include/taler_exchangedb_lib.h
+++ b/src/include/taler_exchangedb_lib.h
@@ -406,4 +406,72 @@ TALER_EXCHANGEDB_fees_write (const char *filename,
void
TALER_EXCHANGEDB_fees_free (struct TALER_EXCHANGEDB_AggregateFees *af);
+
+/**
+ * Information about an account from the configuration.
+ */
+struct TALER_EXCHANGEDB_AccountInfo
+{
+ /**
+ * Section in the configuration file that specifies the
+ * account. Must start with "account-".
+ */
+ const char *section_name;
+
+ /**
+ * Name of the wire plugin that should be used to access
+ * the account.
+ */
+ const char *plugin_name;
+
+ /**
+ * payto://-URL of the account.
+ */
+ const char *payto_url;
+
+ /**
+ * Filename containing the signed /wire response, or NULL
+ * if not given.
+ */
+ const char *wire_response_filename;
+
+ /**
+ * #GNUNET_YES if this account is enabed to be debited
+ * by the taler-exchange-aggregator.
+ */
+ int debit_enabled;
+
+ /**
+ * #GNUNET_YES if this account is enabed to be credited by wallets
+ * and needs to be watched by the taler-exchange-wirewatch.
+ * Also, the account will only be included in /wire if credit
+ * is enabled.
+ */
+ int credit_enabled;
+};
+
+
+/**
+ * Function called with information about a wire account.
+ *
+ * @param cls closure
+ * @param ai account information
+ */
+typedef void
+(*TALER_EXCHANGEDB_AccountCallback)(void *cls,
+ const struct TALER_EXCHANGEDB_AccountInfo *ai);
+
+/**
+ * Parse the configuration to find account information.
+ *
+ * @param cfg configuration to use
+ * @param cb callback to invoke
+ * @param cb_cls closure for @a cb
+ */
+void
+TALER_EXCHANGEDB_find_accounts (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ TALER_EXCHANGEDB_AccountCallback cb,
+ void *cb_cls);
+
+
#endif