diff options
Diffstat (limited to 'src/lib/merchant_api_get_reserve.c')
-rw-r--r-- | src/lib/merchant_api_get_reserve.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/merchant_api_get_reserve.c b/src/lib/merchant_api_get_reserve.c index b1c32cef..355008b0 100644 --- a/src/lib/merchant_api_get_reserve.c +++ b/src/lib/merchant_api_get_reserve.c @@ -96,7 +96,7 @@ handle_reserve_get_finished (void *cls, { struct TALER_MERCHANT_ReserveSummary *rs = &rgr.details.ok.rs; - const json_t *tips = NULL; + const json_t *rewards = NULL; const json_t *accounts = NULL; unsigned int accounts_len; struct GNUNET_JSON_Specification spec[] = { @@ -107,8 +107,8 @@ handle_reserve_get_finished (void *cls, GNUNET_JSON_spec_bool ("active", &rgr.details.ok.active), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_array_const ("tips", - &tips), + GNUNET_JSON_spec_array_const ("rewards", + &rewards), NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_array_const ("accounts", @@ -134,7 +134,7 @@ handle_reserve_get_finished (void *cls, GNUNET_JSON_spec_end () }; struct TALER_EXCHANGE_WireAccount *was = NULL; - struct TALER_MERCHANT_TipDetails *tds = NULL; + struct TALER_MERCHANT_RewardDetails *tds = NULL; if (GNUNET_OK != GNUNET_JSON_parse (json, @@ -169,20 +169,20 @@ handle_reserve_get_finished (void *cls, } } /* end 'have accounts' */ - if (NULL != tips) + if (NULL != rewards) { - size_t tds_length = json_array_size (tips); + size_t tds_length = json_array_size (rewards); bool ok = true; - json_t *tip; + json_t *reward; unsigned int i; tds = GNUNET_new_array (tds_length, - struct TALER_MERCHANT_TipDetails); - json_array_foreach (tips, i, tip) { - struct TALER_MERCHANT_TipDetails *td = &tds[i]; + struct TALER_MERCHANT_RewardDetails); + json_array_foreach (rewards, i, reward) { + struct TALER_MERCHANT_RewardDetails *td = &tds[i]; struct GNUNET_JSON_Specification ispec[] = { - GNUNET_JSON_spec_fixed_auto ("tip_id", - &td->tip_id), + GNUNET_JSON_spec_fixed_auto ("reward_id", + &td->reward_id), TALER_JSON_spec_amount_any ("total_amount", &td->amount), GNUNET_JSON_spec_string ("reason", @@ -191,7 +191,7 @@ handle_reserve_get_finished (void *cls, }; if (GNUNET_OK != - GNUNET_JSON_parse (tip, + GNUNET_JSON_parse (reward, ispec, NULL, NULL)) { @@ -208,10 +208,10 @@ handle_reserve_get_finished (void *cls, } else { - rgr.details.ok.tips = tds; - rgr.details.ok.tips_length = tds_length; + rgr.details.ok.rewards = tds; + rgr.details.ok.rewards_length = tds_length; } - } /* end 'have tips' */ + } /* end 'have rewards' */ rgh->cb (rgh->cb_cls, &rgr); @@ -258,7 +258,7 @@ struct TALER_MERCHANT_ReserveGetHandle * TALER_MERCHANT_reserve_get (struct GNUNET_CURL_Context *ctx, const char *backend_url, const struct TALER_ReservePublicKeyP *reserve_pub, - bool fetch_tips, + bool fetch_rewards, TALER_MERCHANT_ReserveGetCallback cb, void *cb_cls) { @@ -285,8 +285,8 @@ TALER_MERCHANT_reserve_get (struct GNUNET_CURL_Context *ctx, res_str); rgh->url = TALER_url_join (backend_url, arg_str, - "tips", - fetch_tips ? "yes" : "no", + "rewards", + fetch_rewards ? "yes" : "no", NULL); } if (NULL == rgh->url) |