summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-orders-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-06-06 21:40:49 +0200
committerChristian Grothoff <christian@grothoff.org>2020-06-06 21:40:49 +0200
commitfbd93498c3a1135986470c869a9db1a75b8886c4 (patch)
tree26ffc49bd609197c55c29b9e5d49925144c238ba /src/backend/taler-merchant-httpd_private-get-orders-ID.c
parentab6ee1680d16905ef938380e49c86710fb5c7155 (diff)
downloadmerchant-fbd93498c3a1135986470c869a9db1a75b8886c4.tar.gz
merchant-fbd93498c3a1135986470c869a9db1a75b8886c4.tar.bz2
merchant-fbd93498c3a1135986470c869a9db1a75b8886c4.zip
work on getting TransactionWireTransfer reply built
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-orders-ID.c34
1 files changed, 27 insertions, 7 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 d4d26608..e82a1219 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)));
}