stripe_event 2.5.0 → 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: ae20c29ad3c38d0945388b8c226af15b9cb28bcbec7414d8fedca5423e057d9e
4
- data.tar.gz: e3a6349f95012362bdadfe41293fc54985dec55e56ce41f85dbf5835ee81e53c
3
+ metadata.gz: 04e746d341ec9847d041e56d9abfae58b7c76338f932050ea512f64e1ae56f7d
4
+ data.tar.gz: 7fa48ffb9b7bce0057ffa5234baebfa9bf5b5971936258f74a31bb4455d46b7b
5
5
  SHA512:
6
- metadata.gz: b33395b3e590834f7f6967abaa45ddb9d05eb866353b849a09f57d7fc17c2529511ffafceba9e5adbadde8c1b3777193d73e2419356e28bdd7e05ffa8c4395e2
7
- data.tar.gz: 71bde2aa10035e1e339685ec8af7129330faead28680a10d0b16f7b423a5be7046d90343e0b44ea08a5420c9e8a89d9a407b5e67f29af00cf00cf255e67467f1
6
+ metadata.gz: 353db17485cfcbb510965c1980b34c94b17ee43524d55b4cc7d0a02aebf5b6fef04629313f2ea9d09e5b28daa9f79d34328504cdc544c99fe1aba9f574193a21
7
+ data.tar.gz: fd6ac00dcff8aa8d15732288f4916bbe1d3a9093f0e674684bf1bdce4f3e6ec5256691d8beb8039bb7844386ba823f368bd68122052f0efbd2f8d86026249d3c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ### [Unreleased] - TBD
2
2
 
3
+ ### 2.6.0 (Aug 8, 2022)
4
+
5
+ - Introduce StripeEvent::ProcessError and possible HTTP 422 responses (#155, #132)
6
+
3
7
  ### 2.5.0 (Aug 5, 2022)
4
8
 
5
9
  - 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
@@ -1,3 +1,3 @@
1
1
  module StripeEvent
2
- VERSION = "2.5.0"
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
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.6.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-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport