stripe-rails 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90005dd739c7208e522610313852d415857c8c6d56af912f1fff9d44ac431fd8
4
- data.tar.gz: dd7d8a122762f2aac4a8f2d8a4b1d1491378ea04bcc1bc3cc2241be2fb1b73c9
3
+ metadata.gz: 5a52261e711a04a275013908f67594be46bda90e21c87110c561cb367cd7aefa
4
+ data.tar.gz: a5d5c9865a115026584198a877721bfb5fa906ab90e17846abf263923fb6b090
5
5
  SHA512:
6
- metadata.gz: fcbbca03f84a930d7786706937e8be09c8a000ecd7c2827b32172673836b39083ba2a6c23f98c1b2229fed25ae5ad1ac5202639c62d19832f99a4fc071c18e44
7
- data.tar.gz: 38dd6b0c4ca375f483985f3cf42c3caae7dc63d7531e1e684cfc973edd4342a374c6767e1dd21197f51e64b9cd540b5051501457514ae958e9f435f6f38accf3
6
+ metadata.gz: 7e6389e135f2a56a572838a7cae66ea4524010e4428693d24a8cffdf5ff6e7d7c83586cd6b61a7e3b5e87f0ec15e69bab24c6922814ff3e31d55f0c141449fd3
7
+ data.tar.gz: 289efbff4424df92fb6f9a9b0fb0729241f706e941a306eb51e49f0af3e2e3d18e5d281cc5521ab82c6ee97cf159588143c388cd95fc9a68f2a36282ee517f8f
@@ -1,3 +1,8 @@
1
+ ## 1.8.1 (2019-07-26)
2
+
3
+ * adds callback for invoice.payment_action_required. Thanks @alexagranov .
4
+ * fixes when clearing callbacks after unload doesn't play nice with eager_load. Thanks @alexagranov for reporting the problem and coming up with an initial fix for it.
5
+
1
6
  ## 1.8.0 (2019-07-25)
2
7
 
3
8
  * Configure publishable key from ENV. Thanks @cyu .
@@ -47,6 +47,7 @@ module Stripe
47
47
  callback 'invoice.created'
48
48
  callback 'invoice.finalized'
49
49
  callback 'invoice.marked_uncollectible'
50
+ callback 'invoice.payment_action_required'
50
51
  callback 'invoice.payment_failed'
51
52
  callback 'invoice.payment_succeeded'
52
53
  callback 'invoice.sent'
@@ -42,6 +42,16 @@ environment file directly.
42
42
  MSG
43
43
  end
44
44
 
45
+ eager_load_classes = -> class_names {
46
+ class_names.each do |constant|
47
+ begin
48
+ constant.to_s.camelize.constantize
49
+ rescue NameError
50
+ require constant
51
+ end
52
+ end
53
+ }
54
+
45
55
  initializer 'stripe.callbacks.clear_after_unload' do |app|
46
56
  # Skip Rails 4 for now.
47
57
  next unless app.respond_to?(:reloader)
@@ -50,18 +60,13 @@ environment file directly.
50
60
  # This prevents duplicate callbacks being added during development.
51
61
  app.reloader.after_class_unload do
52
62
  ::Stripe::Callbacks.clear_callbacks!
63
+ eager_load_classes.call(app.config.stripe.eager_load)
53
64
  end
54
65
  end
55
66
 
56
67
  initializer 'stripe.callbacks.eager_load' do |app|
57
68
  app.config.after_initialize do
58
- app.config.stripe.eager_load.each do |constant|
59
- begin
60
- constant.to_s.camelize.constantize
61
- rescue NameError
62
- require constant
63
- end
64
- end
69
+ eager_load_classes.call(app.config.stripe.eager_load)
65
70
  end
66
71
  end
67
72
 
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module Rails
3
- VERSION = '1.8.0'.freeze
3
+ VERSION = '1.8.1'.freeze
4
4
  end
5
5
  end
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: 1.8.0
4
+ version: 1.8.1
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: 2019-07-25 00:00:00.000000000 Z
13
+ date: 2019-07-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails