[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] 183/277: work on getting TransactionWireTransfer reply
From: |
gnunet |
Subject: |
[taler-merchant] 183/277: work on getting TransactionWireTransfer reply built |
Date: |
Sun, 05 Jul 2020 20:51:36 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
commit fbd93498c3a1135986470c869a9db1a75b8886c4
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jun 6 21:40:49 2020 +0200
work on getting TransactionWireTransfer reply built
---
.../taler-merchant-httpd_private-get-orders-ID.c | 34 +++++++++++++++++-----
src/include/taler_merchantdb_plugin.h | 8 ++++-
2 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
index d4d2660..e82a121 100644
--- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -562,7 +562,11 @@ process_refunds_cb (void *cls,
* the response.
*
* @param cls a `struct GetOrderRequestContext`
- * @param wtid wire transfer subject of the wire transfer for the coin
+ * @param wtid wire transfer subject of the wire transfer for the coin,
+ * or NULL if transfer is yet to be made
+ * @param exchange_url base URL of the exchange that made the payment
+ * @param execution_time when was the payment made (or in the future,
+ * when is it expected to be made)
* @param deposit_value contribution of the coin to the total wire transfer
value
* @param deposit_fee deposit fee charged by the exchange for the coin
* @param transfer_confirmed did the merchant confirm that a wire transfer with
@@ -571,20 +575,36 @@ process_refunds_cb (void *cls,
static void
process_transfer_details (void *cls,
const struct TALER_WireTransferIdentifierRawP *wtid,
+ const char *exchange_url,
+ struct GNUNET_TIME_Absolute execution_time,
const struct TALER_Amount *deposit_value,
const struct TALER_Amount *deposit_fee,
bool transfer_confirmed)
{
struct GetOrderRequestContext *gorc = cls;
json_t *wire_details = gorc->wire_details;
+ struct TALER_Amount wired;
+ GNUNET_assert
+ (0 <= TALER_amount_subtract (&wired,
+ deposit_value,
+ deposit_fee));
GNUNET_assert (0 ==
- json_array_append_new (wire_details,
- json_pack ("{s:s, s:b}",
- "blah",
- "FIXME",
- "confirmed",
- transfer_confirmed)));
+ json_array_append_new (
+ wire_details,
+ json_pack ("{s:o?, s:s, s:o, s:o, s:b}",
+ "wtid",
+ (NULL != wtid)
+ ? GNUNET_JSON_from_data_auto (wtid)
+ : NULL,
+ "exchange_url",
+ exchange_url,
+ "amount",
+ TALER_JSON_from_amount (&wired),
+ "execution_time",
+ GNUNET_JSON_from_time_absolute (execution_time),
+ "confirmed",
+ transfer_confirmed)));
}
diff --git a/src/include/taler_merchantdb_plugin.h
b/src/include/taler_merchantdb_plugin.h
index e508f56..44a316a 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -341,7 +341,11 @@ typedef void
* FIXME: not implemented yet!
*
* @param cls closure
- * @param wtid wire transfer subject of the wire transfer for the coin
+ * @param wtid wire transfer subject of the wire transfer for the coin,
+ * or NULL if transfer is yet to be made
+ * @param exchange_url base URL of the exchange that made the payment
+ * @param execution_time when was the payment made (or in the future,
+ * when is it expected to be made)
* @param deposit_value contribution of the coin to the total wire transfer
value
* @param deposit_fee deposit fee charged by the exchange for the coin
* @param transfer_confirmed did the merchant confirm that a wire transfer with
@@ -351,6 +355,8 @@ typedef void
(*TALER_MERCHANTDB_OrderTransferDetailsCallback)(
void *cls,
const struct TALER_WireTransferIdentifierRawP *wtid,
+ const char *exchange_url,
+ struct GNUNET_TIME_Absolute execution_time,
const struct TALER_Amount *deposit_value,
const struct TALER_Amount *deposit_fee,
bool transfer_confirmed);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-merchant] 168/277: implement GET /reserves/RESERVE_ID, (continued)
- [taler-merchant] 168/277: implement GET /reserves/RESERVE_ID, gnunet, 2020/07/05
- [taler-merchant] 167/277: implement TALER_MERCHANT_reserves_get(), gnunet, 2020/07/05
- [taler-merchant] 173/277: Merge branch 'protocolV1' of git+ssh://git.taler.net/merchant into protocolV1, gnunet, 2020/07/05
- [taler-merchant] 172/277: first high-level hack job at GET /orders/ID -- certainly FTBFS still, gnunet, 2020/07/05
- [taler-merchant] 176/277: cleaned backenddb test code, completed tests for instances & products, gnunet, 2020/07/05
- [taler-merchant] 179/277: Merge branch 'protocolV1' of git+ssh://git.taler.net/merchant into protocolV1, gnunet, 2020/07/05
- [taler-merchant] 185/277: headers and empty source files for GET /private/tips, gnunet, 2020/07/05
- [taler-merchant] 178/277: work on GET /private/orders/ID", gnunet, 2020/07/05
- [taler-merchant] 177/277: wrote method for delete reserve, gnunet, 2020/07/05
- [taler-merchant] 184/277: work on implementing GET /private/orders/ID, gnunet, 2020/07/05
- [taler-merchant] 183/277: work on getting TransactionWireTransfer reply built,
gnunet <=
- [taler-merchant] 180/277: more work on private-get-orders-ID, gnunet, 2020/07/05
- [taler-merchant] 186/277: start to build get-orders-ID, gnunet, 2020/07/05
- [taler-merchant] 181/277: more test cleanup and some lookup_orders filter tests, gnunet, 2020/07/05
- [taler-merchant] 192/277: need #include, gnunet, 2020/07/05
- [taler-merchant] 197/277: remove from waiting list when resuming, gnunet, 2020/07/05
- [taler-merchant] 196/277: do not forget to kick MHD, gnunet, 2020/07/05
- [taler-merchant] 189/277: created lookup_tips method for backenddb, gnunet, 2020/07/05
- [taler-merchant] 194/277: finish FIXMEs in private-get-orders-ID:, gnunet, 2020/07/05
- [taler-merchant] 195/277: remark, gnunet, 2020/07/05
- [taler-merchant] 182/277: More complete tests for deposits, transfers, refund, lookup orders, gnunet, 2020/07/05