summaryrefslogtreecommitdiff
path: root/src/include/taler_exchange_service.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_exchange_service.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_exchange_service.h')
-rw-r--r--src/include/taler_exchange_service.h68
1 files changed, 33 insertions, 35 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 30ea4ce66..22ca049eb 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -472,40 +472,32 @@ struct TALER_EXCHANGE_WireAggregateFees
/**
- * Function called with information about the wire fees
- * for each wire method.
- *
- * @param cls closure
- * @param wire_method name of the wire method (i.e. "sepa")
- * @param fees fee structure for this method
+ * Information about a wire account of the exchange.
*/
-typedef void
-(*TALER_EXCHANGE_WireFeeCallback)(void *cls,
- const char *wire_method,
- const struct TALER_EXCHANGE_WireAggregateFees *fees);
+struct TALER_EXCHANGE_WireAccount
+{
+ /**
+ * payto://-URL of the exchange.
+ */
+ const char *url;
+ /**
+ * Salt used to generate @e master_sig.
+ */
+ const char *salt;
-/**
- * Obtain information about wire fees encoded in @a obj
- * by wire method.
- *
- * @param master_pub public key to use to verify signatures, NULL to not verify
- * @param obj wire information as encoded in the #TALER_EXCHANGE_WireResultCallback
- * @param cb callback to invoke for the fees
- * @param cb_cls closure for @a cb
- * @return #GNUNET_OK in success, #GNUNET_SYSERR if @a obj is ill-formed
- */
-int
-TALER_EXCHANGE_wire_get_fees (const struct TALER_MasterPublicKeyP *master_pub,
- const json_t *obj,
- TALER_EXCHANGE_WireFeeCallback cb,
- void *cb_cls);
+ /**
+ * Signature of the exchange over the account (was checked by the API).
+ */
+ struct TALER_MasterSignatureP master_sig;
+ /**
+ * Linked list of wire fees the exchange charges for
+ * accounts of the wire method matching @e url.
+ */
+ const struct TALER_EXCHANGE_WireAggregateFees *fees;
-/**
- * @brief A Wire format inquiry handle
- */
-struct TALER_EXCHANGE_WireHandle;
+};
/**
@@ -519,15 +511,21 @@ struct TALER_EXCHANGE_WireHandle;
* @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful request;
* 0 if the exchange's reply is bogus (fails to follow the protocol)
* @param ec taler-specific error code, #TALER_EC_NONE on success
- * @param obj the received JSON reply, if successful this should be the wire
- * format details as provided by /wire, or NULL if the
- * reply was not in JSON format.
+ * @param accounts_len length of the @a accounts array
+ * @param accounts list of wire accounts of the exchange, NULL on error
*/
typedef void
(*TALER_EXCHANGE_WireResultCallback) (void *cls,
unsigned int http_status,
enum TALER_ErrorCode ec,
- const json_t *obj);
+ unsigned int accounts_len,
+ const struct TALER_EXCHANGE_WireAccount *accounts);
+
+
+/**
+ * @brief A Wire format inquiry handle
+ */
+struct TALER_EXCHANGE_WireHandle;
/**
@@ -843,9 +841,9 @@ struct TALER_EXCHANGE_ReserveHistory
*/
struct {
/**
- * Sender account information for the incoming transfer.
+ * Sender account payto://-URL of the incoming transfer.
*/
- json_t *sender_account_details;
+ char *sender_url;
/**
* Information that uniquely identifies the wire transfer.