[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.
- [taler-merchant] 239/277: more checks for GET /private/products/, (continued)
- [taler-merchant] 239/277: more checks for GET /private/products/, gnunet, 2020/07/05
- [taler-merchant] 242/277: also parse and return timestamp and row_id, gnunet, 2020/07/05
- [taler-merchant] 250/277: got refunds working and tested, gnunet, 2020/07/05
- [taler-merchant] 245/277: DCE: removing legacy code and APIs, gnunet, 2020/07/05
- [taler-merchant] 246/277: implement taler-merchant-setup-reserve CLI tool, gnunet, 2020/07/05
- [taler-merchant] 252/277: minor style improvements, gnunet, 2020/07/05
- [taler-merchant] 253/277: fix FIXME, gnunet, 2020/07/05
- [taler-merchant] 254/277: logic to update 'wired' status of an order, gnunet, 2020/07/05
- [taler-merchant] 255/277: deeper checks for merchant get order, gnunet, 2020/07/05
- [taler-merchant] 248/277: deeper checks on GET /private/orders, gnunet, 2020/07/05
- [taler-merchant] 241/277: clarify with/without wire fee issue,
gnunet <=
- [taler-merchant] 244/277: use and handle all /pay status codes, gnunet, 2020/07/05
- [taler-merchant] 247/277: harder tests for GET /private/instances, GET /private/products, gnunet, 2020/07/05
- [taler-merchant] 249/277: made a testing trait for order claim nonce, gnunet, 2020/07/05
- [taler-merchant] 251/277: wallet get order handles refunds properly, gnunet, 2020/07/05
- [taler-merchant] 256/277: test for auto marking orders as wired after inserting sufficient transfers, gnunet, 2020/07/05
- [taler-merchant] 258/277: excluded doc/doxygen from gitignore, gnunet, 2020/07/05
- [taler-merchant] 257/277: updated doxygen generation, gnunet, 2020/07/05
- [taler-merchant] 260/277: fix #6236, gnunet, 2020/07/05
- [taler-merchant] 262/277: deduplicate logic, gnunet, 2020/07/05
- [taler-merchant] 264/277: filler max_upload values for all POST/PATCH handlers, gnunet, 2020/07/05