paid_up 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/VERSION +1 -1
- data/app/views/paid_up/subscriptions/new.html.haml +40 -39
- data/paid_up.gemspec +2 -3
- metadata +1 -2
- data/spec/dummy/README.rdoc +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c66f7ed0a41dc76ac3a5f51f2c09fd5169eb3399
|
4
|
+
data.tar.gz: c01529233b85027b257b3a649e3740e03aa8c27e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0622e0a8944780f09e3d3d77cbbe98c5508650ec263a32e5fe725069b547a3a107d7cd7e7ae8607702761dbf433c38dd65b6a50d0f002f558a2a8c3e470c26e3
|
7
|
+
data.tar.gz: 27739dca3abfae4706a5989493b74d5554bff9b09d668eb4bf465a4e0ff4ce842527aa750679e0a4fcf5af5309ba5a69c57a15ba5088a31eeb3c62319ae79028
|
data/README.md
CHANGED
@@ -46,6 +46,13 @@ Features Setup
|
|
46
46
|
|
47
47
|
Set up each `PaidUp::Feature` using your own admin, the console, or seed data. Associate the features with the corresponding plans using the `PaidUp::FeaturesPlan` joining table model. For example, check out the seeds files in [`spec/dummy/db/seeds/`](spec/dummy/db/seeds/)
|
48
48
|
|
49
|
+
Enabling Javascript
|
50
|
+
----------------------------
|
51
|
+
|
52
|
+
In order for PaidUp's AJAX functionality to work, you will need to add this to your layout file, preferably at the very end of the <body> element (for speed reasons):
|
53
|
+
|
54
|
+
= render_footer_javascript
|
55
|
+
|
49
56
|
Contributing to Paid Up
|
50
57
|
----------------------------
|
51
58
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
@@ -54,48 +54,49 @@
|
|
54
54
|
%button#submit-button.form-control.btn.btn-info
|
55
55
|
=:subscribe.l
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
- add_footer_javascript do
|
58
|
+
javascript:
|
59
|
+
function stripeResponseHandler(status, response) {
|
60
|
+
var $form = $('#payment-form');
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
62
|
+
if (response.error) {
|
63
|
+
// Show the errors on the form
|
64
|
+
$form.find('.payment-errors').text(response.error.message);
|
65
|
+
$('#submit-button').prop('disabled', false);
|
66
|
+
} else {
|
67
|
+
// response contains id and card, which contains additional card details
|
68
|
+
var token = response.id;
|
69
|
+
// Insert the token into the form so it gets submitted to the server
|
70
|
+
$form.append($('<input type="hidden" name="stripeToken" />').val(token));
|
71
|
+
// and submit
|
72
|
+
$form.get(0).submit();
|
73
|
+
}
|
74
|
+
};
|
75
|
+
// This identifies your website in the createToken call below
|
76
|
+
$('#payment-form').submit(function() {
|
77
|
+
// Disable the submit button to prevent repeated clicks
|
78
|
+
$('#submit-button').prop('disabled', true);
|
78
79
|
|
79
|
-
|
80
|
-
|
80
|
+
if($("input:radio[name='card']:checked").val() == 'stripeToken') {
|
81
|
+
var $form = $(this);
|
81
82
|
|
82
|
-
|
83
|
-
|
83
|
+
Stripe.setPublishableKey('#{Rails.configuration.stripe[:publishable_key]}')
|
84
|
+
Stripe.card.createToken($form, stripeResponseHandler);
|
84
85
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
// Prevent the form from submitting with the default action
|
87
|
+
return false;
|
88
|
+
}
|
89
|
+
});
|
89
90
|
|
90
|
-
- if current_user.cards.count > 0
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
91
|
+
- if current_user.cards.count > 0
|
92
|
+
:javascript
|
93
|
+
$( document ).ready(function() {
|
94
|
+
$("input:radio[name='card']").change(function() {
|
95
|
+
if($("input:radio[name='card']:checked").val() == 'stripeToken') {
|
96
|
+
$('#new-card').show();
|
97
|
+
} else {
|
98
|
+
$('#new-card').hide();
|
99
|
+
}
|
100
|
+
});
|
101
|
+
$('#new-card').hide();
|
101
102
|
});
|
data/paid_up.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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.1.
|
5
|
+
# stub: paid_up 0.1.7 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "paid_up"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.7"
|
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"]
|
@@ -82,7 +82,6 @@ Gem::Specification.new do |s|
|
|
82
82
|
"paid_up.gemspec",
|
83
83
|
"spec/controllers/paid_up/plans_spec.rb",
|
84
84
|
"spec/controllers/paid_up/subscriptions_spec.rb",
|
85
|
-
"spec/dummy/README.rdoc",
|
86
85
|
"spec/dummy/Rakefile",
|
87
86
|
"spec/dummy/app/assets/javascripts/application.js",
|
88
87
|
"spec/dummy/app/assets/stylesheets/application.css.scss",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paid_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Lundgren
|
@@ -348,7 +348,6 @@ files:
|
|
348
348
|
- paid_up.gemspec
|
349
349
|
- spec/controllers/paid_up/plans_spec.rb
|
350
350
|
- spec/controllers/paid_up/subscriptions_spec.rb
|
351
|
-
- spec/dummy/README.rdoc
|
352
351
|
- spec/dummy/Rakefile
|
353
352
|
- spec/dummy/app/assets/javascripts/application.js
|
354
353
|
- spec/dummy/app/assets/stylesheets/application.css.scss
|
data/spec/dummy/README.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|