Skip to content

Commit

Permalink
Update listPayments options
Browse files Browse the repository at this point in the history
Update the list for filter users as for v4 API documentation.
https://docs.hyperwallet.com/content/api/v4/resources/payments/list
  • Loading branch information
maxe2y committed Nov 17, 2020
1 parent b7dddff commit 01748c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Hyperwallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ export default class Hyperwallet {
* @throws Will throw an error if invalid payment is provided
*/
listPayments(options, callback) {
const LIST_PAYMENT_FILTERS = ["clientPaymentId"];
const LIST_PAYMENT_FILTERS = ["createdAfter", "createdBefore", "clientPaymentId", "limit", "releaseDate", "sortBy"];
if (options && !this.isValidFilter(options, LIST_PAYMENT_FILTERS)) {
throw new Error("Invalid Filter. Expected - ".concat(LIST_PAYMENT_FILTERS));
}
Expand Down
2 changes: 1 addition & 1 deletion test/Hyperwallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3393,7 +3393,7 @@ describe("Hyperwallet", () => {
/** @test {Hyperwallet#listPayments} */
it("should throw error for invalid filter", () => {
const callback = () => null;
expect(() => client.listPayments({ test: "value" }, callback)).to.throw("Invalid Filter. Expected - clientPaymentId");
expect(() => client.listPayments({ test: "value" }, callback)).to.throw("Invalid Filter. Expected - createdAfter,createdBefore,clientPaymentId,limit,releaseDate,sortBy");
});

/** @test {Hyperwallet#listPayments} */
Expand Down

0 comments on commit 01748c5

Please sign in to comment.