gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]