diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-05-09 13:40:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-05-09 13:40:01 +0200 |
commit | 7b3fd48e42192c59b8eb402ce3e91187deac7fae (patch) | |
tree | 746195cd5610b86cd47320de9b445bb63c5e980f /src/include | |
parent | 6f1bc0acf901ad028397c1fade55d372dceb6fa6 (diff) | |
download | merchant-7b3fd48e42192c59b8eb402ce3e91187deac7fae.tar.gz merchant-7b3fd48e42192c59b8eb402ce3e91187deac7fae.tar.bz2 merchant-7b3fd48e42192c59b8eb402ce3e91187deac7fae.zip |
towards idempotency in POST /private/transfers
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 96 |
1 files changed, 83 insertions, 13 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index ec584bff..a9816a0f 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -403,13 +403,28 @@ enum TALER_MERCHANTDB_RefundStatus * @param deposit_fee the fee charged for @a deposit_value */ typedef void -(*TALER_MERCHANTDB_TransferDetailsCallback)( +(*TALER_MERCHANTDB_TransferSummaryCallback)( void *cls, const char *order_id, const struct TALER_Amount *deposit_value, const struct TALER_Amount *deposit_fee); +/** + * Function called with detailed information about a wire transfer and + * the underlying deposits that are being aggregated. + * + * @param cls closure + * @param current_offset offset in the exchange reply we are at + * @param ttd details about the transfer at @a current_offset + */ +typedef void +(*TALER_MERCHANTDB_TransferDetailsCallback)( + void *cls, + unsigned int current_offset, + const struct TALER_TrackTransferDetails *ttd); + + /* **************** OLD: ******************** */ /** @@ -1328,16 +1343,76 @@ struct TALER_MERCHANTDB_Plugin /** - * Lookup transfer details. + * Lookup transfer status. * * @param cls closure * @param instance_id instance to lookup payments for - * @param exchange_url - * @param payto_uri - * @param wtid - * @param total_amount - * @param wire_fee - * @param execution_time + * @param exchange_url the exchange that made the transfer + * @param payto_uri account that received the transfer + * @param wtid wire transfer subject + * @param[out] total_amount amount that was transferred (in total, minus @a wire_fee) + * @param[out] wire_fee the wire fee the exchange charged + * @param[out] execution_time when the transfer was executed by the exchange + * @param[out] verified did we confirm the transfer was OK + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*lookup_transfer)( + void *cls, + const char *exchange_url, + const struct TALER_WireTransferIdentifierRawP *wtid, + struct TALER_Amount *total_amount, + struct TALER_Amount *wire_fee, + struct GNUNET_TIME_Absolute *execution_time, + bool *verified); + + + /** + * Set transfer status to verified. + * + * @param cls closure + * @param instance_id instance to lookup payments for + * @param exchange_url the exchange that made the transfer + * @param payto_uri account that received the transfer + * @param wtid wire transfer subject + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*set_transfer_status_to_verified)( + void *cls, + const char *exchange_url, + const struct TALER_WireTransferIdentifierRawP *wtid); + + + /** + * Lookup transfer summary (used if we already verified the details). + * + * @param cls closure + * @param instance_id instance to lookup payments for + * @param exchange_url the exchange that made the transfer + * @param payto_uri account that received the transfer + * @param wtid wire transfer subject + * @param cb function to call with detailed transfer data + * @param cb_cls closure for @a cb + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*lookup_transfer_summary)( + void *cls, + const char *exchange_url, + const struct TALER_WireTransferIdentifierRawP *wtid, + TALER_MERCHANTDB_TransferSummaryCallback cb, + void *cb_cls); + + + /** + * Lookup transfer details. Used if we still need to verify the details. + * + * @param cls closure + * @param instance_id instance to lookup payments for + * @param exchange_url the exchange that made the transfer + * @param payto_uri account that received the transfer + * @param wtid wire transfer subject * @param cb function to call with detailed transfer data * @param cb_cls closure for @a cb * @return transaction status @@ -1345,13 +1420,8 @@ struct TALER_MERCHANTDB_Plugin enum GNUNET_DB_QueryStatus (*lookup_transfer_details)( void *cls, - const char *instance_id, const char *exchange_url, - const char *payto_uri, const struct TALER_WireTransferIdentifierRawP *wtid, - const struct TALER_Amount *total_amount, - const struct TALER_Amount *wire_fee, - struct GNUNET_TIME_Absolute execution_time, TALER_MERCHANTDB_TransferDetailsCallback cb, void *cb_cls); |