payola-payments 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/payola/subscription_checkout_button.js +87 -0
- data/app/models/payola/subscription.rb +1 -1
- data/app/services/payola/create_plan.rb +6 -0
- data/app/services/payola/start_subscription.rb +17 -7
- data/app/views/payola/subscriptions/_checkout.html.erb +78 -0
- data/app/views/payola/transactions/_checkout.html.erb +8 -6
- data/lib/payola/version.rb +1 -1
- data/spec/dummy/app/views/subscribe/index.html.erb +1 -1
- data/spec/dummy/log/test.log +50635 -0
- data/spec/models/payola/subscription_spec.rb +4 -4
- data/spec/services/payola/create_plan_spec.rb +6 -0
- metadata +4 -2
@@ -15,13 +15,13 @@ module Payola
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should validate lack of email" do
|
18
|
-
|
19
|
-
expect(
|
18
|
+
subscription = build(:subscription, email: nil)
|
19
|
+
expect(subscription.valid?).to be false
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should validate stripe_token" do
|
23
|
-
|
24
|
-
expect(
|
23
|
+
subscription = build(:subscription, stripe_token: nil)
|
24
|
+
expect(subscription.valid?).to be false
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -27,6 +27,12 @@ module Payola
|
|
27
27
|
plan = Stripe::Plan.retrieve(our_plan.stripe_id)
|
28
28
|
expect(plan.interval_count).to be_nil
|
29
29
|
end
|
30
|
+
|
31
|
+
it "should skip creating a plan if there is already a plan with that stripe id" do
|
32
|
+
expect(Stripe::Plan).to_not receive(:create)
|
33
|
+
|
34
|
+
Payola::CreatePlan.call(@subscription_plan)
|
35
|
+
end
|
30
36
|
end
|
31
37
|
|
32
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payola-payments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Keen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- app/assets/javascripts/payola/application.js
|
177
177
|
- app/assets/javascripts/payola/checkout_button.js
|
178
178
|
- app/assets/javascripts/payola/form.js
|
179
|
+
- app/assets/javascripts/payola/subscription_checkout_button.js
|
179
180
|
- app/assets/javascripts/payola/subscription_form_onestep.js
|
180
181
|
- app/assets/javascripts/payola/subscription_form_twostep.js
|
181
182
|
- app/assets/stylesheets/payola/application.css
|
@@ -225,6 +226,7 @@ files:
|
|
225
226
|
- app/views/payola/receipt_mailer/refund.html.erb
|
226
227
|
- app/views/payola/subscriptions/_cancel.html.erb
|
227
228
|
- app/views/payola/subscriptions/_change_plan.html.erb
|
229
|
+
- app/views/payola/subscriptions/_checkout.html.erb
|
228
230
|
- app/views/payola/transactions/_checkout.html.erb
|
229
231
|
- app/views/payola/transactions/_form.html.erb
|
230
232
|
- app/views/payola/transactions/_stripe_header.html.erb
|