commit cac9a386127ce68c9c7a122623d7a3bbdf951029
parent 05ccc457aa47dfa0a0b325176fbeb424a4fbb638
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Thu, 8 Jun 2017 15:32:19 +0200
fix warnings
Diffstat:
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_track-transaction.c b/src/backend/taler-merchant-httpd_track-transaction.c
@@ -793,6 +793,7 @@ transfer_cb (void *cls,
* @param coin_pub public key of the coin
* @param amount_with_fee amount the exchange will deposit for this coin
* @param deposit_fee fee the exchange will charge for this coin
+ * @param refund_fee fee the exchange will charge for refunding this coin
* @param exchange_proof proof from exchange that coin was accepted
*/
static void
@@ -801,6 +802,7 @@ coin_cb (void *cls,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *deposit_fee,
+ const struct TALER_Amount *refund_fee,
const json_t *exchange_proof)
{
struct TrackTransactionContext *tctx = cls;
diff --git a/src/backend/taler-merchant-httpd_track-transfer.c b/src/backend/taler-merchant-httpd_track-transfer.c
@@ -418,6 +418,7 @@ track_transfer_cleanup (struct TM_HandlerContext *hc)
* @param coin_pub public key of the coin
* @param amount_with_fee amount the exchange will transfer for this coin
* @param deposit_fee fee the exchange will charge for this coin
+ * @param refund_fee fee the exchange will charge for refunding this coin
* @param exchange_proof proof from exchange that coin was accepted
*/
static void
@@ -426,6 +427,7 @@ check_transfer (void *cls,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_Amount *amount_with_fee,
const struct TALER_Amount *deposit_fee,
+ const struct TALER_Amount *refund_fee,
const json_t *exchange_proof)
{
struct TrackTransferContext *rctx = cls;
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
@@ -1632,7 +1632,27 @@ postgres_increase_refund_for_contract (void *cls,
2 "Spread" the refund amount among those coins
3 Store the solution into table merchant_refund */
- return GNUNET_SYSERR;
+ struct PostgresClosure *pg = cls;
+ PGresult *result;
+ unsigned int i;
+
+ struct GNUNET_PQ_QueryParam params[] = {
+ GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
+ GNUNET_PQ_query_param_end
+ };
+
+ result = GNUNET_PQ_exec_prepared (pg->conn,
+ "get_refund_information",
+ params);
+
+ if (PGRES_TUPLES_OK != PQresultStatus (result))
+ {
+ BREAK_DB_ERR (result);
+ PQclear (result);
+ return GNUNET_SYSERR;
+ }
+
+ return GNUNET_OK;
}
/**
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
@@ -536,7 +536,7 @@ run (void *cls)
&h_contract_terms,
&refund_cb,
NULL));
- FAILIF (GNUNET_SYSERR !=
+ FAILIF (GNUNET_OK !=
plugin->increase_refund_for_contract (plugin->cls,
&h_contract_terms,
&refund_amount,