From 5dea2c74a16191d269c8fc7beead55c2683c887a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 27 May 2021 12:14:05 +0200 Subject: implement specification update #6891: return exchange_url and payto_uri as part of GET reserve/ID response --- src/backend/taler-merchant-httpd_private-get-reserves-ID.c | 10 ++++++++-- src/backend/taler-merchant-httpd_private-post-reserves.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/backend') diff --git a/src/backend/taler-merchant-httpd_private-get-reserves-ID.c b/src/backend/taler-merchant-httpd_private-get-reserves-ID.c index 35d3707d..bb4da531 100644 --- a/src/backend/taler-merchant-httpd_private-get-reserves-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-reserves-ID.c @@ -63,6 +63,8 @@ struct GetReserveContext * @param committed_amount total of tips that the merchant committed to, but that were not * picked up yet * @param active true if the reserve is still active (we have the private key) + * @param exchange_url URL of the exchange, NULL if not active + * @param payto_uri payto:// URI to fill the reserve, NULL if not active or already paid * @param tips_length length of the @a tips array * @param tips information about the tips created by this reserve */ @@ -75,6 +77,8 @@ handle_reserve_details (void *cls, const struct TALER_Amount *picked_up_amount, const struct TALER_Amount *committed_amount, bool active, + const char *exchange_url, + const char *payto_uri, unsigned int tips_length, const struct TALER_MERCHANTDB_TipDetails *tips) { @@ -114,7 +118,7 @@ handle_reserve_details (void *cls, ctx->res = TALER_MHD_reply_json_pack ( ctx->connection, MHD_HTTP_OK, - "{s:o, s:o, s:o, s:o, s:o, s:o, s:o?, s:b}", + "{s:o, s:o, s:o, s:o, s:o, s:o, s:o?, s:b, s:s?, s:s?}", "creation_time", GNUNET_JSON_from_time_abs (creation_time_round), "expiration_time", GNUNET_JSON_from_time_abs (expiration_time_round), "merchant_initial_amount", TALER_JSON_from_amount (merchant_initial_amount), @@ -122,7 +126,9 @@ handle_reserve_details (void *cls, "pickup_amount", TALER_JSON_from_amount (picked_up_amount), "committed_amount", TALER_JSON_from_amount (committed_amount), "tips", tips_json, - "active", active); + "active", active, + "exchange_url", exchange_url, + "payto_uri", payto_uri); } diff --git a/src/backend/taler-merchant-httpd_private-post-reserves.c b/src/backend/taler-merchant-httpd_private-post-reserves.c index b2cc14c6..f4f10973 100644 --- a/src/backend/taler-merchant-httpd_private-post-reserves.c +++ b/src/backend/taler-merchant-httpd_private-post-reserves.c @@ -373,6 +373,7 @@ TMH_private_post_reserves (const struct TMH_RequestHandler *rh, &reserve_priv, &reserve_pub, rc->exchange_url, + rc->payto_uri, &rc->initial_balance, rc->reserve_expiration); GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR != qs); -- cgit v1.2.3