Skip to content

Commit

Permalink
Merge 01748c5 into ca90e35
Browse files Browse the repository at this point in the history
  • Loading branch information
maxe2y authored Nov 17, 2020
2 parents ca90e35 + 01748c5 commit e765784
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Hyperwallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class Hyperwallet {
* @param {api-callback} callback - The callback for this call
*/
listUsers(options, callback) {
const LIST_USER_FILTERS = ["clientUserId", "email", "programToken", "status", "verificationStatus"];
const LIST_USER_FILTERS = ["clientUserId", "createdAfter", "createdBefore", "email", "limit", "programToken", "sortBy", "status", "verificationStatus"];
if (options && !this.isValidFilter(options, LIST_USER_FILTERS)) {
throw new Error("Invalid Filter. Expected - ".concat(LIST_USER_FILTERS));
}
Expand Down 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
7 changes: 5 additions & 2 deletions test/Hyperwallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ describe("Hyperwallet", () => {
/** @test {Hyperwallet#listUsers} */
it("should throw error for invalid filter", () => {
const callback = () => null;
expect(() => client.listUsers({ test1: "value" }, callback)).to.throw("Invalid Filter. Expected - clientUserId,email,programToken,status,verificationStatus");
expect(() => client.listUsers({ test1: "value" }, callback))
.to.throw(
"Invalid Filter. Expected - clientUserId,createdAfter,createdBefore,email,limit,programToken,sortBy,status,verificationStatus"
);
});
/** @test {Hyperwallet#listUsers} */
it("should do get call without options", () => {
Expand Down Expand Up @@ -3390,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 e765784

Please sign in to comment.