stripe_event 2.3.1 → 2.3.2

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: 90d6d19afa81645efcadb2d980a9d8279d00686e33cc101283a07faaebb76afd
4
- data.tar.gz: 338d0f8196af2c086cfb2df0bdc2350ac8577d8d45e9db19a9f032191df24161
3
+ metadata.gz: 9e8bf3dc8abec723bb2c3278c725f754bbe7cd991f868a8854ff04bac7bc778f
4
+ data.tar.gz: 46b48dae96008e8e9f27c8d7e39aa5a022614d322f2a60845b249dd862cec82b
5
5
  SHA512:
6
- metadata.gz: 91789378fbba4beeb4e0245d5f980fdaa27136043ba0e53bb9e4478e57e1e397317fc4069989dd48dfee01eed64c34856294f2b5b3d66681377f0178955dee76
7
- data.tar.gz: 9289a39f3f459f6a048d252e0803af0a1dd77c559e90f5f6cc261e060ea006de892b96c2a4b50039302936cc11a830fb7a1dc069addcaac989cbdfd566aa591a
6
+ metadata.gz: 56defdead871efd3c089a19db8382ded54786d7c899a39b6245e4b6c69e3a0a8379e792794aeb7bdbc9615f82ce107a528ea8953ac6c9a8d86c8ccd27a0e80a4
7
+ data.tar.gz: a91a63ef969c4e7cebac2ce7c083923a6d74cd3cfc166ea914c0956a3108edfc7591be179b44aa8fd10ce43dd8a4ec57119545f745f6a910f492b7c9ffcc98eb
@@ -0,0 +1,37 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ ruby: ["2.5", "2.6", "2.7"]
10
+ bundler: [default]
11
+ gemfile:
12
+ - rails5.1
13
+ - rails5.2
14
+ - rails6.0
15
+ - rails6.1
16
+ - stripe3
17
+ - stripe4
18
+ - stripe5
19
+ include:
20
+ - { ruby: "2.3", gemfile: "rails3.2", bundler: "1" }
21
+ - { ruby: "2.3", gemfile: "rails4.2", bundler: "1" }
22
+ - { ruby: "2.4", gemfile: "rails4.2", bundler: "1" }
23
+
24
+ env:
25
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
26
+ steps:
27
+ # https://github.com/marketplace/actions/checkout
28
+ - uses: actions/checkout@v2
29
+ # https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler: ${{ matrix.bundler }}
35
+ bundler-cache: true # runs `bundle install` and caches gems automatically
36
+ - name: Run tests
37
+ run: bundle exec rake
data/Appraisals CHANGED
@@ -19,6 +19,10 @@ appraise "rails6.0" do
19
19
  gem "rails", "~> 6.0.0"
20
20
  end
21
21
 
22
+ appraise "rails6.1" do
23
+ gem "rails", "~> 6.1.0"
24
+ end
25
+
22
26
  appraise "stripe3" do
23
27
  gem "stripe", "~> 3.0"
24
28
  end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 2.3.2 (February 21, 2022)
2
+
3
+ - Fix signature validation error if the first signing secret is nil (#146)
4
+ - Update README (#143)
5
+ - Setup github actions for CI (#147)
6
+
1
7
  ### 2.3.1 (May 12, 2020)
2
8
 
3
9
  - Fix deprecation warning in Ruby 2.7 (#130)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # StripeEvent
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/integrallis/stripe_event.svg)](http://travis-ci.org/integrallis/stripe_event)
3
+ [![Build Status](https://github.com/integrallis/stripe_event/workflows/CI/badge.svg)](https://github.com/integrallis/stripe_event/actions?query=workflow%3ACI)
4
4
  [![Gem Version](https://badge.fury.io/rb/stripe_event.svg)](http://badge.fury.io/rb/stripe_event)
5
5
  [![Code Climate](https://codeclimate.com/github/integrallis/stripe_event.svg)](https://codeclimate.com/github/integrallis/stripe_event)
6
6
  [![Coverage Status](https://coveralls.io/repos/integrallis/stripe_event/badge.svg)](https://coveralls.io/r/integrallis/stripe_event)
@@ -169,7 +169,7 @@ Handling webhooks is a critical piece of modern billing systems. Verifying the b
169
169
 
170
170
  ```ruby
171
171
  # spec/requests/billing_events_spec.rb
172
- require 'spec_helper'
172
+ require 'rails_helper'
173
173
 
174
174
  describe "Billing Events" do
175
175
  def bypass_event_signature(payload)
@@ -178,12 +178,12 @@ describe "Billing Events" do
178
178
  end
179
179
 
180
180
  describe "customer.created" do
181
- let(:payload) { File.read("spec/support/fixtures/evt_customer_created.json") }
182
- before(:each) { bypass_event_signature payload }
181
+ let(:payload) { file_fixture('evt_customer_created.json').read }
182
+ before(:each) { bypass_event_signature(payload) }
183
183
 
184
184
  it "is successful" do
185
- post '/_billing_events', body: payload
186
- expect(response.code).to eq "200"
185
+ post '/_billing_events', params: payload
186
+ expect(response).to have_http_status(:success)
187
187
  # Additional expectations...
188
188
  end
189
189
  end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.1.0"
6
+
7
+ gemspec path: "../"
@@ -1,3 +1,3 @@
1
1
  module StripeEvent
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
data/lib/stripe_event.rb CHANGED
@@ -34,7 +34,7 @@ module StripeEvent
34
34
  end
35
35
 
36
36
  def signing_secret=(value)
37
- @signing_secrets = Array(value)
37
+ @signing_secrets = Array(value).compact
38
38
  end
39
39
  alias signing_secrets= signing_secret=
40
40
 
@@ -132,4 +132,18 @@ describe StripeEvent::WebhookController, type: :controller do
132
132
  expect(response.code).to eq '200'
133
133
  end
134
134
  end
135
+
136
+ context "with multiple signing secrets first of which is nil" do
137
+ before(:each) { StripeEvent.signing_secrets = [nil, secret1, secret2] }
138
+
139
+ it "succeeds with valid signature from first secret" do
140
+ webhook_with_signature charge_succeeded, secret1
141
+ expect(response.code).to eq '200'
142
+ end
143
+
144
+ it "succeeds with valid signature from second secret" do
145
+ webhook_with_signature charge_succeeded, secret2
146
+ expect(response.code).to eq '200'
147
+ end
148
+ end
135
149
  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.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Whalen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2022-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -134,9 +134,9 @@ executables: []
134
134
  extensions: []
135
135
  extra_rdoc_files: []
136
136
  files:
137
+ - ".github/workflows/ci.yml"
137
138
  - ".gitignore"
138
139
  - ".rspec"
139
- - ".travis.yml"
140
140
  - Appraisals
141
141
  - CHANGELOG.md
142
142
  - CONTRIBUTING.md
@@ -151,6 +151,7 @@ files:
151
151
  - gemfiles/rails5.1.gemfile
152
152
  - gemfiles/rails5.2.gemfile
153
153
  - gemfiles/rails6.0.gemfile
154
+ - gemfiles/rails6.1.gemfile
154
155
  - gemfiles/rails_master.gemfile
155
156
  - gemfiles/stripe3.gemfile
156
157
  - gemfiles/stripe4.gemfile
@@ -215,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
216
  - !ruby/object:Gem::Version
216
217
  version: '0'
217
218
  requirements: []
218
- rubygems_version: 3.0.3
219
+ rubygems_version: 3.3.7
219
220
  signing_key:
220
221
  specification_version: 4
221
222
  summary: Stripe webhook integration for Rails applications.
@@ -226,6 +227,7 @@ test_files:
226
227
  - gemfiles/rails5.1.gemfile
227
228
  - gemfiles/rails5.2.gemfile
228
229
  - gemfiles/rails6.0.gemfile
230
+ - gemfiles/rails6.1.gemfile
229
231
  - gemfiles/rails_master.gemfile
230
232
  - gemfiles/stripe3.gemfile
231
233
  - gemfiles/stripe4.gemfile
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- rvm:
5
- - 2.5
6
- - 2.6
7
- - 2.7
8
-
9
- gemfile:
10
- - gemfiles/rails5.1.gemfile
11
- - gemfiles/rails5.2.gemfile
12
- - gemfiles/rails6.0.gemfile
13
- - gemfiles/stripe3.gemfile
14
- - gemfiles/stripe4.gemfile
15
- - gemfiles/stripe5.gemfile
16
-
17
- matrix:
18
- include:
19
- - rvm: 2.3
20
- gemfile: gemfiles/rails3.2.gemfile
21
- - rvm: 2.3
22
- gemfile: gemfiles/rails4.2.gemfile
23
- - rvm: 2.4
24
- gemfile: gemfiles/rails4.2.gemfile
25
- - rvm: ruby
26
- gemfile: gemfiles/rails_master.gemfile
27
- allow_failures:
28
- - gemfile: gemfiles/rails_master.gemfile
29
- fast_finish: true
30
-
31
- notifications:
32
- email:
33
- - daniel.r.whalen+travis-ci@gmail.com