gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] 241/277: clarify with/without wire fee issue


From: gnunet
Subject: [taler-merchant] 241/277: clarify with/without wire fee issue
Date: Sun, 05 Jul 2020 20:52:34 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

commit ae52368483af8b18ac3a3b68d30d4aca1871b067
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jun 23 10:30:17 2020 +0200

    clarify with/without wire fee issue
---
 src/backenddb/merchant-0001.sql            | 2 ++
 src/backenddb/plugin_merchantdb_postgres.c | 9 +++++----
 src/include/taler_merchantdb_plugin.h      | 4 +++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql
index b89f779..f6f91f3 100644
--- a/src/backenddb/merchant-0001.sql
+++ b/src/backenddb/merchant-0001.sql
@@ -364,6 +364,8 @@ COMMENT ON COLUMN merchant_transfers.verified
   IS 'true once we got an acceptable response from the exchange for this 
transfer';
 COMMENT ON COLUMN merchant_transfers.confirmed
   IS 'true once the merchant confirmed that this transfer was received';
+COMMENT ON COLUMN merchant_transfers.credit_amount_val
+  IS 'actual value of the (aggregated) wire transfer, excluding the wire fee';
 
 CREATE TABLE IF NOT EXISTS merchant_transfer_signatures
   (credit_serial BIGINT PRIMARY KEY
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index fc1e3ac..8c6eb80 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -3242,7 +3242,7 @@ RETRY:
       GNUNET_PQ_query_param_string (payto_uri),
       GNUNET_PQ_query_param_string (instance_id),
       GNUNET_PQ_query_param_auto_from_type (wtid),
-      TALER_PQ_query_param_amount (&td->total_amount),
+      TALER_PQ_query_param_amount (&td->total_amount), /* excludes wire fee */
       GNUNET_PQ_query_param_end
     };
     struct GNUNET_PQ_ResultSpec rs[] = {
@@ -3551,7 +3551,9 @@ postgres_lookup_deposits_by_contract_and_coin (
  * @param cls closure
  * @param exchange_url the exchange that made the transfer
  * @param wtid wire transfer subject
- * @param[out] total_amount amount that was transferred (in total, minus @a 
wire_fee)
+ * @param[out] total_amount amount that was debited from our
+ *             aggregate balance at the exchange (in total, sum of
+ *             the wire transfer amount and the @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
@@ -3574,6 +3576,7 @@ postgres_lookup_transfer (
     GNUNET_PQ_query_param_end
   };
   uint8_t verified8;
+  /** Amount we got actually credited, _excludes_ the wire fee */
   struct TALER_Amount credit_amount;
   struct GNUNET_PQ_ResultSpec rs[] = {
     TALER_PQ_RESULT_SPEC_AMOUNT ("credit_amount",
@@ -3596,8 +3599,6 @@ postgres_lookup_transfer (
   if (qs > 0)
   {
     *verified = (0 != verified8);
-    // FIXME: unclear if table stores 'total' including or excluding fee :-(.
-    // Check and update DOCS and taler_exchange_service.h header!
     if (0 >
         TALER_amount_add (total_amount,
                           &credit_amount,
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index b1dafec..3692554 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -1540,7 +1540,9 @@ struct TALER_MERCHANTDB_Plugin
    * @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] total_amount amount that was debited from our
+   *             aggregate balance at the exchange (in total, sum of
+   *             the wire transfer amount and the @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

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]