merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit b783ce987fd5543532d61d9fbd483af9394ddc30
parent 21b5a1913b1de143d2afb5a86313a460e92e2399
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Tue, 18 Apr 2017 11:48:15 +0200

adding option to lookup history entries in the future.

Diffstat:
Msrc/backend/taler-merchant-httpd_history.c | 1+
Msrc/backenddb/plugin_merchantdb_postgres.c | 4++++
Msrc/backenddb/test_merchantdb.c | 1+
Msrc/include/taler_merchantdb_plugin.h | 3+++
4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_history.c b/src/backend/taler-merchant-httpd_history.c @@ -189,6 +189,7 @@ MH_handler_history (struct TMH_RequestHandler *rh, &mi->pubkey, start, delta, + GNUNET_NO, pd_cb, response); if (GNUNET_SYSERR == ret) diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -832,6 +832,9 @@ postgres_store_transfer_to_proof (void *cls, * furtherly older records, and so on. Alternatively, you can use always * the same timestamp and just go behind in history by tuning `start`. * @param nrows only nrows rows are returned. + * @param future if set to GNUNET_YES, retrieves rows younger than `date`. + * This is tipically used to show live updates on the merchant's backoffice + * Web interface. * @param cb function to call with transaction data, can be NULL. * @param cb_cls closure for @a cb * @return numer of found tuples, #GNUNET_SYSERR upon error @@ -842,6 +845,7 @@ postgres_find_proposal_data_by_date_and_range (void *cls, const struct TALER_MerchantPublicKeyP *merchant_pub, unsigned int start, unsigned int nrows, + unsigned int future, TALER_MERCHANTDB_ProposalDataCallback cb, void *cb_cls) { diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c @@ -384,6 +384,7 @@ run (void *cls) &merchant_pub, 2, 1, + GNUNET_NO, pd_cb, NULL)); diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h @@ -226,6 +226,8 @@ struct TALER_MERCHANTDB_Plugin * instance are returned. * @param start only rows with serial id less than start are returned. * @param nrows only nrows rows are returned. + * @param future if set to GNUNET_YES, retrieves rows younger than `date`. + * This is tipically used to show live updates on the merchant's backoffice * @param cb function to call with transaction data, can be NULL. * @param cb_cls closure for @a cb * @return numer of found tuples, #GNUNET_SYSERR upon error @@ -236,6 +238,7 @@ struct TALER_MERCHANTDB_Plugin const struct TALER_MerchantPublicKeyP *merchant_pub, unsigned int start, unsigned int nrows, + unsigned int future, TALER_MERCHANTDB_ProposalDataCallback cb, void *cb_cls);