summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_tip_authorize.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-30 13:45:00 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-30 13:45:00 +0200
commit5eab12fc24c3c4d1ef3879665ef3a87ba0d3f340 (patch)
tree97c803856f05b4af15da870f677d694226ed535c /src/lib/merchant_api_tip_authorize.c
parent2a2a99d6e5463fe5a49fdd967caf36678df9d2e1 (diff)
downloadmerchant-5eab12fc24c3c4d1ef3879665ef3a87ba0d3f340.tar.gz
merchant-5eab12fc24c3c4d1ef3879665ef3a87ba0d3f340.tar.bz2
merchant-5eab12fc24c3c4d1ef3879665ef3a87ba0d3f340.zip
mobile-friendly tipping
Diffstat (limited to 'src/lib/merchant_api_tip_authorize.c')
-rw-r--r--src/lib/merchant_api_tip_authorize.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/merchant_api_tip_authorize.c b/src/lib/merchant_api_tip_authorize.c
index 88b499f9..d77041c7 100644
--- a/src/lib/merchant_api_tip_authorize.c
+++ b/src/lib/merchant_api_tip_authorize.c
@@ -83,13 +83,11 @@ static int
check_ok (struct TALER_MERCHANT_TipAuthorizeOperation *tao,
const json_t *json)
{
+ const char *taler_tip_uri;
struct GNUNET_HashCode tip_id;
- struct GNUNET_TIME_Absolute tip_expiration;
- const char *exchange_url;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_absolute_time ("expiration", &tip_expiration),
+ GNUNET_JSON_spec_string ("taler_tip_uri", &taler_tip_uri),
GNUNET_JSON_spec_fixed_auto ("tip_id", &tip_id),
- GNUNET_JSON_spec_string ("exchange_url", &exchange_url),
GNUNET_JSON_spec_end()
};
@@ -99,14 +97,14 @@ check_ok (struct TALER_MERCHANT_TipAuthorizeOperation *tao,
NULL, NULL))
{
GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "JSON %s\n", json_dumps (json, 0));
return GNUNET_SYSERR;
}
tao->cb (tao->cb_cls,
MHD_HTTP_OK,
TALER_JSON_get_error_code (json),
- &tip_id,
- tip_expiration,
- exchange_url);
+ taler_tip_uri,
+ &tip_id);
tao->cb = NULL; /* do not call twice */
GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
@@ -163,9 +161,7 @@ handle_tip_authorize_finished (void *cls,
tao->cb (tao->cb_cls,
response_code,
TALER_JSON_get_error_code (json),
- NULL,
- GNUNET_TIME_UNIT_ZERO_ABS,
- NULL);
+ NULL, NULL);
TALER_MERCHANT_tip_authorize_cancel (tao);
}