stripe-rails 1.9.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,16 +15,16 @@ describe 'building products' do
15
15
  after { Stripe::Products.send(:remove_const, :PRIMO) }
16
16
 
17
17
  it 'is accessible via id' do
18
- Stripe::Products::PRIMO.wont_be_nil
18
+ _(Stripe::Products::PRIMO).wont_be_nil
19
19
  end
20
20
 
21
21
  it 'is accessible via collection' do
22
- Stripe::Products.all.must_include Stripe::Products::PRIMO
22
+ _(Stripe::Products.all).must_include Stripe::Products::PRIMO
23
23
  end
24
24
 
25
25
  it 'is accessible via hash lookup (symbol/string agnostic)' do
26
- Stripe::Products[:primo].must_equal Stripe::Products::PRIMO
27
- Stripe::Products['primo'].must_equal Stripe::Products::PRIMO
26
+ _(Stripe::Products[:primo]).must_equal Stripe::Products::PRIMO
27
+ _(Stripe::Products['primo']).must_equal Stripe::Products::PRIMO
28
28
  end
29
29
 
30
30
  describe '.put!' do
@@ -63,42 +63,42 @@ describe 'building products' do
63
63
  describe 'validations' do
64
64
  describe 'with missing mandatory values' do
65
65
  it 'raises an exception after configuring it' do
66
- lambda { Stripe.product(:bad){} }.must_raise Stripe::InvalidConfigurationError
66
+ _(lambda { Stripe.product(:bad){} }).must_raise Stripe::InvalidConfigurationError
67
67
  end
68
68
  end
69
69
 
70
70
  describe 'invalid type' do
71
71
  it 'raises an exception during configuration' do
72
- lambda {
72
+ _(lambda {
73
73
  Stripe.product :broken do |product|
74
74
  product.name = 'Acme as a service BROKEN'
75
75
  product.type = 'anything'
76
76
  end
77
- }.must_raise Stripe::InvalidConfigurationError
77
+ }).must_raise Stripe::InvalidConfigurationError
78
78
  end
79
79
  end
80
80
 
81
81
  describe 'when using an attribute only for goods' do
82
82
  it 'raises an exception during configuration' do
83
- lambda {
83
+ _(lambda {
84
84
  Stripe.product :broken do |product|
85
85
  product.name = 'Broken Service'
86
86
  product.type = 'service'
87
87
  product.caption = 'So good it is Primo'
88
88
  end
89
- }.must_raise Stripe::InvalidConfigurationError
89
+ }).must_raise Stripe::InvalidConfigurationError
90
90
  end
91
91
  end
92
92
 
93
93
  describe 'when using an attribute only for services' do
94
94
  it 'raises an exception during configuration' do
95
- lambda {
95
+ _(lambda {
96
96
  Stripe.product :broken do |product|
97
97
  product.name = 'Broken Good'
98
98
  product.type = 'good'
99
99
  product.statement_descriptor = 'SERVICE'
100
100
  end
101
- }.must_raise Stripe::InvalidConfigurationError
101
+ }).must_raise Stripe::InvalidConfigurationError
102
102
  end
103
103
  end
104
104
  end
@@ -19,16 +19,16 @@ describe "Configuring the stripe engine" do
19
19
 
20
20
  describe 'Stripe configurations' do
21
21
  it "will have valid default values" do
22
- Stripe.api_base.must_equal 'https://api.stripe.com'
23
- Stripe.api_key.must_equal 'XYZ'
24
- Stripe.api_version.must_be_nil
25
- Stripe.verify_ssl_certs.must_equal true
26
- Stripe.open_timeout.must_equal 30
27
- Stripe.read_timeout.must_equal 80
28
-
29
- app.config.stripe.endpoint.must_equal '/stripe'
30
- app.config.stripe.auto_mount.must_equal true
31
- app.config.stripe.debug_js.must_equal false
22
+ _(Stripe.api_base).must_equal 'https://api.stripe.com'
23
+ _(Stripe.api_key).must_equal 'XYZ'
24
+ _(Stripe.api_version).must_be_nil
25
+ _(Stripe.verify_ssl_certs).must_equal true
26
+ _(Stripe.open_timeout).must_equal 30
27
+ _(Stripe.read_timeout).must_equal 80
28
+
29
+ _(app.config.stripe.endpoint).must_equal '/stripe'
30
+ _(app.config.stripe.auto_mount).must_equal true
31
+ _(app.config.stripe.debug_js).must_equal false
32
32
  end
33
33
 
34
34
  subject do
@@ -45,15 +45,15 @@ describe "Configuring the stripe engine" do
45
45
  it "reads values that is set in the environment" do
46
46
  subject
47
47
 
48
- Stripe.api_base.must_equal 'http://localhost:5000'
49
- Stripe.api_key.must_equal 'SECRET_XYZ'
50
- Stripe.verify_ssl_certs.must_equal false
51
- Stripe.api_version.must_equal '2015-10-16'
52
- Stripe.open_timeout.must_equal 33
53
- Stripe.read_timeout.must_equal 88
48
+ _(Stripe.api_base).must_equal 'http://localhost:5000'
49
+ _(Stripe.api_key).must_equal 'SECRET_XYZ'
50
+ _(Stripe.verify_ssl_certs).must_equal false
51
+ _(Stripe.api_version).must_equal '2015-10-16'
52
+ _(Stripe.open_timeout).must_equal 33
53
+ _(Stripe.read_timeout).must_equal 88
54
54
 
55
- app.config.stripe.signing_secret.must_equal 'SIGNING_SECRET_XYZ'
56
- app.config.stripe.signing_secrets.length.must_equal 1
55
+ _(app.config.stripe.signing_secret).must_equal 'SIGNING_SECRET_XYZ'
56
+ _(app.config.stripe.signing_secrets.length).must_equal 1
57
57
  end
58
58
 
59
59
  it "supports multiple signing secrets" do
@@ -62,8 +62,8 @@ describe "Configuring the stripe engine" do
62
62
  app.config.stripe.signing_secrets = ['SIGNING_SECRET_XYZ', 'SIGNING_SECRET_XYZ_CONNECT']
63
63
  rerun_initializers!
64
64
 
65
- app.config.stripe.signing_secret.must_equal 'SIGNING_SECRET_XYZ'
66
- app.config.stripe.signing_secrets.length.must_equal 2
65
+ _(app.config.stripe.signing_secret).must_equal 'SIGNING_SECRET_XYZ'
66
+ _(app.config.stripe.signing_secrets.length).must_equal 2
67
67
  end
68
68
 
69
69
  end
@@ -77,8 +77,8 @@ describe "Configuring the stripe engine" do
77
77
  it 'should be eager loaded' do
78
78
  subject
79
79
 
80
- Dummy.const_defined?(:ModelWithCallbacks).must_equal true
81
- Dummy.const_defined?(:ModuleWithCallbacks).must_equal true
80
+ _(Dummy.const_defined?(:ModelWithCallbacks)).must_equal true
81
+ _(Dummy.const_defined?(:ModuleWithCallbacks)).must_equal true
82
82
  end
83
83
  end
84
84
 
@@ -87,7 +87,7 @@ describe "Configuring the stripe engine" do
87
87
  let(:warning_msg) { "[DEPRECATION] to align with stripe nomenclature, stripe.api_key has been renamed to config.stripe.secret_key\n" }
88
88
 
89
89
  it 'should output a warning' do
90
- -> { subject }.must_output '', warning_msg
90
+ _(-> { subject }).must_output '', warning_msg
91
91
  end
92
92
  end
93
93
  end
@@ -1,8 +1,3 @@
1
- require File.expand_path("null_system_test_case", __dir__)
2
-
3
- # For Rails 4 compat
4
- SystemTestCaseKlass = defined?(ActionDispatch::SystemTestCase) ? ActionDispatch::SystemTestCase : NullSystemTestCase
5
-
6
- class ApplicationSystemTestCase < SystemTestCaseKlass
1
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
7
2
  driven_by :selenium_chrome_headless
8
- end
3
+ end
@@ -28,8 +28,8 @@ describe "Testing" do
28
28
 
29
29
  it 'the callback must run' do
30
30
  subject
31
- event.wont_be_nil
32
- event.type.must_equal "invoice.payment_succeeded"
31
+ _(event).wont_be_nil
32
+ _(event.type).must_equal "invoice.payment_succeeded"
33
33
  end
34
34
  end
35
35
 
@@ -38,7 +38,7 @@ describe "Testing" do
38
38
 
39
39
  it 'the callback must not run' do
40
40
  subject
41
- event.must_be_nil
41
+ _(event).must_be_nil
42
42
  end
43
43
  end
44
44
 
@@ -49,11 +49,11 @@ describe "Testing" do
49
49
 
50
50
  it 'the callback should run with overwritten properties' do
51
51
  subject
52
- event.wont_be_nil
53
- event.type.must_equal "invoice.payment_succeeded"
54
- target.subtotal.must_equal 500
55
- target.total.must_equal 1000
56
- target.currency.must_equal "eur"
52
+ _(event).wont_be_nil
53
+ _(event.type).must_equal "invoice.payment_succeeded"
54
+ _(target.subtotal).must_equal 500
55
+ _(target.total).must_equal 1000
56
+ _(target.currency).must_equal "eur"
57
57
  end
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell
8
8
  - Nola Stowe
9
9
  - SengMing Tan
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-10-28 00:00:00.000000000 Z
13
+ date: 2020-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '3'
21
+ version: '5.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '3'
28
+ version: '5.1'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: stripe
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: 1.36.2
35
+ version: 3.15.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.36.2
42
+ version: 3.15.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: responders
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -78,21 +78,21 @@ files:
78
78
  - app/assets/stripe/stripe_elements.js
79
79
  - app/controllers/stripe/application_controller.rb
80
80
  - app/controllers/stripe/events_controller.rb
81
- - app/controllers/stripe/pings_controller.rb
82
81
  - app/helpers/stripe/javascript_helper.rb
83
82
  - app/models/stripe/event_dispatch.rb
84
- - app/models/stripe/ping.rb
85
83
  - app/views/stripe/_elements.html.erb
86
84
  - app/views/stripe/_elements_js.html.erb
87
85
  - app/views/stripe/_js.html.erb
88
86
  - config/locales/en.yml
89
87
  - config/routes.rb
90
- - gemfiles/rails4.gemfile
88
+ - gemfiles/rails51.gemfile
89
+ - gemfiles/rails52.gemfile
91
90
  - lib/generators/stripe/install_generator.rb
92
91
  - lib/generators/templates/coupons.rb
93
92
  - lib/generators/templates/plans.rb
94
93
  - lib/generators/templates/products.rb
95
94
  - lib/stripe-rails.rb
95
+ - lib/stripe/billing_tier.rb
96
96
  - lib/stripe/callbacks.rb
97
97
  - lib/stripe/callbacks/builder.rb
98
98
  - lib/stripe/configuration_builder.rb
@@ -155,7 +155,6 @@ files:
155
155
  - test/fixtures/stripe_plans_headers_2017.json
156
156
  - test/invoice.json
157
157
  - test/javascript_helper_spec.rb
158
- - test/pings_controller_spec.rb
159
158
  - test/plan_builder_spec.rb
160
159
  - test/product_builder_spec.rb
161
160
  - test/spec_helper.rb
@@ -163,13 +162,12 @@ files:
163
162
  - test/support/application_system_test_case.rb
164
163
  - test/support/callback_helpers.rb
165
164
  - test/support/fixture_loader.rb
166
- - test/support/null_system_test_case.rb
167
165
  - test/testing_spec.rb
168
166
  homepage: https://github.com/tansengming/stripe-rails
169
167
  licenses:
170
168
  - MIT
171
169
  metadata: {}
172
- post_install_message:
170
+ post_install_message:
173
171
  rdoc_options: []
174
172
  require_paths:
175
173
  - lib
@@ -184,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
182
  - !ruby/object:Gem::Version
185
183
  version: '0'
186
184
  requirements: []
187
- rubygems_version: 3.0.3
188
- signing_key:
185
+ rubygems_version: 3.1.2
186
+ signing_key:
189
187
  specification_version: 4
190
188
  summary: A gem to integrate stripe into your rails app
191
189
  test_files:
@@ -238,7 +236,6 @@ test_files:
238
236
  - test/fixtures/stripe_plans_headers_2017.json
239
237
  - test/invoice.json
240
238
  - test/javascript_helper_spec.rb
241
- - test/pings_controller_spec.rb
242
239
  - test/plan_builder_spec.rb
243
240
  - test/product_builder_spec.rb
244
241
  - test/spec_helper.rb
@@ -246,5 +243,4 @@ test_files:
246
243
  - test/support/application_system_test_case.rb
247
244
  - test/support/callback_helpers.rb
248
245
  - test/support/fixture_loader.rb
249
- - test/support/null_system_test_case.rb
250
246
  - test/testing_spec.rb
@@ -1,10 +0,0 @@
1
- module Stripe
2
- class PingsController < ::Stripe::ApplicationController
3
- respond_to :json
4
-
5
- def show
6
- @ping = Ping.new
7
- respond_with @ping
8
- end
9
- end
10
- end
@@ -1,9 +0,0 @@
1
- module Stripe
2
- class Ping
3
- attr_reader :message
4
-
5
- def initialize
6
- @message = "Your sound card works perfectly!"
7
- end
8
- end
9
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Stripe::PingsController do
4
- parallelize_me!
5
- include Rack::Test::Methods
6
-
7
- let(:app) { Rails.application }
8
- before do
9
- header 'Accept', 'application/json'
10
- header 'Content-Type', 'application/json'
11
- end
12
-
13
- describe 'the ping interface' do
14
- subject { get '/stripe/ping' }
15
-
16
- it { subject.must_be :ok? }
17
- end
18
- end
@@ -1,11 +0,0 @@
1
- class NullSystemTestCase
2
- def self.driven_by(*_)
3
- end
4
-
5
- def self.setup
6
- end
7
-
8
- def self.test(_)
9
- warn 'WARNING: Skipping system test because this version of Rails does not support it!'
10
- end
11
- end