stripe-rails 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 03a407b7ba74c65f266f9443496bc69251355f84
4
- data.tar.gz: 5af8f232370df1d3547932002028600954e18666
3
+ metadata.gz: 2cc993299fe82d531d563a6d8f77c06792290c4b
4
+ data.tar.gz: 507fc54438accfc9cfa335d092eb4ee668ccdd2c
5
5
  SHA512:
6
- metadata.gz: 4600d4ae6231a38189c80504f86acbb08672aaf36ac29df556eefa4f1e255627b5d23109c05c974b7ea2ef7c89587e77a175599650ff472b8d44c1bb36075f94
7
- data.tar.gz: ae40a99a4a73dfebba3a76292a734fcf6928ac11dd61d7607b35838fbb4314a0e11a3247f802708d69030fa74b168dd48fe7934d4ad2344ac17410c6349e8315
6
+ metadata.gz: 6c1b44936c15c60b524b05e133cf16524eb2f2e234548e0ab7bb3393fb99f140c6faaac7ba843cdcf7085758288cf52bd9b727d72c20ba83d7e60cdb4deaac4e
7
+ data.tar.gz: '04678d354150020a4af4e56ee4f84e94444867548a442208bffbb943a2274be6215a06ac1e6e7eba6b31d8f1688250ad6081f717712a5af0a95807b5b8ecc485'
data/Changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.1.2 (2017-10-25)
2
+
3
+ * Fixes js partial crash if stripe_js_version is not defined
4
+
1
5
  ## 1.1.1 (2017-08-31)
2
6
 
3
7
  * Make stripe-ruby-mock an optional dependency (thanks @gaffneyc)
@@ -1,6 +1,8 @@
1
1
  module Stripe
2
2
  module JavascriptHelper
3
- def stripe_javascript_tag(stripe_js_version = 'v3')
3
+ DEFAULT_STRIPE_JS_VERSION = 'v3'
4
+
5
+ def stripe_javascript_tag(stripe_js_version = DEFAULT_STRIPE_JS_VERSION)
4
6
  stripe_js_version = stripe_js_version.to_s.downcase
5
7
 
6
8
  render 'stripe/js', stripe_js_version: stripe_js_version
@@ -1,4 +1,5 @@
1
- <%- case (stripe_js_version || 'v3') %>
1
+ <%- stripe_js_version = Stripe::JavascriptHelper::DEFAULT_STRIPE_JS_VERSION if (!defined?(stripe_js_version) || stripe_js_version.nil?) %>
2
+ <%- case stripe_js_version %>
2
3
  <%- when 'v1', 'v2' %>
3
4
  <%- if ::Rails.application.config.stripe.debug_js %>
4
5
  <script type="text/javascript" src="https://js.stripe.com/<%=stripe_js_version%>/stripe-debug.js"></script>
@@ -7,8 +7,7 @@
7
7
  # Stripe::Coupons::Gold25 #=> 'gold25'
8
8
 
9
9
  # Stripe.coupon :gold25 do |coupon|
10
- #
11
- # # specify if this coupon is useable 'once', 'forever', or 'repeating
10
+ # # specify if this coupon is useable 'once', 'forever', or 'repeating'
12
11
  # coupon.duration = 'repeating'
13
12
  #
14
13
  # # absolute amount, in cents, to discount
@@ -24,7 +23,7 @@
24
23
  # coupon.percent_off = 25
25
24
  #
26
25
  # UTC timestamp specifying the last time at which the coupon can be redeemed
27
- # coupon.reedem_by = (Time.now + 15.days).utc
26
+ # coupon.redeem_by = (Time.now + 15.days).utc
28
27
  #
29
28
  # # How many times can this coupon be redeemed?
30
29
  # coupon.max_redemptions = 10
@@ -36,4 +35,4 @@
36
35
  #
37
36
  # This will export any new coupons to stripe.com so that you can
38
37
  # begin using them in your API calls. Any coupons found that are not in this
39
- # file will be left as-is.
38
+ # file will be left as-is.
@@ -4,7 +4,6 @@
4
4
  # Stripe::Plans::PRIMO #=> 'primo'
5
5
 
6
6
  # Stripe.plan :primo do |plan|
7
- #
8
7
  # # plan name as it will appear on credit card statements
9
8
  # plan.name = 'Acme as a service PRIMO'
10
9
  #
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module Rails
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
@@ -32,4 +32,20 @@ describe Stripe::JavascriptHelper do
32
32
  end
33
33
  end
34
34
  end
35
+
36
+ describe "render :partial => 'stripe/js'" do
37
+ subject { view.render :partial => 'stripe/js' }
38
+
39
+ it 'should render correctly' do
40
+ subject.must_include 'https://js.stripe.com/v3/'
41
+ end
42
+ end
43
+
44
+ describe "render :partial => 'stripe/js', local: {stripe_js_version: 'v2'}" do
45
+ subject { view.render :partial => 'stripe/js', locals: {stripe_js_version: 'v2'} }
46
+
47
+ it 'should render correctly' do
48
+ subject.must_include 'https://js.stripe.com/v2/'
49
+ end
50
+ end
35
51
  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.1.1
4
+ version: 1.1.2
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: 2017-08-31 00:00:00.000000000 Z
13
+ date: 2017-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.6.11
173
+ rubygems_version: 2.6.13
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: A gem to integrate stripe into your rails app