[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: uri->url, add tip_t
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: uri->url, add tip_token with pickup_url in /tip-authorize |
Date: |
Thu, 30 Nov 2017 01:52:12 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new eaaebef uri->url, add tip_token with pickup_url in /tip-authorize
eaaebef is described below
commit eaaebef04fb544e271e791545c08168c9302b0a1
Author: Florian Dold <address@hidden>
AuthorDate: Thu Nov 30 01:51:54 2017 +0100
uri->url, add tip_token with pickup_url in /tip-authorize
---
src/backend/taler-merchant-httpd_tip-authorize.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_tip-authorize.c
b/src/backend/taler-merchant-httpd_tip-authorize.c
index bdfd48c..a8b90d4 100644
--- a/src/backend/taler-merchant-httpd_tip-authorize.c
+++ b/src/backend/taler-merchant-httpd_tip-authorize.c
@@ -86,10 +86,12 @@ MH_handler_tip_authorize (struct TMH_RequestHandler *rh,
struct TALER_Amount amount;
const char *instance;
const char *justification;
+ const char *pickup_url;
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_amount ("amount", &amount),
GNUNET_JSON_spec_string ("instance", &instance),
GNUNET_JSON_spec_string ("justification", &justification),
+ GNUNET_JSON_spec_string ("pickup_url", &pickup_url),
GNUNET_JSON_spec_end()
};
json_t *root;
@@ -198,13 +200,23 @@ MH_handler_tip_authorize (struct TMH_RequestHandler *rh,
TALER_EC_TIP_AUTHORIZE_INSUFFICIENT_FUNDS,
"Insufficient funds for tip");
}
+ json_t *tip_token = json_pack ("{s:o, s:o, s:s, s:s}"
+ "tip_id", GNUNET_JSON_from_data_auto
(&tip_id),
+ "expiration", GNUNET_JSON_from_time_abs
(expiration),
+ "exchange_url", mi->tip_exchange,
+ "pickup_url", pickup_url);
+ char *tip_token_str = json_dumps (tip_token, JSON_ENSURE_ASCII |
JSON_COMPACT);
+ json_decref (tip_token);
json_decref (root);
- return TMH_RESPONSE_reply_json_pack (connection,
- MHD_HTTP_OK,
- "{s:o, s:o, s:s}",
- "tip_id", GNUNET_JSON_from_data_auto
(&tip_id),
- "expiration", GNUNET_JSON_from_time_abs
(expiration),
- "exchange_uri", mi->tip_exchange);
+ int ret = TMH_RESPONSE_reply_json_pack (connection,
+ MHD_HTTP_OK,
+ "{s:o, s:o, s:s, s:s}",
+ "tip_id", GNUNET_JSON_from_data_auto
(&tip_id),
+ "expiration",
GNUNET_JSON_from_time_abs (expiration),
+ "exchange_url", mi->tip_exchange,
+ "tip_token", tip_token_str);
+ GNUNET_free (tip_token_str);
+ return ret;
}
/* end of taler-merchant-httpd_tip-authorize.c */
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: uri->url, add tip_token with pickup_url in /tip-authorize,
gnunet <=