From cde71b7fe74c2a5abb32bf07d40a112e9d7b1135 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 3 May 2020 20:07:49 +0200 Subject: modify TALER_EXCHANGE_deposits_get() API to combine returned arguments into a struct (simplifies merchant later) --- src/include/taler_exchange_service.h | 52 ++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 11 deletions(-) (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 307a76de8..320123041 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1682,27 +1682,57 @@ TALER_EXCHANGE_transfers_get_cancel ( struct TALER_EXCHANGE_DepositGetHandle; +/** + * Data returned for a successful GET /deposits/ request. Note that + * most fields are only set if the status is #MHD_HTTP_OK. Only + * the @e execution_time is available if the status is #MHD_HTTP_ACCEPTED. + */ +struct TALER_EXCHANGE_DepositData +{ + + /** + * exchange key used to sign, NULL if exchange did not + * yet execute the transaction + */ + const struct TALER_ExchangePublicKeyP *exchange_pub; + + /** + * signature from the exchange over the deposit data, NULL if exchange did not + * yet execute the transaction + */ + const struct TALER_ExchangeSignatureP *exchange_sig; + + /** + * wire transfer identifier used by the exchange, NULL if exchange did not + * yet execute the transaction + */ + const struct TALER_WireTransferIdentifierRawP *wtid; + + /** + * actual or planned execution time for the wire transfer + */ + struct GNUNET_TIME_Absolute execution_time; + + /** + * contribution to the total amount by this coin, NULL if exchange did not + * yet execute the transaction + */ + const struct TALER_Amount *coin_contribution; +}; + + /** * Function called with detailed wire transfer data. * * @param cls closure * @param hr HTTP response data - * @param exchange_pub exchange key used to sign @a json, or NULL - * @param wtid wire transfer identifier used by the exchange, NULL if exchange did not - * yet execute the transaction - * @param execution_time actual or planned execution time for the wire transfer - * @param coin_contribution contribution to the total amount by this coin (can be NULL) - * // FIXME: also return the exchange signature - * // FIXME: combine all of the above (except cls,hr) into a 'struct'! => DepositData + * @param dd details about the deposit (NULL on errors) */ typedef void (*TALER_EXCHANGE_DepositGetCallback)( void *cls, const struct TALER_EXCHANGE_HttpResponse *hr, - const struct TALER_ExchangePublicKeyP *exchange_pub, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct GNUNET_TIME_Absolute execution_time, - const struct TALER_Amount *coin_contribution); + const struct TALER_EXCHANGE_DepositData *dd); /** -- cgit v1.2.3