stripe_event 2.3.2 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e8bf3dc8abec723bb2c3278c725f754bbe7cd991f868a8854ff04bac7bc778f
4
- data.tar.gz: 46b48dae96008e8e9f27c8d7e39aa5a022614d322f2a60845b249dd862cec82b
3
+ metadata.gz: 04e746d341ec9847d041e56d9abfae58b7c76338f932050ea512f64e1ae56f7d
4
+ data.tar.gz: 7fa48ffb9b7bce0057ffa5234baebfa9bf5b5971936258f74a31bb4455d46b7b
5
5
  SHA512:
6
- metadata.gz: 56defdead871efd3c089a19db8382ded54786d7c899a39b6245e4b6c69e3a0a8379e792794aeb7bdbc9615f82ce107a528ea8953ac6c9a8d86c8ccd27a0e80a4
7
- data.tar.gz: a91a63ef969c4e7cebac2ce7c083923a6d74cd3cfc166ea914c0956a3108edfc7591be179b44aa8fd10ce43dd8a4ec57119545f745f6a910f492b7c9ffcc98eb
6
+ metadata.gz: 353db17485cfcbb510965c1980b34c94b17ee43524d55b4cc7d0a02aebf5b6fef04629313f2ea9d09e5b28daa9f79d34328504cdc544c99fe1aba9f574193a21
7
+ data.tar.gz: fd6ac00dcff8aa8d15732288f4916bbe1d3a9093f0e674684bf1bdce4f3e6ec5256691d8beb8039bb7844386ba823f368bd68122052f0efbd2f8d86026249d3c
@@ -1,25 +1,39 @@
1
1
  name: CI
2
- on: [push, pull_request]
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
3
7
 
4
8
  jobs:
5
9
  test:
6
10
  runs-on: ubuntu-latest
7
11
  strategy:
8
12
  matrix:
9
- ruby: ["2.5", "2.6", "2.7"]
13
+ ruby: ["2.7", "3.0", "3.1"]
10
14
  bundler: [default]
11
15
  gemfile:
12
- - rails5.1
13
- - rails5.2
14
16
  - rails6.0
15
17
  - rails6.1
16
- - stripe3
17
- - stripe4
18
+ - rails7.0
18
19
  - stripe5
20
+ - stripe6
21
+ - stripe7
19
22
  include:
20
23
  - { ruby: "2.3", gemfile: "rails3.2", bundler: "1" }
21
24
  - { ruby: "2.3", gemfile: "rails4.2", bundler: "1" }
22
25
  - { ruby: "2.4", gemfile: "rails4.2", bundler: "1" }
26
+ - { ruby: "2.5", gemfile: "rails5.1", bundler: "default" }
27
+ - { ruby: "2.5", gemfile: "rails5.2", bundler: "default" }
28
+ - { ruby: "2.6", gemfile: "rails5.2", bundler: "default" }
29
+ - { ruby: "2.6", gemfile: "rails6.0", bundler: "default" }
30
+ - { ruby: "2.6", gemfile: "rails6.1", bundler: "default" }
31
+ - { ruby: "2.5", gemfile: "stripe3", bundler: "default" }
32
+ - { ruby: "2.6", gemfile: "stripe3", bundler: "default" }
33
+ - { ruby: "2.7", gemfile: "stripe3", bundler: "default" }
34
+ - { ruby: "2.5", gemfile: "stripe4", bundler: "default" }
35
+ - { ruby: "2.6", gemfile: "stripe4", bundler: "default" }
36
+ - { ruby: "2.7", gemfile: "stripe4", bundler: "default" }
23
37
 
24
38
  env:
25
39
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
data/Appraisals CHANGED
@@ -23,6 +23,10 @@ appraise "rails6.1" do
23
23
  gem "rails", "~> 6.1.0"
24
24
  end
25
25
 
26
+ appraise "rails7.0" do
27
+ gem "rails", "~> 7.0.0"
28
+ end
29
+
26
30
  appraise "stripe3" do
27
31
  gem "stripe", "~> 3.0"
28
32
  end
@@ -35,6 +39,14 @@ appraise "stripe5" do
35
39
  gem "stripe", "~> 5.0"
36
40
  end
37
41
 
42
+ appraise "stripe6" do
43
+ gem "stripe", "~> 6.0"
44
+ end
45
+
46
+ appraise "stripe7" do
47
+ gem "stripe", "~> 7.0"
48
+ end
49
+
38
50
  appraise "rails_master" do
39
51
  gem "rails", github: "rails"
40
52
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### [Unreleased] - TBD
2
+
3
+ ### 2.6.0 (Aug 8, 2022)
4
+
5
+ - Introduce StripeEvent::ProcessError and possible HTTP 422 responses (#155, #132)
6
+
7
+ ### 2.5.0 (Aug 5, 2022)
8
+
9
+ - Add Stripe 7 support (#154)
10
+
11
+ ### 2.4.0 (May 12, 2022)
12
+
13
+ - Add Stripe 6 support (#151)
14
+ - Add Rails 7 support (#151)
15
+ - Add Ruby 3.1 support (#152)
16
+ - Improved build matrix
17
+
1
18
  ### 2.3.2 (February 21, 2022)
2
19
 
3
20
  - Fix signature validation error if the first signing secret is nil (#146)
@@ -10,6 +10,8 @@ module StripeEvent
10
10
  rescue Stripe::SignatureVerificationError => e
11
11
  log_error(e)
12
12
  head :bad_request
13
+ rescue StripeEvent::ProcessError
14
+ head :unprocessable_entity
13
15
  end
14
16
 
15
17
  private
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.0.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "stripe", "~> 6.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "stripe", "~> 7.0"
6
+
7
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module StripeEvent
2
- VERSION = "2.3.2"
2
+ VERSION = "2.6.0"
3
3
  end
data/lib/stripe_event.rb CHANGED
@@ -66,6 +66,7 @@ module StripeEvent
66
66
 
67
67
  class Error < StandardError; end
68
68
  class UnauthorizedError < Error; end
69
+ class ProcessError < Error; end
69
70
 
70
71
  self.adapter = NotificationAdapter
71
72
  self.backend = ActiveSupport::Notifications
@@ -146,4 +146,14 @@ describe StripeEvent::WebhookController, type: :controller do
146
146
  expect(response.code).to eq '200'
147
147
  end
148
148
  end
149
+
150
+ context "raising an error when things go bad and stripe should retry" do
151
+ before(:each) { StripeEvent.signing_secrets = [secret1] }
152
+
153
+ it "responds with 4xx" do
154
+ allow(StripeEvent).to receive(:instrument) { raise StripeEvent::ProcessError, "retry please" }
155
+ webhook_with_signature charge_succeeded, secret1
156
+ expect(response.code).to eq '422'
157
+ end
158
+ end
149
159
  end
data/stripe_event.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- Appraisals {spec,gemfiles}/*`.split("\n")
19
19
 
20
20
  s.add_dependency "activesupport", ">= 3.1"
21
- s.add_dependency "stripe", [">= 2.8", "< 6"]
21
+ s.add_dependency "stripe", [">= 2.8", "< 8"]
22
22
 
23
23
  s.add_development_dependency "appraisal"
24
24
  s.add_development_dependency "coveralls"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Whalen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '2.8'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '6'
36
+ version: '8'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.8'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '6'
46
+ version: '8'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: appraisal
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -152,10 +152,13 @@ files:
152
152
  - gemfiles/rails5.2.gemfile
153
153
  - gemfiles/rails6.0.gemfile
154
154
  - gemfiles/rails6.1.gemfile
155
+ - gemfiles/rails7.0.gemfile
155
156
  - gemfiles/rails_master.gemfile
156
157
  - gemfiles/stripe3.gemfile
157
158
  - gemfiles/stripe4.gemfile
158
159
  - gemfiles/stripe5.gemfile
160
+ - gemfiles/stripe6.gemfile
161
+ - gemfiles/stripe7.gemfile
159
162
  - lib/stripe_event.rb
160
163
  - lib/stripe_event/engine.rb
161
164
  - lib/stripe_event/version.rb
@@ -201,7 +204,7 @@ homepage: https://github.com/integrallis/stripe_event
201
204
  licenses:
202
205
  - MIT
203
206
  metadata: {}
204
- post_install_message:
207
+ post_install_message:
205
208
  rdoc_options: []
206
209
  require_paths:
207
210
  - lib
@@ -216,8 +219,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
219
  - !ruby/object:Gem::Version
217
220
  version: '0'
218
221
  requirements: []
219
- rubygems_version: 3.3.7
220
- signing_key:
222
+ rubygems_version: 3.3.17
223
+ signing_key:
221
224
  specification_version: 4
222
225
  summary: Stripe webhook integration for Rails applications.
223
226
  test_files:
@@ -228,10 +231,13 @@ test_files:
228
231
  - gemfiles/rails5.2.gemfile
229
232
  - gemfiles/rails6.0.gemfile
230
233
  - gemfiles/rails6.1.gemfile
234
+ - gemfiles/rails7.0.gemfile
231
235
  - gemfiles/rails_master.gemfile
232
236
  - gemfiles/stripe3.gemfile
233
237
  - gemfiles/stripe4.gemfile
234
238
  - gemfiles/stripe5.gemfile
239
+ - gemfiles/stripe6.gemfile
240
+ - gemfiles/stripe7.gemfile
235
241
  - spec/controllers/webhook_controller_spec.rb
236
242
  - spec/dummy/README.rdoc
237
243
  - spec/dummy/Rakefile