Skip to content

Commit

Permalink
Add query parameters to find account
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachooc5 committed Jan 18, 2024
1 parent 0dacf85 commit 5147fc8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@

# Ignore private http client environment variables
/doc/modulr_requests/http-client.private.env.json

# Ignore IDEs files
.idea
*.iml
out
10 changes: 8 additions & 2 deletions lib/modulr/api/accounts_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
module Modulr
module API
class AccountsService < Service
def find(id:)
response = client.get("/accounts/#{id}")
def find(id:, **opts)
query_parameters = {}
query_parameters[:statuses] = opts[:statuses] if opts[:statuses]
if opts[:include_pending_transactions]
query_parameters[:includePendingTransactions] = opts[:include_pending_transactions]
end

response = client.get("/accounts/#{id}", query_parameters)
attributes = response.body

Resources::Accounts::Account.new(
Expand Down

0 comments on commit 5147fc8

Please sign in to comment.