stripe_event 2.5.0 → 2.7.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: ae20c29ad3c38d0945388b8c226af15b9cb28bcbec7414d8fedca5423e057d9e
4
- data.tar.gz: e3a6349f95012362bdadfe41293fc54985dec55e56ce41f85dbf5835ee81e53c
3
+ metadata.gz: 64c5f6e4239a90d34cb72407c4b2c0d7ea80c001a31a9143f4d0754c66747f25
4
+ data.tar.gz: 902c6aca86d1799848141aef273680af270c56c911b3f7495a3fc1d9b4eb4763
5
5
  SHA512:
6
- metadata.gz: b33395b3e590834f7f6967abaa45ddb9d05eb866353b849a09f57d7fc17c2529511ffafceba9e5adbadde8c1b3777193d73e2419356e28bdd7e05ffa8c4395e2
7
- data.tar.gz: 71bde2aa10035e1e339685ec8af7129330faead28680a10d0b16f7b423a5be7046d90343e0b44ea08a5420c9e8a89d9a407b5e67f29af00cf00cf255e67467f1
6
+ metadata.gz: 53604dcdd0958e632262b8abbad9f1329801243e3c7b4690b8c1bab82b8c40f7fceb72276c6536b4f583b78d22a2aa6418820a8b5ecc3472db7c15fbe54c6fd6
7
+ data.tar.gz: 6f01ae6b159b4f62c81000375ed10916d4470132a9818f2bd8e95964cd10272a57fa9d5a417713c1bba5e1b43727ae1703da16cd0b7aaca24960123241cefc96
@@ -19,6 +19,7 @@ jobs:
19
19
  - stripe5
20
20
  - stripe6
21
21
  - stripe7
22
+ - stripe8
22
23
  include:
23
24
  - { ruby: "2.3", gemfile: "rails3.2", bundler: "1" }
24
25
  - { ruby: "2.3", gemfile: "rails4.2", bundler: "1" }
data/Appraisals CHANGED
@@ -47,6 +47,10 @@ appraise "stripe7" do
47
47
  gem "stripe", "~> 7.0"
48
48
  end
49
49
 
50
+ appraise "stripe8" do
51
+ gem "stripe", "~> 8.0"
52
+ end
53
+
50
54
  appraise "rails_master" do
51
55
  gem "rails", github: "rails"
52
56
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ### [Unreleased] - TBD
2
2
 
3
+ ### 2.7.0 (Nov 27, 2022)
4
+
5
+ - Add Stripe 8 support (#159)
6
+
7
+ ### 2.6.0 (Aug 8, 2022)
8
+
9
+ - Introduce StripeEvent::ProcessError and possible HTTP 422 responses (#155, #132)
10
+
3
11
  ### 2.5.0 (Aug 5, 2022)
4
12
 
5
13
  - Add Stripe 7 support (#154)
@@ -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 "stripe", "~> 8.0"
6
+
7
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module StripeEvent
2
- VERSION = "2.5.0"
2
+ VERSION = "2.7.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", "< 8"]
21
+ s.add_dependency "stripe", [">= 2.8", "< 9"]
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.5.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Whalen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-05 00:00:00.000000000 Z
11
+ date: 2022-11-28 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: '8'
36
+ version: '9'
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: '8'
46
+ version: '9'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: appraisal
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +159,7 @@ files:
159
159
  - gemfiles/stripe5.gemfile
160
160
  - gemfiles/stripe6.gemfile
161
161
  - gemfiles/stripe7.gemfile
162
+ - gemfiles/stripe8.gemfile
162
163
  - lib/stripe_event.rb
163
164
  - lib/stripe_event/engine.rb
164
165
  - lib/stripe_event/version.rb
@@ -238,6 +239,7 @@ test_files:
238
239
  - gemfiles/stripe5.gemfile
239
240
  - gemfiles/stripe6.gemfile
240
241
  - gemfiles/stripe7.gemfile
242
+ - gemfiles/stripe8.gemfile
241
243
  - spec/controllers/webhook_controller_spec.rb
242
244
  - spec/dummy/README.rdoc
243
245
  - spec/dummy/Rakefile