diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-05-10 20:06:36 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-05-10 20:06:36 +0200 |
commit | a5da6d3cec3b090c5aa21255eed37fc7a3ca48ec (patch) | |
tree | 0f2a93abc26c9d53690864a47250035dbb167a14 /src/include/taler_merchantdb_plugin.h | |
parent | 47811a60b692e575274305d4cac429220d27a328 (diff) | |
download | merchant-a5da6d3cec3b090c5aa21255eed37fc7a3ca48ec.tar.gz merchant-a5da6d3cec3b090c5aa21255eed37fc7a3ca48ec.tar.bz2 merchant-a5da6d3cec3b090c5aa21255eed37fc7a3ca48ec.zip |
GET /transfers implementation
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 106 |
1 files changed, 58 insertions, 48 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index a9816a0f..5321b574 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -425,6 +425,35 @@ typedef void const struct TALER_TrackTransferDetails *ttd); +/** + * Function called with information about a wire transfer. + * + * @param cls closure with a `json_t *` array to build up the response + * @param credit_amount how much was wired to the merchant (minus fees) + * @param wtid wire transfer identifier + * @param payto_uri target account that received the wire transfer + * @param exchange_url base URL of the exchange that made the wire transfer + * @param transfer_serial_id serial number identifying the transfer in the backend + * @param execution_time when did the exchange make the transfer, #GNUNET_TIME_UNIT_FOREVER_ABS + * if it did not yet happen + * @param verified true if we checked the exchange's answer and liked it, + * false there is a problem (verification failed or did not yet happen) + * @param confirmed true if the merchant confirmed this wire transfer + * false if it is so far only claimed to have been made by the exchange + */ +typedef void +(*TALER_MERCHANTDB_TransferCallback)( + void *cls, + const struct TALER_Amount *credit_amount, + const struct TALER_WireTransferIdentifierRawP *wtid, + const char *payto_uri, + const char *exchange_url, + uint64_t transfer_serial_id, + struct GNUNET_TIME_Absolute execution_time, + bool verified, + bool confirmed); + + /* **************** OLD: ******************** */ /** @@ -495,33 +524,6 @@ typedef void /** - * Information about the wire transfer corresponding to - * a deposit operation. Note that it is in theory possible - * that we have a @a h_contract_terms and @a coin_pub in the - * result that do not match a deposit that we know about, - * for example because someone else deposited funds into - * our account. - * - * @param cls closure - * @param h_contract_terms hashcode of the proposal data - * @param coin_pub public key of the coin - * @param wtid identifier of the wire transfer in which the exchange - * send us the money for the coin deposit - * @param execution_time when was the wire transfer executed? - * @param exchange_proof proof from exchange about what the deposit was for - * NULL if we have not asked for this signature - */ -typedef void -(*TALER_MERCHANTDB_TransferCallback)( - void *cls, - const struct GNUNET_HashCode *h_contract_terms, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_WireTransferIdentifierRawP *wtid, - struct GNUNET_TIME_Absolute execution_time, - const json_t *exchange_proof); - - -/** * Function called with information about a wire transfer identifier. * * @param cls closure @@ -1346,7 +1348,6 @@ struct TALER_MERCHANTDB_Plugin * Lookup transfer status. * * @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 @@ -1426,6 +1427,35 @@ struct TALER_MERCHANTDB_Plugin void *cb_cls); + /** + * Lookup transfers. + * + * @param cls closure + * @param instance_id instance to lookup payments for + * @param payto_uri account that we are interested in transfers to + * @param before timestamp for the earliest transfer we care about + * @param after timestamp for the last transfer we care about + * @param limit number of entries to return, negative for descending in execution time, + * positive for ascending in execution time + * @param offset transfer_serial number of the transfer we want to offset from + * @param verified filter transfers by verification status + * @param cb function to call with detailed transfer data + * @param cb_cls closure for @a cb + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*lookup_transfers)(void *cls, + const char *instance_id, + const char *payto_uri, + struct GNUNET_TIME_Absolute before, + struct GNUNET_TIME_Absolute after, + int64_t limit, + uint64_t offset, + enum TALER_MERCHANTDB_YesNoAll yna, + TALER_MERCHANTDB_TransferCallback cb, + void *cb_cls); + + /* ****************** OLD API ******************** */ @@ -1605,26 +1635,6 @@ struct TALER_MERCHANTDB_Plugin /** - * Lookup information about a transfer by @a h_contract_terms. Note - * that in theory there could be multiple wire transfers for a - * single @a h_contract_terms, as the transaction may have involved - * multiple coins and the coins may be spread over different wire - * transfers. - * - * @param cls closure - * @param h_contract_terms proposal data's hashcode - * @param cb function to call with transfer data - * @param cb_cls closure for @a cb - * @return transaction status - */ - enum GNUNET_DB_QueryStatus - (*find_transfers_by_hash)(void *cls, - const struct GNUNET_HashCode *h_contract_terms, - TALER_MERCHANTDB_TransferCallback cb, - void *cb_cls); - - - /** * Lookup proof information about a wire transfer. * * @param cls closure |