diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-01 16:15:35 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-01 16:15:35 +0200 |
commit | de3e26303e0069614d4a5aa425e4fa5ddb088b8b (patch) | |
tree | 982ba3095d80ec48a910dad15e3d886b36c6be24 /src/include | |
parent | 92907bee45681b1273172a3c88461a60bcae8589 (diff) |
implementing #4356, tests still failing, but main logic should now be updated
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_exchange_service.h | 46 | ||||
-rw-r--r-- | src/include/taler_signatures.h | 26 | ||||
-rw-r--r-- | src/include/taler_wire_plugin.h | 15 |
3 files changed, 29 insertions, 58 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index e4aa89a59..4a1592cf2 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -396,53 +396,35 @@ struct TALER_EXCHANGE_WireHandle; * Callbacks of this type are used to serve the result of submitting a * wire format inquiry request to a exchange. * - * The callback is invoked multiple times, once for each supported @a - * method. Finally, it is invoked one more time with cls/0/NULL/NULL - * to indicate the end of the iteration. If any request fails to - * generate a valid response from the exchange, @a http_status will also - * be zero and the iteration will also end. Thus, the iteration - * always ends with a final call with an @a http_status of 0. If the - * @a http_status is already 0 on the first call, then the response to - * the /wire request was invalid. Later, clients can tell the - * difference between @a http_status of 0 indicating a failed - * /wire/method request and a regular end of the iteration by @a - * method being non-NULL. If the exchange simply correctly asserts that - * it does not support any methods, @a method will be NULL but the @a - * http_status will be #MHD_HTTP_OK for the first call (followed by a - * cls/0/NULL/NULL call to signal the end of the iteration). + * If the request fails to generate a valid response from the + * exchange, @a http_status will also be zero. * * @param cls closure * @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 method wire format method supported, i.e. "test" or "sepa", or NULL - * if already the /wire request failed. * @param obj the received JSON reply, if successful this should be the wire - * format details as provided by /wire/METHOD/, or NULL if the - * reply was not in JSON format (in this case, the client might - * want to do an HTTP request to /wire/METHOD/ with a browser to - * provide more information to the user about the @a method). + * format details as provided by /wire, or NULL if the + * reply was not in JSON format. */ typedef void (*TALER_EXCHANGE_WireResultCallback) (void *cls, unsigned int http_status, - const char *method, json_t *obj); /** - * Obtain information about a exchange's wire instructions. - * A exchange may provide wire instructions for creating - * a reserve. The wire instructions also indicate - * which wire formats merchants may use with the exchange. - * This API is typically used by a wallet for wiring - * funds, and possibly by a merchant to determine - * supported wire formats. + * Obtain information about a exchange's wire instructions. A + * exchange may provide wire instructions for creating a reserve. The + * wire instructions also indicate which wire formats merchants may + * use with the exchange. This API is typically used by a wallet for + * wiring funds, and possibly by a merchant to determine supported + * wire formats. * * Note that while we return the (main) response verbatim to the * caller for further processing, we do already verify that the * response is well-formed (i.e. that signatures included in the - * response are all valid). If the exchange's reply is not well-formed, - * we return an HTTP status code of zero to @a cb. + * response are all valid). If the exchange's reply is not + * well-formed, we return an HTTP status code of zero to @a cb. * * @param exchange the exchange handle; the exchange must be ready to operate * @param wire_cb the callback to call when a reply for this request is available @@ -451,8 +433,8 @@ typedef void */ struct TALER_EXCHANGE_WireHandle * TALER_EXCHANGE_wire (struct TALER_EXCHANGE_Handle *exchange, - TALER_EXCHANGE_WireResultCallback wire_cb, - void *wire_cb_cls); + TALER_EXCHANGE_WireResultCallback wire_cb, + void *wire_cb_cls); /** diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index d958f16ba..23bdaa578 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -102,11 +102,6 @@ #define TALER_SIGNATURE_EXCHANGE_KEY_SET 1035 /** - * Signature where the Exchange confirms the /wire response. - */ -#define TALER_SIGNATURE_EXCHANGE_WIRE_TYPES 1036 - -/** * Signature where the Exchange confirms the /deposit/wtid response. */ #define TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE 1036 @@ -785,27 +780,6 @@ struct TALER_MasterWireSepaDetailsPS /** - * @brief Information signed by a exchange's online signing key affirming - * the wire formats supported by the exchange. - */ -struct TALER_ExchangeWireSupportMethodsPS -{ - - /** - * Purpose is #TALER_SIGNATURE_EXCHANGE_WIRE_TYPES. - */ - struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - - /** - * Hash over the various wire formats supported by this exchange - * (all as 0-terminated strings). - */ - struct GNUNET_HashCode h_wire_types GNUNET_PACKED; - -}; - - -/** * @brief Format used to generate the signature on a request to obtain * the wire transfer identifier associated with a deposit. */ diff --git a/src/include/taler_wire_plugin.h b/src/include/taler_wire_plugin.h index c80aa2e49..e166558a7 100644 --- a/src/include/taler_wire_plugin.h +++ b/src/include/taler_wire_plugin.h @@ -99,6 +99,21 @@ struct TALER_WIRE_Plugin /** + * Obtain wire transfer details in the plugin-specific format + * from the configuration. + * + * @param cls closure + * @param cfg configuration with details about wire accounts + * @param account_name which section in the configuration should we parse + * @return NULL if @a cfg fails to have valid wire details for @a account_name + */ + json_t * + (*get_wire_details)(void *cls, + const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *account_name); + + + /** * Check if the given wire format JSON object is correctly formatted * * @param cls the @e cls of this struct with the plugin-specific state |