paid_up 0.9.14 → 0.9.15
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/VERSION +1 -1
- data/app/controllers/paid_up/subscriptions_controller.rb +12 -0
- data/paid_up.gemspec +3 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
- metadata +2 -3
- data/spec/dummy/log/development.log +0 -20406
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f805874f1b94131d06b0bdb3b42f85fc3da9dff
|
|
4
|
+
data.tar.gz: b1c965b77e62b3db733795f02d665b56ba66b97d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6451990417603852a3770d695a09502f0fca7315fae5ad83913fc2c9dfccbda82e53088c5d3eb3a3862cbd97df985b43dd03b80e662f9f17d33b064c519976a0
|
|
7
|
+
data.tar.gz: 649f2534cea6300a0cefc649f4927b703f37c2d187b0278799041801f645cf01dc3846275841e6c1d98198c5e276cf2bad8baa87079c3898172e6362923bc53c
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.9.
|
|
1
|
+
0.9.15
|
|
@@ -17,6 +17,18 @@ module PaidUp
|
|
|
17
17
|
# @plan set by #set_plan
|
|
18
18
|
current_user.update_attribute(:coupon_code, params[:coupon_code])
|
|
19
19
|
if current_user.subscribe_to_plan(@plan, params[:stripeToken])
|
|
20
|
+
discount = current_user.stripe_data.discount
|
|
21
|
+
if !discount.nil? && !discount.coupon.nil? && @plan.amount != 0
|
|
22
|
+
orig_amount = @plan.amount
|
|
23
|
+
amount = orig_amount
|
|
24
|
+
amount -= (discount.coupon.percent_off || 0) * 0.01 * amount
|
|
25
|
+
amount -= (discount.coupon.amount_off || 0)
|
|
26
|
+
amount = amount > 0 ? amount : 0
|
|
27
|
+
money = Money.new(amount, @plan.currency)
|
|
28
|
+
else
|
|
29
|
+
money = @plan.money
|
|
30
|
+
end
|
|
31
|
+
flash[:paid_up_subscription] = money.format
|
|
20
32
|
redirect_to(
|
|
21
33
|
subscriptions_path,
|
|
22
34
|
flash: {
|
data/paid_up.gemspec
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: paid_up 0.9.
|
|
5
|
+
# stub: paid_up 0.9.15 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "paid_up"
|
|
9
|
-
s.version = "0.9.
|
|
9
|
+
s.version = "0.9.15"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib"]
|
|
13
13
|
s.authors = ["Karen Lundgren"]
|
|
14
|
-
s.date = "2016-03-
|
|
14
|
+
s.date = "2016-03-15"
|
|
15
15
|
s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features."
|
|
16
16
|
s.email = "karen.e.lundgren@gmail.com"
|
|
17
17
|
s.extra_rdoc_files = [
|
|
@@ -146,7 +146,6 @@ Gem::Specification.new do |s|
|
|
|
146
146
|
"spec/dummy/lib/assets/.keep",
|
|
147
147
|
"spec/dummy/lib/tasks/system.rake",
|
|
148
148
|
"spec/dummy/log/.keep",
|
|
149
|
-
"spec/dummy/log/development.log",
|
|
150
149
|
"spec/dummy/public/404.html",
|
|
151
150
|
"spec/dummy/public/422.html",
|
|
152
151
|
"spec/dummy/public/500.html",
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paid_up
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Karen Lundgren
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -510,7 +510,6 @@ files:
|
|
|
510
510
|
- spec/dummy/lib/assets/.keep
|
|
511
511
|
- spec/dummy/lib/tasks/system.rake
|
|
512
512
|
- spec/dummy/log/.keep
|
|
513
|
-
- spec/dummy/log/development.log
|
|
514
513
|
- spec/dummy/public/404.html
|
|
515
514
|
- spec/dummy/public/422.html
|
|
516
515
|
- spec/dummy/public/500.html
|