Skip to content

Commit 8b5753f

Browse files
Merge pull request #99 from patterninc/DIST-20437_Amzn-Financial-Transactions-Correct-Query-Parameters-for-amazon-sp-api
[DIST-20437] Version change for muffin_man
2 parents d46f0ae + 490465c commit 8b5753f

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.4.14
2+
3+
- Fixed query params of Amazon Finances API v2024-06-19 [#98](https://github.com/patterninc/muffin_man/pull/98)
4+
- [#99](https://github.com/patterninc/muffin_man/pull/99)
5+
16
# 2.4.13
27

38
- Remove AWS STS Signature in requests [#97](https://github.com/patterninc/muffin_man/pull/97)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ As of now, this gem only supports portions of the following APIs with more to co
3939
- `Uploads API v2020-11-01`
4040
- `A+ API v2020-11-01`
4141
- `Application Management API v2023-11-30`
42+
- `Finances API v2024-06-19`
4243

4344
## Installation
4445

lib/muffin_man/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module MuffinMan
4-
VERSION = "2.4.13"
4+
VERSION = "2.4.14"
55
end

spec/muffin_man/finances/v20240619_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
subject(:client) { described_class.new(credentials) }
55

66
let(:posted_after) { "2024-11-07T00:00:00Z" }
7+
let(:posted_before) { "2024-11-08T00:00:00Z" }
78

89
before do
910
stub_request_access_token
1011
end
1112

1213
describe "list_transactions" do
1314
before do
14-
stub_list_financial_transactions(posted_after: posted_after)
15+
stub_list_financial_transactions(posted_after: posted_after, posted_before: posted_before)
1516
end
1617

1718
it "lists transactions" do
18-
response = client.list_transactions(posted_after: posted_after)
19+
response = client.list_transactions(posted_after: posted_after, posted_before: posted_before)
1920
expect(response.success?).to be true
2021
expect(JSON.parse(response.body)["payload"]["transactions"]).to be_an(Array)
2122
end
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

3-
def stub_list_financial_transactions(posted_after:)
4-
stub_request(:get, "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}")
3+
def stub_list_financial_transactions(posted_after:, posted_before: nil)
4+
url = "https://#{hostname}/finances/2024-06-19/transactions?postedAfter=#{posted_after}"
5+
url += "&postedBefore=#{posted_before}" if posted_before
6+
stub_request(:get, url)
57
.to_return(status: 200, body: File.read("./spec/support/finances/list_transactions.json"), headers: {})
68
end

0 commit comments

Comments
 (0)