paid_up 0.9.16 → 0.10.0
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/README.md +11 -0
- data/VERSION +1 -1
- data/app/controllers/paid_up/subscriptions_controller.rb +11 -1
- data/app/helpers/paid_up/paid_up_helper.rb +4 -0
- data/app/views/paid_up/layouts/_google_analytics_data_layer.html.haml +4 -0
- data/app/views/paid_up/subscriptions/index.html.haml +1 -0
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +35 -9
- data/paid_up.gemspec +4 -3
- data/spec/dummy/app/views/layouts/application.html.haml +1 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95bac418def0c433f42d41a8734234af61e625ad
|
4
|
+
data.tar.gz: f3ba573ea7eae964bb63bb6485744c43a991a05e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c3d1b56959e2be42989cac80abc057d6674c218c6cb190ea42def9234728160fdf4262c2cf2ae3a52abdfd9d0bd1353d5cb0f2b95322e77c75215d4ff5bdb50
|
7
|
+
data.tar.gz: 7b874ab4a8e73347ba6f40faacfb2319df6bd058d47c3d1b40d2edd48853a5a75c778b6d61087797fceb59590d3b2659565016f2f5bca5d767673ba5f99ccac2
|
data/README.md
CHANGED
@@ -11,6 +11,7 @@ Paid Up is a start-to-finish Stripe subscription engine. You set up the plans an
|
|
11
11
|
* Authorization by CanCanCan
|
12
12
|
* Subscription by Stripe
|
13
13
|
* Roles by Rolify
|
14
|
+
* Uses Google Tag Manager for Google Analytics `dataLayer` object to provide e-commerce analytics.
|
14
15
|
* Assumes you will be using some variety of Bootstrap, and designed to be quite responsive out of the box, but included views can be overridden with custom views.
|
15
16
|
|
16
17
|
## Installation
|
@@ -100,6 +101,16 @@ The resources referred to in your config will need to call `paid_for`, like this
|
|
100
101
|
class Group < ActiveRecord::Base
|
101
102
|
paid_for
|
102
103
|
end
|
104
|
+
|
105
|
+
### Enabling Google Analytics
|
106
|
+
|
107
|
+
In your layout view, include the following code snippet, which will only fire when a subscription is made.
|
108
|
+
|
109
|
+
This needs to go above your call to Google Tag Manager, so that the data in it is available to GTM.
|
110
|
+
|
111
|
+
= paid_up_google_analytics_data_layer
|
112
|
+
|
113
|
+
Doing this will populate the e-commerce data in Google Analytics, but you must also have that feature turned on.
|
103
114
|
|
104
115
|
### Upgrading
|
105
116
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
@@ -17,6 +17,7 @@ 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
|
+
subscription_id = current_user.stripe_data.subscriptions.first.id
|
20
21
|
discount = current_user.stripe_data.discount
|
21
22
|
if !discount.nil? && !discount.coupon.nil? && @plan.amount != 0
|
22
23
|
orig_amount = @plan.amount
|
@@ -28,7 +29,16 @@ module PaidUp
|
|
28
29
|
else
|
29
30
|
money = @plan.money
|
30
31
|
end
|
31
|
-
flash[:
|
32
|
+
flash[:paid_up_google_analytics_data] = {
|
33
|
+
transactionId: subscription_id,
|
34
|
+
transactionTotal: money.dollars,
|
35
|
+
transactionProducts: [
|
36
|
+
sku: @plan.stripe_id,
|
37
|
+
name: @plan.title,
|
38
|
+
price: @plan.money.dollars,
|
39
|
+
quantity: '1'
|
40
|
+
]
|
41
|
+
}
|
32
42
|
redirect_to(
|
33
43
|
subscriptions_path,
|
34
44
|
flash: {
|
data/coverage/.last_run.json
CHANGED
data/coverage/.resultset.json
CHANGED
@@ -405,7 +405,7 @@
|
|
405
405
|
47,
|
406
406
|
null,
|
407
407
|
1,
|
408
|
-
|
408
|
+
4727,
|
409
409
|
null,
|
410
410
|
1,
|
411
411
|
31,
|
@@ -535,7 +535,7 @@
|
|
535
535
|
null,
|
536
536
|
null,
|
537
537
|
null,
|
538
|
-
|
538
|
+
45,
|
539
539
|
null,
|
540
540
|
null,
|
541
541
|
320,
|
@@ -1350,6 +1350,10 @@
|
|
1350
1350
|
4,
|
1351
1351
|
null,
|
1352
1352
|
null,
|
1353
|
+
1,
|
1354
|
+
0,
|
1355
|
+
null,
|
1356
|
+
null,
|
1353
1357
|
null
|
1354
1358
|
],
|
1355
1359
|
"/Users/karen/Gems/paid_up/app/helpers/paid_up/features_helper.rb": [
|
@@ -1773,6 +1777,28 @@
|
|
1773
1777
|
13,
|
1774
1778
|
13,
|
1775
1779
|
13,
|
1780
|
+
13,
|
1781
|
+
13,
|
1782
|
+
3,
|
1783
|
+
3,
|
1784
|
+
3,
|
1785
|
+
3,
|
1786
|
+
3,
|
1787
|
+
3,
|
1788
|
+
null,
|
1789
|
+
10,
|
1790
|
+
null,
|
1791
|
+
13,
|
1792
|
+
null,
|
1793
|
+
null,
|
1794
|
+
null,
|
1795
|
+
null,
|
1796
|
+
null,
|
1797
|
+
null,
|
1798
|
+
null,
|
1799
|
+
null,
|
1800
|
+
null,
|
1801
|
+
13,
|
1776
1802
|
null,
|
1777
1803
|
null,
|
1778
1804
|
null,
|
@@ -2171,15 +2197,15 @@
|
|
2171
2197
|
null,
|
2172
2198
|
null,
|
2173
2199
|
1,
|
2174
|
-
|
2175
|
-
|
2200
|
+
221,
|
2201
|
+
221,
|
2176
2202
|
null,
|
2177
2203
|
0,
|
2178
2204
|
null,
|
2179
2205
|
null,
|
2180
2206
|
null,
|
2181
2207
|
1,
|
2182
|
-
|
2208
|
+
197,
|
2183
2209
|
null,
|
2184
2210
|
null,
|
2185
2211
|
1,
|
@@ -2187,8 +2213,8 @@
|
|
2187
2213
|
null,
|
2188
2214
|
null,
|
2189
2215
|
1,
|
2190
|
-
|
2191
|
-
|
2216
|
+
214,
|
2217
|
+
214,
|
2192
2218
|
null,
|
2193
2219
|
0,
|
2194
2220
|
null,
|
@@ -2201,7 +2227,7 @@
|
|
2201
2227
|
2239,
|
2202
2228
|
null,
|
2203
2229
|
null,
|
2204
|
-
|
2230
|
+
6,
|
2205
2231
|
null,
|
2206
2232
|
null,
|
2207
2233
|
null,
|
@@ -3161,6 +3187,6 @@
|
|
3161
3187
|
null
|
3162
3188
|
]
|
3163
3189
|
},
|
3164
|
-
"timestamp":
|
3190
|
+
"timestamp": 1458155056
|
3165
3191
|
}
|
3166
3192
|
}
|
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.
|
5
|
+
# stub: paid_up 0.10.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "paid_up"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.10.0"
|
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-16"
|
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 = [
|
@@ -53,6 +53,7 @@ Gem::Specification.new do |s|
|
|
53
53
|
"app/views/layouts/mailer.text.haml",
|
54
54
|
"app/views/paid_up/features/_abilities_table.html.haml",
|
55
55
|
"app/views/paid_up/features/_table.html.haml",
|
56
|
+
"app/views/paid_up/layouts/_google_analytics_data_layer.html.haml",
|
56
57
|
"app/views/paid_up/plans/index.html.haml",
|
57
58
|
"app/views/paid_up/subscription_mailer/payment_failed_email.html.haml",
|
58
59
|
"app/views/paid_up/subscription_mailer/payment_failed_email.text.haml",
|
data/spec/dummy/db/test.sqlite3
CHANGED
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.
|
4
|
+
version: 0.10.0
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -417,6 +417,7 @@ files:
|
|
417
417
|
- app/views/layouts/mailer.text.haml
|
418
418
|
- app/views/paid_up/features/_abilities_table.html.haml
|
419
419
|
- app/views/paid_up/features/_table.html.haml
|
420
|
+
- app/views/paid_up/layouts/_google_analytics_data_layer.html.haml
|
420
421
|
- app/views/paid_up/plans/index.html.haml
|
421
422
|
- app/views/paid_up/subscription_mailer/payment_failed_email.html.haml
|
422
423
|
- app/views/paid_up/subscription_mailer/payment_failed_email.text.haml
|