diff options
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.h')
-rw-r--r-- | src/backend/taler-merchant-httpd_exchanges.h | 91 |
1 files changed, 51 insertions, 40 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.h b/src/backend/taler-merchant-httpd_exchanges.h index 5fc57a3e..2a2e9b13 100644 --- a/src/backend/taler-merchant-httpd_exchanges.h +++ b/src/backend/taler-merchant-httpd_exchanges.h @@ -37,21 +37,6 @@ struct TMH_Exchange; /** - * Check if we would trust @a ex to deposit funds - * into our account @a wm. Checks that both @a ex - * is trusted and that @a ex allows wire transfers - * into the account given in @a wm. - * - * @param ex the exchange to check - * @param wm the wire method to check with - * @return #GNUNET_OK if such a debit can happen - */ -enum GNUNET_GenericReturnValue -TMH_exchange_check_debit (struct TMH_Exchange *ex, - const struct TMH_WireMethod *wm); - - -/** * Return the list of exchanges we would find * acceptable for a payment given the @a wire_method. * @@ -96,6 +81,12 @@ typedef void /** + * Abstraction of wire knowledge returned internally. + */ +struct TMH_ExchangeWireDetails; + + +/** * Function called with the result of a #TMH_EXCHANGES_wire4exchange() * operation. * @@ -105,13 +96,13 @@ typedef void typedef void (*TMH_EXCHANGES_WireContinuation)( void *cls, - struct TMH_Exchange *wire); + const struct TMH_ExchangeWireDetails *wire); /** * Information we keep for a pending #MMH_EXCHANGES_keys4exchange() operation. */ -struct TMH_EXCHANGES_Find2Operation; +struct TMH_EXCHANGES_KeysOperation; /** * Information we keep for a pending #MMH_EXCHANGES_wire4exchange() operation. @@ -126,10 +117,20 @@ struct TMH_EXCHANGES_WireOperation; * @param fc function to call with the handles for the exchange * @param fc_cls closure for @a fc */ -struct TMH_EXCHANGES_Find2Operation * -TMH_EXCHANGES_keys4exchange (const char *exchange, - TMH_EXCHANGES_Find2Continuation fc, - void *fc_cls); +struct TMH_EXCHANGES_KeysOperation * +TMH_EXCHANGES_keys4exchange ( + const char *exchange, + TMH_EXCHANGES_Find2Continuation fc, + void *fc_cls); + + +/** + * Abort pending keys details lookup operation. + * + * @param fo handle to operation to abort + */ +void +TMH_EXCHANGES_keys4exchange_cancel (struct TMH_EXCHANGES_KeysOperation *fo); /** @@ -140,9 +141,20 @@ TMH_EXCHANGES_keys4exchange (const char *exchange, * @param fc_cls closure for @a fc */ struct TMH_EXCHANGES_WireOperation * -TMH_EXCHANGES_wire4exchange (const char *exchange, - TMH_EXCHANGES_WireContinuation fc, - void *fc_cls); +TMH_EXCHANGES_wire4exchange ( + const char *exchange, + TMH_EXCHANGES_WireContinuation fc, + void *fc_cls); + + +/** + * Abort pending wire details lookup operation. + * + * @param fo handle to operation to abort + */ +void +TMH_EXCHANGES_wire4exchange_cancel ( + struct TMH_EXCHANGES_WireOperation *fo); /** @@ -157,27 +169,26 @@ TMH_EXCHANGES_wire4exchange (const char *exchange, * #GNUNET_SYSERR if @a exchange_url did not yet respond properly to our /wire request */ enum GNUNET_GenericReturnValue -TMH_EXCHANGES_lookup_wire_fee (const char *exchange_url, - const char *wire_method, - struct TALER_Amount *wire_fee); +TMH_EXCHANGES_lookup_wire_fee ( + const struct TMH_ExchangeWireDetails *wd, + const char *wire_method, + struct TALER_Amount *wire_fee); /** - * Abort pending keys details lookup operation. - * - * @param fo handle to operation to abort - */ -void -TMH_EXCHANGES_keys4exchange_cancel (struct TMH_EXCHANGES_Find2Operation *fo); - - -/** - * Abort pending wire details lookup operation. + * Check if we would trust @a ex to deposit funds + * into our account @a wm. Checks that both @a ex + * is trusted and that @a ex allows wire transfers + * into the account given in @a wm. * - * @param fo handle to operation to abort + * @param wd the wire details of the exchange to check + * @param wm the wire method to check with + * @return #GNUNET_OK if such a debit can happen */ -void -TMH_EXCHANGES_wire4exchange_cancel (struct TMH_EXCHANGES_WireOperation *fo); +enum GNUNET_GenericReturnValue +TMH_exchange_check_debit ( + const struct TMH_ExchangeWireDetails *wd, + const struct TMH_WireMethod *wm); #endif |