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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a3e16ad648fd8bc7db5e92fd6cac5033bfb0830
4
- data.tar.gz: e74f0aba713e60bf77c89cfaf5fed529d0e1f8d3
3
+ metadata.gz: c66f7ed0a41dc76ac3a5f51f2c09fd5169eb3399
4
+ data.tar.gz: c01529233b85027b257b3a649e3740e03aa8c27e
5
5
  SHA512:
6
- metadata.gz: af8b82f81b92ae62a47a7db1b0cb968814bdabae1ad77e156fa0d683c92374bbf95f29229a828ed65aff4329331a24aa25625096b63beb0ca91ddbfeee3290c3
7
- data.tar.gz: 38500df8f4688fb0cecdb45a2d34cac8df372099ac81028801da3708ce9cea1411d500a53dad0b71c2af469d5d47bdc7a6586065205cfe571c38c703cfd44f09
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.6
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
- :javascript
58
- function stripeResponseHandler(status, response) {
59
- var $form = $('#payment-form');
57
+ - add_footer_javascript do
58
+ javascript:
59
+ function stripeResponseHandler(status, response) {
60
+ var $form = $('#payment-form');
60
61
 
61
- if (response.error) {
62
- // Show the errors on the form
63
- $form.find('.payment-errors').text(response.error.message);
64
- $('#submit-button').prop('disabled', false);
65
- } else {
66
- // response contains id and card, which contains additional card details
67
- var token = response.id;
68
- // Insert the token into the form so it gets submitted to the server
69
- $form.append($('<input type="hidden" name="stripeToken" />').val(token));
70
- // and submit
71
- $form.get(0).submit();
72
- }
73
- };
74
- // This identifies your website in the createToken call below
75
- $('#payment-form').submit(function() {
76
- // Disable the submit button to prevent repeated clicks
77
- $('#submit-button').prop('disabled', true);
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
- if($("input:radio[name='card']:checked").val() == 'stripeToken') {
80
- var $form = $(this);
80
+ if($("input:radio[name='card']:checked").val() == 'stripeToken') {
81
+ var $form = $(this);
81
82
 
82
- Stripe.setPublishableKey('#{Rails.configuration.stripe[:publishable_key]}')
83
- Stripe.card.createToken($form, stripeResponseHandler);
83
+ Stripe.setPublishableKey('#{Rails.configuration.stripe[:publishable_key]}')
84
+ Stripe.card.createToken($form, stripeResponseHandler);
84
85
 
85
- // Prevent the form from submitting with the default action
86
- return false;
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
- :javascript
92
- $( document ).ready(function() {
93
- $("input:radio[name='card']").change(function() {
94
- if($("input:radio[name='card']:checked").val() == 'stripeToken') {
95
- $('#new-card').show();
96
- } else {
97
- $('#new-card').hide();
98
- }
99
- });
100
- $('#new-card').hide();
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.6 ruby lib
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.6"
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.6
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
@@ -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>.