summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_wire.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/lib/exchange_api_wire.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/lib/exchange_api_wire.c')
-rw-r--r--src/lib/exchange_api_wire.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/exchange_api_wire.c b/src/lib/exchange_api_wire.c
index 453b576b1..0390623fa 100644
--- a/src/lib/exchange_api_wire.c
+++ b/src/lib/exchange_api_wire.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2020 Taler Systems SA
+ Copyright (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -144,9 +144,11 @@ parse_fees (json_t *fees)
GNUNET_JSON_spec_fixed_auto ("sig",
&wa->master_sig),
TALER_JSON_spec_amount_any ("wire_fee",
- &wa->wire_fee),
+ &wa->fees.wire),
+ TALER_JSON_spec_amount_any ("wad_fee",
+ &wa->fees.wad),
TALER_JSON_spec_amount_any ("closing_fee",
- &wa->closing_fee),
+ &wa->fees.closing),
GNUNET_JSON_spec_timestamp ("start_date",
&wa->start_date),
GNUNET_JSON_spec_timestamp ("end_date",
@@ -230,8 +232,10 @@ handle_wire_finished (void *cls,
struct FeeMap *fm;
const struct TALER_EXCHANGE_Keys *key_state;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("accounts", &accounts),
- GNUNET_JSON_spec_json ("fees", &fees),
+ GNUNET_JSON_spec_json ("accounts",
+ &accounts),
+ GNUNET_JSON_spec_json ("fees",
+ &fees),
GNUNET_JSON_spec_end ()
};
@@ -277,8 +281,10 @@ handle_wire_finished (void *cls,
struct TALER_EXCHANGE_WireAccount *wa = &was[i];
json_t *account;
struct GNUNET_JSON_Specification spec_account[] = {
- GNUNET_JSON_spec_string ("payto_uri", &wa->payto_uri),
- GNUNET_JSON_spec_fixed_auto ("master_sig", &wa->master_sig),
+ GNUNET_JSON_spec_string ("payto_uri",
+ &wa->payto_uri),
+ GNUNET_JSON_spec_fixed_auto ("master_sig",
+ &wa->master_sig),
GNUNET_JSON_spec_end ()
};
char *method;