summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-04-18 21:05:27 +0200
committerChristian Grothoff <christian@grothoff.org>2017-04-18 21:05:27 +0200
commit5e8ef386803c399c1b6d780181b0b8662c418db0 (patch)
treee1e0e7433be54c9f1904e73d3257b00b82320847 /src/include
parent164c125528e4af078815c0156df54fa0120eed8a (diff)
downloadexchange-5e8ef386803c399c1b6d780181b0b8662c418db0.tar.gz
exchange-5e8ef386803c399c1b6d780181b0b8662c418db0.tar.bz2
exchange-5e8ef386803c399c1b6d780181b0b8662c418db0.zip
fixing #4980
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchangedb_plugin.h57
-rw-r--r--src/include/taler_json_lib.h12
-rw-r--r--src/include/taler_signatures.h5
3 files changed, 68 insertions, 6 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index fe08bd27e..b9c3d79e6 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -28,14 +28,13 @@
/**
- * @brief Information we keep on bank transfer(s) that established or
- * closed a reserve.
+ * @brief Information we keep on bank transfer(s) that established a reserve.
*/
struct TALER_EXCHANGEDB_BankTransfer
{
/**
- * Public key of the reserve that was filled or depleted.
+ * Public key of the reserve that was filled.
*/
struct TALER_ReservePublicKeyP reserve_pub;
@@ -52,7 +51,7 @@ struct TALER_EXCHANGEDB_BankTransfer
struct GNUNET_TIME_Absolute execution_date;
/**
- * Detailed wire information about the sending (or receiving) account.
+ * Detailed wire information about the sending account.
*/
json_t *sender_account_details;
@@ -66,6 +65,47 @@ struct TALER_EXCHANGEDB_BankTransfer
/**
+ * @brief Information we keep on bank transfer(s) that
+ * closed a reserve.
+ */
+struct TALER_EXCHANGEDB_ClosingTransfer
+{
+
+ /**
+ * Public key of the reserve that was depleted.
+ */
+ struct TALER_ReservePublicKeyP reserve_pub;
+
+ /**
+ * Amount that was transferred to the exchange.
+ */
+ struct TALER_Amount amount;
+
+ /**
+ * Amount that was charged by the exchange.
+ */
+ struct TALER_Amount closing_fee;
+
+ /**
+ * When did the exchange execute the transaction?
+ */
+ struct GNUNET_TIME_Absolute execution_date;
+
+ /**
+ * Detailed wire information about the receiving account.
+ */
+ json_t *receiver_account_details;
+
+ /**
+ * Detailed wire transfer information that uniquely identifies the
+ * wire transfer.
+ */
+ json_t *transfer_details;
+
+};
+
+
+/**
* @brief A summary of a Reserve
*/
struct TALER_EXCHANGEDB_Reserve
@@ -244,8 +284,7 @@ struct TALER_EXCHANGEDB_ReserveHistory
/**
* Details about a bank transfer to the exchange (reserve
- * was established) or from the exchange (reserve was
- * closed).
+ * was established).
*/
struct TALER_EXCHANGEDB_BankTransfer *bank;
@@ -259,6 +298,12 @@ struct TALER_EXCHANGEDB_ReserveHistory
*/
struct TALER_EXCHANGEDB_Payback *payback;
+ /**
+ * Details about a bank transfer from the exchange (reserve
+ * was closed).
+ */
+ struct TALER_EXCHANGEDB_ClosingTransfer *closing;
+
} details;
};
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index b247ba1f5..248de9c45 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -59,6 +59,18 @@ TALER_JSON_spec_amount (const char *name,
/**
+ * Provide specification to parse given JSON object to an amount
+ * in network byte order.
+ *
+ * @param name name of the amount field in the JSON
+ * @param[out] r_amount where the amount has to be written
+ */
+struct GNUNET_JSON_Specification
+TALER_JSON_spec_amount_nbo (const char *name,
+ struct TALER_AmountNBO *r_amount);
+
+
+/**
* Generate line in parser specification for denomination public key.
*
* @param field name of the field
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 70560b4b3..0b1c7ac33 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -1254,6 +1254,11 @@ struct TALER_ReserveCloseConfirmationPS
struct TALER_AmountNBO closing_amount;
/**
+ * How much did the exchange charge for closing the reserve?
+ */
+ struct TALER_AmountNBO closing_fee;
+
+ /**
* Public key of the reserve that received the payback.
*/
struct TALER_ReservePublicKeyP reserve_pub;