summaryrefslogtreecommitdiff
path: root/src/wire/wire.c
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/wire/wire.c
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/wire/wire.c')
-rw-r--r--src/wire/wire.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/src/wire/wire.c b/src/wire/wire.c
index 58180b7b1..aeb8689e6 100644
--- a/src/wire/wire.c
+++ b/src/wire/wire.c
@@ -146,80 +146,4 @@ TALER_WIRE_plugin_unload (struct TALER_WIRE_Plugin *plugin)
}
-/**
- * Closure of #check_for_wire.
- */
-struct FindEnabledWireContext
-{
- /**
- * Configuration we are usign.
- */
- const struct GNUNET_CONFIGURATION_Handle *cfg;
-
- /**
- * Callback to invoke.
- */
- TALER_WIRE_EnabledCallback cb;
-
- /**
- * Closure for @e cb.
- */
- void *cb_cls;
-};
-
-
-/**
- * Check if @a section begins with "exchange-wire-", and if
- * so if the "ENABLE" option is set to "YES". If both are
- * true, call the callback from the context with the
- * rest of the section name.
- *
- * @param cls our `struct FindEnabledWireContext`
- * @param section name of a section in the configuration
- */
-static void
-check_for_wire (void *cls,
- const char *section)
-{
- struct FindEnabledWireContext *ctx = cls;
- const char *name;
-
- if (0 != strncasecmp (section,
- "exchange-wire-",
- strlen ("exchange-wire-")))
- return;
- if (GNUNET_YES !=
- GNUNET_CONFIGURATION_get_value_yesno (ctx->cfg,
- section,
- "ENABLE"))
- return;
- name = &section[strlen ("exchange-wire-")];
- ctx->cb (ctx->cb_cls,
- name);
-}
-
-
-/**
- * Check which wire plugins are enabled in @a cfg and call @a cb for each one.
- *
- * @param cfg configuration to use
- * @param cb callback to invoke
- * @param cb_cls closure for @a cb
- */
-void
-TALER_WIRE_find_enabled (const struct GNUNET_CONFIGURATION_Handle *cfg,
- TALER_WIRE_EnabledCallback cb,
- void *cb_cls)
-{
- struct FindEnabledWireContext ctx;
-
- ctx.cfg = cfg;
- ctx.cb = cb;
- ctx.cb_cls = cb_cls;
- GNUNET_CONFIGURATION_iterate_sections (cfg,
- &check_for_wire,
- &ctx);
-}
-
-
/* end of wire.c */