stripe-rails 2.3.3 → 2.3.5

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: a2142c5871696a4809195aeb596944ec07ccbead820086b02aeaf4e27a0f890c
4
- data.tar.gz: 4ba66f5d6fd19d1ed7801b5a1ad6318aa0b67c95ab933026fec15b3d0751e607
3
+ metadata.gz: c0689a9e336780e3cfdd44afb914a5f5162e1ffa00f458f43e91b0f325b07be3
4
+ data.tar.gz: 74b39a714aea039928fcd94636c080a7ec8cb222a2f3e3a41823285e3c434c25
5
5
  SHA512:
6
- metadata.gz: b5169053a8d7753ad76bd0c86d3fe13e953dd0b9eac69b844c5d1989b544d46d842dda70f21760ce10a56f2ef690ae7e06d3819929d64d5130f229ff5c68bc6c
7
- data.tar.gz: e72cdf92ccde93d0379969701f1011fce8d0b3d25e0957c55b0580fd6dff862b942f224546a3f5e01c091cc2eb63b522a80f02fdd149b7eb5f44b86b99d83668
6
+ metadata.gz: b5ecf2a6c8812ec03b8accd5ab8453a1a3836dee7b6127692f29f7886a737795027f6f1905a25d68f59afecfc38ac9203d7f01941c133a3f2a80c6d8efeaf51a
7
+ data.tar.gz: 10a572f102d2670274dc12868993bfc5c10ba555ef0cc342c081f2569117cb928ea1e6c4a87726b6a1b901cabeee305ff8a7437ae0b4d7515ff0c8016d0e8b3c
data/Changelog.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 2.3.5 (2022-10-01)
4
+
5
+ - Fix some deprecation warnings in tests. Thanks @smtlaissezfaire !
6
+ - Fix `NameError when loading JavascriptHelper`. Thanks @smtlaissezfaire !
7
+
8
+ ## 2.3.4 (2022-05-03)
9
+
10
+ - Add setup_intent.canceled and setup_intent.requires_action callbacks. Thanks @jamesjason !
3
11
 
4
12
  ## 2.3.3 (2021-12-17)
5
13
 
@@ -94,7 +94,9 @@ module Stripe
94
94
  callback 'recipient.updated'
95
95
  callback 'review.closed'
96
96
  callback 'review.opened'
97
+ callback 'setup_intent.canceled'
97
98
  callback 'setup_intent.created'
99
+ callback 'setup_intent.requires_action'
98
100
  callback 'setup_intent.setup_failed'
99
101
  callback 'setup_intent.succeeded'
100
102
  callback 'sigma.scheduled_query_run.created'
data/lib/stripe/engine.rb CHANGED
@@ -79,7 +79,7 @@ environment file directly.
79
79
  end
80
80
  end
81
81
 
82
- initializer 'stripe.javascript_helper' do
82
+ config.to_prepare do
83
83
  ActiveSupport.on_load :action_controller do
84
84
  # ActionController::API does not have a helper method
85
85
  if respond_to?(:helper)
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module Rails
3
- VERSION = '2.3.3'.freeze
3
+ VERSION = '2.3.5'.freeze
4
4
  end
5
5
  end
@@ -307,7 +307,7 @@ describe 'building plans' do
307
307
 
308
308
  describe 'when passed invalid arguments for tiered pricing' do
309
309
  it 'raises a Stripe::InvalidConfigurationError when billing tiers are invalid' do
310
- lambda {
310
+ _(lambda {
311
311
  Stripe.plan "Bad Tiers".to_sym do |plan|
312
312
  plan.name = 'Acme as a service BAD TIERS'
313
313
  plan.constant_name = 'BAD_TIERS'
@@ -328,11 +328,11 @@ describe 'building plans' do
328
328
  }
329
329
  ]
330
330
  end
331
- }.must_raise Stripe::InvalidConfigurationError
331
+ }).must_raise Stripe::InvalidConfigurationError
332
332
  end
333
333
 
334
334
  it 'raises a Stripe::InvalidConfigurationError when billing tiers is not an array' do
335
- lambda {
335
+ _(lambda {
336
336
  Stripe.plan "Bad Tiers".to_sym do |plan|
337
337
  plan.name = 'Acme as a service BAD TIERS'
338
338
  plan.constant_name = 'BAD_TIERS'
@@ -348,7 +348,7 @@ describe 'building plans' do
348
348
  up_to: 10
349
349
  }
350
350
  end
351
- }.must_raise Stripe::InvalidConfigurationError
351
+ }).must_raise Stripe::InvalidConfigurationError
352
352
  end
353
353
  end
354
354
 
@@ -392,7 +392,7 @@ describe 'building prices' do
392
392
 
393
393
  describe 'when passed invalid arguments for tiered pricing' do
394
394
  it 'raises a Stripe::InvalidConfigurationError when billing tiers are invalid' do
395
- lambda {
395
+ _(lambda {
396
396
  Stripe.price "Bad Tiers".to_sym do |price|
397
397
  price.name = 'Acme as a service BAD TIERS'
398
398
  price.constant_name = 'BAD_TIERS'
@@ -414,11 +414,11 @@ describe 'building prices' do
414
414
  }
415
415
  ]
416
416
  end
417
- }.must_raise Stripe::InvalidConfigurationError
417
+ }).must_raise Stripe::InvalidConfigurationError
418
418
  end
419
419
 
420
420
  it 'raises a Stripe::InvalidConfigurationError when billing tiers is not an array' do
421
- lambda {
421
+ _(lambda {
422
422
  Stripe.price "Bad Tiers".to_sym do |price|
423
423
  price.name = 'Acme as a service BAD TIERS'
424
424
  price.constant_name = 'BAD_TIERS'
@@ -435,7 +435,7 @@ describe 'building prices' do
435
435
  up_to: 10
436
436
  }
437
437
  end
438
- }.must_raise Stripe::InvalidConfigurationError
438
+ }).must_raise Stripe::InvalidConfigurationError
439
439
  end
440
440
  end
441
441
 
data/test/spec_helper.rb CHANGED
@@ -34,6 +34,6 @@ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
34
34
  end
35
35
 
36
36
  Stripe::Engine.testing = true
37
- require 'mocha/setup'
37
+ require 'mocha/minitest'
38
38
 
39
39
  require 'irb'
@@ -4,12 +4,18 @@ describe "Configuring the stripe engine" do
4
4
  i_suck_and_my_tests_are_order_dependent! # the default test must be run first!
5
5
 
6
6
  # NOTE: skipped `stripe.plans_and_coupons` to prevent warnings about constants
7
- STRIPE_INITIALIZER_NAMES = %w{ stripe.configure.defaults stripe.configure stripe.callbacks.eager_load stripe.javascript_helper }
7
+ STRIPE_INITIALIZER_NAMES = %w{
8
+ stripe.configure.defaults
9
+ stripe.configure
10
+ stripe.callbacks.eager_load
11
+ }
8
12
 
9
13
  let(:app) { Rails.application }
10
14
  let(:initializers) { STRIPE_INITIALIZER_NAMES.map{|name| app.initializers.find{|ini| ini.name == name } } }
11
15
 
12
- def rerun_initializers!; initializers.each{|init| init.run(app) }; end
16
+ def rerun_initializers!
17
+ initializers.each { |init| init.run(app) }
18
+ end
13
19
 
14
20
  after do
15
21
  Stripe.api_version = nil
@@ -60,11 +66,11 @@ describe "Configuring the stripe engine" do
60
66
  it "supports nil signing_secret" do
61
67
  subject
62
68
 
63
- app.config.stripe.signing_secret = nil
69
+ app.config.stripe.signing_secret = nil
64
70
  rerun_initializers!
65
71
 
66
- _(app.config.stripe.signing_secret).must_equal nil
67
- _(app.config.stripe.signing_secrets).must_equal nil
72
+ assert_nil app.config.stripe.signing_secret
73
+ assert_nil app.config.stripe.signing_secrets
68
74
  end
69
75
 
70
76
  it "supports multiple signing secrets" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-12-17 00:00:00.000000000 Z
13
+ date: 2022-10-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  requirements: []
191
- rubygems_version: 3.1.6
191
+ rubygems_version: 3.3.18
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: A gem to integrate stripe into your rails app