diff options
Diffstat (limited to 'src/bank-lib/bank_api_credit.c')
-rw-r--r-- | src/bank-lib/bank_api_credit.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c index ed0a1e2a7..4bb6e7cb2 100644 --- a/src/bank-lib/bank_api_credit.c +++ b/src/bank-lib/bank_api_credit.c @@ -17,8 +17,8 @@ see <http://www.gnu.org/licenses/> */ /** - * @file bank-lib/bank_api_history.c - * @brief Implementation of the /history[-range] + * @file bank-lib/bank_api_credit.c + * @brief Implementation of the /history/incoming * requests of the bank's HTTP API. * @author Christian Grothoff * @author Marcello Stanisci @@ -78,7 +78,7 @@ parse_account_history (struct TALER_BANK_CreditHistoryHandle *hh, json_t *history_array; if (NULL == (history_array = json_object_get (history, - "data"))) + "incoming_transactions"))) { GNUNET_break_op (0); return GNUNET_SYSERR; @@ -101,8 +101,10 @@ parse_account_history (struct TALER_BANK_CreditHistoryHandle *hh, &row_id), GNUNET_JSON_spec_fixed_auto ("reserve_pub", &td.reserve_pub), - GNUNET_JSON_spec_string ("counterpart", - &td.account_url), + GNUNET_JSON_spec_string ("debit_account", + &td.debit_account_url), + GNUNET_JSON_spec_string ("credit_account", + &td.credit_account_url), GNUNET_JSON_spec_end () }; json_t *transaction = json_array_get (history_array, @@ -250,13 +252,16 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, return NULL; } - if (UINT64_MAX == start_row) + if ( ( (UINT64_MAX == start_row) && + (0 > num_results) ) || + ( (0 == start_row) && + (0 < num_results) ) ) GNUNET_asprintf (&url, - "/history&delta=%lld", + "/history/incoming?delta=%lld", (long long) num_results); else GNUNET_asprintf (&url, - "/history&delta=%lld&start=%llu", + "/history/incoming?delta=%lld&start=%llu", (long long) num_results, start_row); hh = GNUNET_new (struct TALER_BANK_CreditHistoryHandle); @@ -265,7 +270,9 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx, hh->bank_base_url = GNUNET_strdup (bank_base_url); hh->request_url = TALER_BANK_path_to_url_ (bank_base_url, url); - + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Requesting history at `%s'\n", + hh->request_url); eh = curl_easy_init (); if ( (GNUNET_OK != TALER_BANK_setup_auth_ (eh, |