diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b47da5..2cda0e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.4.14 + +- Fixed query params of Amazon Finances API v2024-06-19 [#98](https://github.com/patterninc/muffin_man/pull/98) +- [#99](https://github.com/patterninc/muffin_man/pull/99) + # 2.4.13 - Remove AWS STS Signature in requests [#97](https://github.com/patterninc/muffin_man/pull/97) diff --git a/README.md b/README.md index bf55989..be33b7d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ As of now, this gem only supports portions of the following APIs with more to co - `Uploads API v2020-11-01` - `A+ API v2020-11-01` - `Application Management API v2023-11-30` +- `Finances API v2024-06-19` ## Installation diff --git a/lib/muffin_man/version.rb b/lib/muffin_man/version.rb index c77d9b2..3aa95d2 100644 --- a/lib/muffin_man/version.rb +++ b/lib/muffin_man/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module MuffinMan - VERSION = "2.4.13" + VERSION = "2.4.14" end diff --git a/spec/muffin_man/finances/v20240619_spec.rb b/spec/muffin_man/finances/v20240619_spec.rb index 03d01c4..3fa22f2 100644 --- a/spec/muffin_man/finances/v20240619_spec.rb +++ b/spec/muffin_man/finances/v20240619_spec.rb @@ -4,6 +4,7 @@ subject(:client) { described_class.new(credentials) } let(:posted_after) { "2024-11-07T00:00:00Z" } + let(:posted_before) { "2024-11-08T00:00:00Z" } before do stub_request_access_token @@ -11,11 +12,11 @@ describe "list_transactions" do before do - stub_list_financial_transactions(posted_after: posted_after) + stub_list_financial_transactions(posted_after: posted_after, posted_before: posted_before) end it "lists transactions" do - response = client.list_transactions(posted_after: posted_after) + response = client.list_transactions(posted_after: posted_after, posted_before: posted_before) expect(response.success?).to be true expect(JSON.parse(response.body)["payload"]["transactions"]).to be_an(Array) end diff --git a/spec/support/finances/stub_finances.rb b/spec/support/finances/stub_finances.rb index 90dfd1e..937fef3 100644 --- a/spec/support/finances/stub_finances.rb +++ b/spec/support/finances/stub_finances.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true -def stub_list_financial_transactions(posted_after:) - stub_request(:get, "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}") +def stub_list_financial_transactions(posted_after:, posted_before: nil) + url = "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}" + url += "&postedBefore=#{posted_before}" if posted_before + stub_request(:get, url) .to_return(status: 200, body: File.read("./spec/support/finances/list_transactions.json"), headers: {}) end