From 0e15a995048f1653e92f762d983bf47b4fc6b39f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 4 Mar 2017 18:45:25 +0100 Subject: implement #4937: allow extraction of fees --- src/include/taler_exchange_service.h | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'src/include/taler_exchange_service.h') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 3ac4069f3..3b9058433 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -340,6 +340,69 @@ TALER_EXCHANGE_get_denomination_key_by_hash (const struct TALER_EXCHANGE_Keys *k /* ********************* /wire *********************** */ +/** + * Sorted list of fees to be paid for aggregate wire transfers. + */ +struct TALER_EXCHANGE_WireAggregateFees +{ + /** + * This is a linked list. + */ + struct TALER_EXCHANGE_WireAggregateFees *next; + + /** + * Fee to be paid. + */ + struct TALER_Amount wire_fee; + + /** + * Time when this fee goes into effect (inclusive) + */ + struct GNUNET_TIME_Absolute start_date; + + /** + * Time when this fee stops being in effect (exclusive). + */ + struct GNUNET_TIME_Absolute end_date; + + /** + * Signature affirming the above fee structure. + */ + struct TALER_MasterSignatureP master_sig; +}; + + +/** + * 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 + */ +typedef void +(*TALER_EXCHANGE_WireFeeCallback)(void *cls, + const char *wire_method, + const struct TALER_EXCHANGE_WireAggregateFees *fees); + + +/** + * 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); + + /** * @brief A Wire format inquiry handle */ -- cgit v1.2.3