summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-get-reserves-ID.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-05-27 12:14:05 +0200
committerChristian Grothoff <christian@grothoff.org>2021-05-27 12:14:05 +0200
commit5dea2c74a16191d269c8fc7beead55c2683c887a (patch)
treed262c3ea641a342439b9532606c1424c6f17339e /src/backend/taler-merchant-httpd_private-get-reserves-ID.c
parent72e50cb45e9b3df912fa542c6e6bcccf51a59838 (diff)
downloadmerchant-5dea2c74a16191d269c8fc7beead55c2683c887a.tar.gz
merchant-5dea2c74a16191d269c8fc7beead55c2683c887a.tar.bz2
merchant-5dea2c74a16191d269c8fc7beead55c2683c887a.zip
implement specification update #6891: return exchange_url and payto_uri as part of GET reserve/ID response
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-reserves-ID.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-get-reserves-ID.c10
1 files changed, 8 insertions, 2 deletions
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);
}