Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rspec_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
gemfile: ["stripe_12", "stripe_13"]
gemfile: ["stripe_12", "stripe_13", "stripe_14", "stripe_15"]
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
Expand Down
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
appraise "stripe-15" do
gem "stripe", "15.3.0"
end

appraise "stripe-14" do
gem "stripe", "14.0.0"
end

appraise "stripe-13" do
gem "stripe", "13.4.0"
end
Expand Down
28 changes: 14 additions & 14 deletions gemfiles/stripe_12.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PATH
remote: ..
specs:
stripe-ruby-mock (4.0.0)
stripe-ruby-mock (5.0.0)
dante (>= 0.2.0)
drb (>= 2.0.4, < 3)
multi_json (~> 1.0)
stripe (> 5, < 14)
stripe (> 5, < 16)

GEM
remote: https://rubygems.org/
Expand All @@ -16,32 +16,32 @@ GEM
thor (>= 0.14.0)
daemons (1.4.1)
dante (0.2.0)
diff-lcs (1.6.1)
dotenv (2.8.1)
drb (2.2.1)
diff-lcs (1.6.2)
dotenv (3.1.8)
drb (2.2.3)
eventmachine (1.2.7)
multi_json (1.15.0)
rack (2.2.13)
rake (13.2.1)
rspec (3.13.0)
multi_json (1.17.0)
rack (2.2.20)
rake (13.3.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rspec-support (3.13.6)
stripe (12.6.0)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.3.2)
thor (1.4.0)

PLATFORMS
ruby
Expand Down
28 changes: 14 additions & 14 deletions gemfiles/stripe_13.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PATH
remote: ..
specs:
stripe-ruby-mock (4.0.0)
stripe-ruby-mock (5.0.0)
dante (>= 0.2.0)
drb (>= 2.0.4, < 3)
multi_json (~> 1.0)
stripe (> 5, < 14)
stripe (> 5, < 16)

GEM
remote: https://rubygems.org/
Expand All @@ -16,32 +16,32 @@ GEM
thor (>= 0.14.0)
daemons (1.4.1)
dante (0.2.0)
diff-lcs (1.6.1)
dotenv (2.8.1)
drb (2.2.1)
diff-lcs (1.6.2)
dotenv (3.1.8)
drb (2.2.3)
eventmachine (1.2.7)
multi_json (1.15.0)
rack (2.2.13)
rake (13.2.1)
rspec (3.13.0)
multi_json (1.17.0)
rack (2.2.20)
rake (13.3.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rspec-support (3.13.6)
stripe (13.4.0)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.3.2)
thor (1.4.0)

PLATFORMS
ruby
Expand Down
13 changes: 13 additions & 0 deletions gemfiles/stripe_14.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "stripe", "14.0.0"

group :test do
gem "rake"
gem "dotenv"
end

gemspec path: "../"
60 changes: 60 additions & 0 deletions gemfiles/stripe_14.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
PATH
remote: ..
specs:
stripe-ruby-mock (5.0.0)
dante (>= 0.2.0)
drb (>= 2.0.4, < 3)
multi_json (~> 1.0)
stripe (> 5, < 16)

GEM
remote: https://rubygems.org/
specs:
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
daemons (1.4.1)
dante (0.2.0)
diff-lcs (1.6.2)
dotenv (3.1.8)
drb (2.2.3)
eventmachine (1.2.7)
multi_json (1.17.0)
rack (2.2.20)
rake (13.3.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
stripe (14.0.0)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.4.0)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
appraisal
dotenv
rake
rspec (~> 3.13.0)
stripe (= 14.0.0)
stripe-ruby-mock!
thin (~> 1.8.1)

BUNDLED WITH
2.6.6
13 changes: 13 additions & 0 deletions gemfiles/stripe_15.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "stripe", "15.3.0"

group :test do
gem "rake"
gem "dotenv"
end

gemspec path: "../"
60 changes: 60 additions & 0 deletions gemfiles/stripe_15.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
PATH
remote: ..
specs:
stripe-ruby-mock (5.0.0)
dante (>= 0.2.0)
drb (>= 2.0.4, < 3)
multi_json (~> 1.0)
stripe (> 5, < 16)

GEM
remote: https://rubygems.org/
specs:
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
daemons (1.4.1)
dante (0.2.0)
diff-lcs (1.6.2)
dotenv (3.1.8)
drb (2.2.3)
eventmachine (1.2.7)
multi_json (1.17.0)
rack (2.2.20)
rake (13.3.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
stripe (15.3.0)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.4.0)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
appraisal
dotenv
rake
rspec (~> 3.13.0)
stripe (= 15.3.0)
stripe-ruby-mock!
thin (~> 1.8.1)

BUNDLED WITH
2.6.6
5 changes: 4 additions & 1 deletion spec/shared_stripe_examples/invoice_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@
end
end

context "retrieving upcoming invoice" do
# Note: Invoice.upcoming was removed in Stripe 14.0.0
# https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md#1400---2025-04-01
# Use Invoice.create_preview instead
context "retrieving upcoming invoice", skip: (Gem::Version.new(Stripe::VERSION) >= Gem::Version.new('14.0.0')) do
let(:customer) { Stripe::Customer.create(source: stripe_helper.generate_card_token) }
let(:coupon_amtoff) { stripe_helper.create_coupon(id: '100OFF', currency: 'usd', amount_off: 100_00, duration: 'repeating', duration_in_months: 6) }
let(:coupon_pctoff) { stripe_helper.create_coupon(id: '50OFF', currency: 'usd', percent_off: 50, amount_off: nil, duration: 'repeating', duration_in_months: 6) }
Expand Down
6 changes: 3 additions & 3 deletions spec/shared_stripe_examples/subscription_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
]
)

expect(subscription.current_period_end).to eq (Time.now + (7 * 60 * 60 * 24)).to_i
expect(subscription.current_period_end).to be_within(2).of((Time.now + (7 * 60 * 60 * 24)).to_i)
end

it 'sets current_period_end based on price month interval', live: true do
Expand All @@ -599,7 +599,7 @@
]
)

expect(subscription.current_period_end).to eq (DateTime.now >> 1).to_time.to_i
expect(subscription.current_period_end).to be_within(2).of((DateTime.now >> 1).to_time.to_i)
end

it 'sets current_period_end based on price year interval', live: true do
Expand All @@ -612,7 +612,7 @@
]
)

expect(subscription.current_period_end).to eq (DateTime.now >> 12).to_time.to_i
expect(subscription.current_period_end).to be_within(2).of((DateTime.now >> 12).to_time.to_i)
end

it 'add a new subscription to bill via an invoice' do
Expand Down
2 changes: 1 addition & 1 deletion stripe-ruby-mock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib']

gem.add_dependency 'stripe', '> 5', '< 14'
gem.add_dependency 'stripe', '> 5', '< 16'
gem.add_dependency 'multi_json', '~> 1.0'
gem.add_dependency 'dante', '>= 0.2.0'
gem.add_dependency 'drb', '>= 2.0.4', '< 3'
Expand Down