Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
Fix bug in earliest_first query parameter for Payment History API
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Cohen committed Apr 15, 2015
1 parent 85ea348 commit b68fa0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions api/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ function getAccountPayments(account, source_account, destination_account,
destination_account: destination_account,
direction: direction,
min: options.results_per_page,
max: options.results_par_page,
max: options.results_per_page,
offset: (options.results_per_page || DEFAULT_RESULTS_PER_PAGE)
* ((options.page || 1) - 1),
types: ['payment']
types: ['payment'],
earliestFirst: options.earliest_first
};

transactions.getAccountTransactions(self,
Expand Down
3 changes: 2 additions & 1 deletion server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ function getAccountPayments(request, callback) {
ledger_index_max: request.query.end_ledger,
earliest_first: request.query.earliest_first === 'true',
exclude_failed: request.query.exclude_failed === 'true',
results_per_page: request.query.results_per_page,
results_per_page: Number(request.query.results_per_page),
page: request.query.page
};
api.getAccountPayments(account, source_account, destination_account,
direction, options, callback);
}


function getPayment(request, callback) {
var account = request.params.account;
var identifier = request.params.identifier;
Expand Down

0 comments on commit b68fa0a

Please sign in to comment.