summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-aggregator.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:49 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-05 14:36:55 +0100
commit7ff58c3d8f2351c57142b4b65ab75304f355fc4f (patch)
tree4d5de28cbc2cb51b9946c924b7dd228cfe0d0634 /src/exchange/taler-exchange-aggregator.c
parent8a906bf96c9c418dbd58727284eb5cfdd6fdff24 (diff)
downloadexchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.tar.gz
exchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.tar.bz2
exchange-7ff58c3d8f2351c57142b4b65ab75304f355fc4f.zip
refactor /wire to include logic to return the wad fee (for W2W payments)
Diffstat (limited to 'src/exchange/taler-exchange-aggregator.c')
-rw-r--r--src/exchange/taler-exchange-aggregator.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 40653f9b9..abab347fe 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -43,7 +43,7 @@ struct AggregationUnit
struct TALER_MerchantPublicKeyP merchant_pub;
/**
- * Total amount to be transferred, before subtraction of @e wire_fee and rounding down.
+ * Total amount to be transferred, before subtraction of @e fees.wire and rounding down.
*/
struct TALER_Amount total_amount;
@@ -55,7 +55,7 @@ struct AggregationUnit
/**
* Wire fee we charge for @e wp at @e execution_time.
*/
- struct TALER_Amount wire_fee;
+ struct TALER_WireFeeSet fees;
/**
* Wire transfer identifier we use.
@@ -454,7 +454,6 @@ deposit_cb (void *cls,
/* make sure we have current fees */
au->execution_time = GNUNET_TIME_timestamp_get ();
{
- struct TALER_Amount closing_fee;
struct GNUNET_TIME_Timestamp start_date;
struct GNUNET_TIME_Timestamp end_date;
struct TALER_MasterSignatureP master_sig;
@@ -465,8 +464,7 @@ deposit_cb (void *cls,
au->execution_time,
&start_date,
&end_date,
- &au->wire_fee,
- &closing_fee,
+ &au->fees,
&master_sig);
if (0 >= qs)
{
@@ -482,7 +480,7 @@ deposit_cb (void *cls,
"Aggregator starts aggregation for deposit %llu to %s with wire fee %s\n",
(unsigned long long) row_id,
TALER_B2S (&au->wtid),
- TALER_amount2s (&au->wire_fee));
+ TALER_amount2s (&au->fees.wire));
qs = db_plugin->insert_aggregation_tracking (db_plugin->cls,
&au->wtid,
row_id);
@@ -820,7 +818,7 @@ run_aggregation (void *cls)
if ( (0 >=
TALER_amount_subtract (&au_active.final_amount,
&au_active.total_amount,
- &au_active.wire_fee)) ||
+ &au_active.fees.wire)) ||
(GNUNET_SYSERR ==
TALER_amount_round_down (&au_active.final_amount,
&currency_round_unit)) ||