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 +4 -4
- data/Changelog.md +4 -0
- data/app/helpers/stripe/javascript_helper.rb +3 -1
- data/app/views/stripe/_js.html.erb +2 -1
- data/lib/generators/templates/coupons.rb +3 -4
- data/lib/generators/templates/plans.rb +0 -1
- data/lib/stripe/rails/version.rb +1 -1
- data/test/javascript_helper_spec.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cc993299fe82d531d563a6d8f77c06792290c4b
|
4
|
+
data.tar.gz: 507fc54438accfc9cfa335d092eb4ee668ccdd2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c1b44936c15c60b524b05e133cf16524eb2f2e234548e0ab7bb3393fb99f140c6faaac7ba843cdcf7085758288cf52bd9b727d72c20ba83d7e60cdb4deaac4e
|
7
|
+
data.tar.gz: '04678d354150020a4af4e56ee4f84e94444867548a442208bffbb943a2274be6215a06ac1e6e7eba6b31d8f1688250ad6081f717712a5af0a95807b5b8ecc485'
|
data/Changelog.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Stripe
|
2
2
|
module JavascriptHelper
|
3
|
-
|
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
|
-
<%-
|
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.
|
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.
|
data/lib/stripe/rails/version.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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
|