diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-02-23 17:52:26 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-02-23 17:52:26 +0100 |
commit | 194c97899c81cafa3673f7f7d9db6be8425e0fc2 (patch) | |
tree | c3bc43571cf602fc422585a3ff7a25ffdaa4acb3 /src/include/taler_merchantdb_plugin.h | |
parent | fff2f0e3c8dc7665cdaa3adeb9d4521e75cb078d (diff) | |
download | merchant-194c97899c81cafa3673f7f7d9db6be8425e0fc2.tar.gz merchant-194c97899c81cafa3673f7f7d9db6be8425e0fc2.tar.bz2 merchant-194c97899c81cafa3673f7f7d9db6be8425e0fc2.zip |
Modify /history API and DB table for order_id-proposal_data
mapping. Adapting testcase and lib for that.
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index 33102a03..befa23df 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -32,6 +32,18 @@ struct TALER_MERCHANTDB_Plugin; /** + * Tipically called by `find_proposal_data_by_date`. + * + * @param cls closure + * @param order_id order id + * @param proposal_data proposal data related to order id + */ + typedef void + (*TALER_MERCHANTDB_ProposalDataCallback)(void *cls, + const char *order_id, + const json_t *proposal_data); + +/** * Function called with information about a transaction. * * @param cls closure @@ -158,8 +170,9 @@ struct TALER_MERCHANTDB_Plugin */ int (*insert_proposal_data) (void *cls, - const struct GNUNET_HashCode *h_transaction_id, + const char *order_id, const struct TALER_MerchantPublicKeyP *merchant_pub, + struct GNUNET_TIME_Absolute timestamp, const json_t *proposal_data); @@ -177,11 +190,28 @@ struct TALER_MERCHANTDB_Plugin int (*find_proposal_data) (void *cls, json_t **proposal_data, - const struct GNUNET_HashCode *h_transaction_id, + const char *order_id, const struct TALER_MerchantPublicKeyP *merchant_pub); /** + * Return proposal data and order id for all proposals younger than + * date. + * + * @param cls closure + * @param date limit to the oldest record + * @param cb callback called with proposal data and order id + * @param cb_cls closure for cb + */ + int + (*find_proposal_data_by_date) (void *cls, + struct GNUNET_TIME_Absolute date, + const struct TALER_MerchantPublicKeyP *merchant_pub, + TALER_MERCHANTDB_ProposalDataCallback cb, + void *cb_cls); + + + /** * Insert transaction data into the database. * * @param cls closure |