payola-payments 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/app/assets/javascripts/payola/form.js +1 -0
- data/app/assets/javascripts/payola/subscription_form.js +74 -0
- data/app/controllers/payola/application_controller.rb +1 -2
- data/app/controllers/payola/subscriptions_controller.rb +94 -0
- data/app/models/concerns/payola/plan.rb +50 -0
- data/app/models/payola/subscription.rb +161 -0
- data/app/services/payola/cancel_subscription.rb +12 -0
- data/app/services/payola/change_subscription_plan.rb +29 -0
- data/app/services/payola/create_plan.rb +17 -0
- data/app/services/payola/create_subscription.rb +20 -0
- data/app/services/payola/invoice_failed.rb +42 -0
- data/app/services/payola/invoice_paid.rb +43 -0
- data/app/services/payola/process_subscription.rb +7 -0
- data/app/services/payola/start_subscription.rb +41 -0
- data/app/services/payola/sync_subscription.rb +11 -0
- data/app/services/payola/update_card.rb +27 -0
- data/app/services/payola/update_subscription.rb +11 -0
- data/app/views/payola/subscriptions/_cancel.html.erb +10 -0
- data/app/views/payola/subscriptions/_change_plan.html.erb +10 -0
- data/config/routes.rb +7 -0
- data/db/migrate/20141105043439_create_payola_subscriptions.rb +31 -0
- data/db/migrate/20141106034610_add_currency_to_payola_subscriptions.rb +6 -0
- data/db/migrate/20141107025420_add_guid_to_payola_subscriptions.rb +6 -0
- data/db/migrate/20141109203101_add_stripe_status_to_payola_subscription.rb +5 -0
- data/db/migrate/20141112024805_add_affiliate_id_to_payola_subscriptions.rb +5 -0
- data/db/migrate/20141114032013_add_coupon_code_to_payola_subscriptions.rb +5 -0
- data/db/migrate/20141114154223_add_signed_custom_fields_to_payola_subscription.rb +5 -0
- data/db/migrate/20141114163841_add_addresses_to_payola_subscription.rb +6 -0
- data/lib/payola.rb +11 -0
- data/lib/payola/engine.rb +10 -2
- data/lib/payola/version.rb +1 -1
- data/spec/concerns/plan_spec.rb +43 -0
- data/spec/controllers/payola/subscriptions_controller_spec.rb +148 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/controllers/home_controller.rb +6 -0
- data/spec/dummy/app/controllers/subscribe_controller.rb +11 -0
- data/spec/dummy/app/models/subscription_plan.rb +3 -0
- data/spec/dummy/app/views/home/index.html.erb +7 -0
- data/spec/dummy/app/views/subscribe/index.html.erb +21 -0
- data/spec/dummy/app/views/subscribe/show.html.erb +4 -0
- data/spec/dummy/config/initializers/payola.rb +4 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141105010234_create_subscription_plans.rb +14 -0
- data/spec/dummy/db/schema.rb +51 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +275 -0
- data/spec/dummy/log/test.log +109420 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0e585aeb88c1555ae8f5292f7c7a9068 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1b54952339cbc96811097cee5f8923b4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5afa4bc970e0bc781b3500c696ba25ff +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/664efeb51d1b486dcfc30d142db56f3c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/68a3bbdc64a0729b5896fa1e33fce4b1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/96b1ccdc193a02b2bbea195310262fa5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/aea159adbc0944b120d91d5b578612ba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b20dab973e971c61bc7e334a38453ae0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b83da90cb58011313e13a97a4a41cb6e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c0b954b40f2881a6d286061bc069643e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c5b3877d49b39932a7557611cefca9a6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ca491e325ff6948be9292f701aa4ce64 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d3f4b67cc032016dfeebc71f2148b9dc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d9856638a3c7b9cfd9d1b884e3b33982 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ddba6e841f28d3005e828fbfffd18b74 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/df935e399019055729aa968bd7062096 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ef82c31948061751bb026663b54484e1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f0b5d4bea0c6cdd1904e1e9a0a45532f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/factories/payola_subscriptions.rb +25 -0
- data/spec/factories/subscription_plan.rb +9 -0
- data/spec/models/payola/subscription_spec.rb +50 -0
- data/spec/services/payola/cancel_subscription_spec.rb +29 -0
- data/spec/services/payola/change_subscription_plan_spec.rb +31 -0
- data/spec/services/payola/charge_card_spec.rb +9 -5
- data/spec/services/payola/create_plan_spec.rb +24 -0
- data/spec/services/payola/create_subscription_spec.rb +65 -0
- data/spec/services/payola/invoice_failed_spec.rb +29 -0
- data/spec/services/payola/invoice_paid_spec.rb +49 -0
- data/spec/services/payola/start_subscription_spec.rb +36 -0
- data/spec/services/payola/sync_subscription_spec.rb +14 -0
- data/spec/services/payola/update_card_spec.rb +26 -0
- metadata +95 -30
@@ -0,0 +1,148 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Payola
|
4
|
+
describe SubscriptionsController do
|
5
|
+
before do
|
6
|
+
@plan = create(:subscription_plan)
|
7
|
+
Payola.register_subscribable(@plan.class)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#create' do
|
11
|
+
it "should pass args to CreateSubscription and queue the job" do
|
12
|
+
subscription = double
|
13
|
+
subscription.should_receive(:save).and_return(true)
|
14
|
+
subscription.should_receive(:guid).at_least(1).times.and_return(1)
|
15
|
+
|
16
|
+
CreateSubscription.should_receive(:call).and_return(subscription)
|
17
|
+
Payola.should_receive(:queue!)
|
18
|
+
post :create, plan_class: @plan.plan_class, plan_id: @plan.id, use_route: :payola
|
19
|
+
|
20
|
+
expect(response.status).to eq 200
|
21
|
+
parsed_body = JSON.load(response.body)
|
22
|
+
expect(parsed_body['guid']).to eq 1
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "with an error" do
|
26
|
+
it "should return an error in json" do
|
27
|
+
subscription = double
|
28
|
+
subscription.should_receive(:save).and_return(false)
|
29
|
+
error = double
|
30
|
+
error.should_receive(:full_messages).and_return(['done did broke'])
|
31
|
+
subscription.should_receive(:errors).and_return(error)
|
32
|
+
|
33
|
+
CreateSubscription.should_receive(:call).and_return(subscription)
|
34
|
+
Payola.should_not_receive(:queue!)
|
35
|
+
|
36
|
+
post :create, plan_class: @plan.plan_class, plan_id: @plan.id, use_route: :payola
|
37
|
+
|
38
|
+
expect(response.status).to eq 400
|
39
|
+
parsed_body = JSON.load(response.body)
|
40
|
+
expect(parsed_body['error']).to eq 'done did broke'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '#status' do
|
46
|
+
it "should return 404 if it can't find the subscription" do
|
47
|
+
get :status, guid: 'doesnotexist', use_route: :payola
|
48
|
+
expect(response.status).to eq 404
|
49
|
+
end
|
50
|
+
it "should return json with properties" do
|
51
|
+
subscription = create(:subscription)
|
52
|
+
get :status, guid: subscription.guid, use_route: :payola
|
53
|
+
|
54
|
+
expect(response.status).to eq 200
|
55
|
+
|
56
|
+
parsed_body = JSON.load(response.body)
|
57
|
+
|
58
|
+
expect(parsed_body['guid']).to eq subscription.guid
|
59
|
+
expect(parsed_body['status']).to eq subscription.state
|
60
|
+
expect(parsed_body['error']).to be_nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '#show' do
|
65
|
+
it "should redirect to the product's redirect path" do
|
66
|
+
plan = create(:subscription_plan)
|
67
|
+
subscription = create(:subscription, :plan => plan)
|
68
|
+
get :show, guid: subscription.guid, use_route: :payola
|
69
|
+
|
70
|
+
expect(response).to redirect_to '/'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#destroy' do
|
75
|
+
before :each do
|
76
|
+
@subscription = create(:subscription, :state => :active)
|
77
|
+
end
|
78
|
+
it "call Payola::CancelSubscription and redirect" do
|
79
|
+
Payola::CancelSubscription.should_receive(:call)
|
80
|
+
delete :destroy, :guid => @subscription.guid, use_route: :payola
|
81
|
+
# TODO : Figure out why this needs to be a hardcoded path.
|
82
|
+
# Why doesn't subscription_path(@subscription) work?
|
83
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should redirect with an error if it can't cancel the subscription" do
|
87
|
+
expect(Payola::CancelSubscription).to_not receive(:call)
|
88
|
+
expect_any_instance_of(::ApplicationController).to receive(:payola_can_modify_subscription?).and_return(false)
|
89
|
+
|
90
|
+
delete :destroy, :guid => @subscription.guid, use_route: :payola
|
91
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
92
|
+
expect(request.flash[:alert]).to eq 'You cannot modify this subscription.'
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#change_plan' do
|
97
|
+
before :each do
|
98
|
+
@subscription = create(:subscription, state: :active)
|
99
|
+
@plan = create(:subscription_plan)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should call Payola::ChangeSubscriptionPlan and redirect" do
|
103
|
+
expect(Payola::ChangeSubscriptionPlan).to receive(:call).with(@subscription, @plan)
|
104
|
+
|
105
|
+
post :change_plan, guid: @subscription.guid, plan_class: @plan.plan_class, plan_id: @plan.id, use_route: :payola
|
106
|
+
|
107
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
108
|
+
expect(request.flash[:notice]).to eq 'Subscription plan updated'
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should redirect with an error if it can't cancel the subscription" do
|
112
|
+
expect(Payola::CancelSubscription).to_not receive(:call)
|
113
|
+
expect_any_instance_of(::ApplicationController).to receive(:payola_can_modify_subscription?).and_return(false)
|
114
|
+
|
115
|
+
delete :destroy, :guid => @subscription.guid, use_route: :payola
|
116
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
117
|
+
expect(request.flash[:alert]).to eq 'You cannot modify this subscription.'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#update_card" do
|
122
|
+
before :each do
|
123
|
+
@subscription = create(:subscription, state: :active)
|
124
|
+
@plan = create(:subscription_plan)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should call UpdateCard and redirect" do
|
128
|
+
expect(Payola::UpdateCard).to receive(:call).with(@subscription, 'tok_1234')
|
129
|
+
|
130
|
+
post :update_card, guid: @subscription.guid, stripeToken: 'tok_1234', use_route: :payola
|
131
|
+
|
132
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
133
|
+
expect(request.flash[:notice]).to eq 'Card updated'
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should redirect with an error" do
|
137
|
+
expect(Payola::UpdateCard).to receive(:call).never
|
138
|
+
expect_any_instance_of(::ApplicationController).to receive(:payola_can_modify_subscription?).and_return(false)
|
139
|
+
|
140
|
+
post :update_card, guid: @subscription.guid, stripeToken: 'tok_1234', use_route: :payola
|
141
|
+
|
142
|
+
expect(response).to redirect_to "/subdir/payola/confirm_subscription/#{@subscription.guid}"
|
143
|
+
expect(request.flash[:alert]).to eq 'You cannot modify this subscription.'
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
end
|
@@ -2,4 +2,8 @@ class ApplicationController < ActionController::Base
|
|
2
2
|
# Prevent CSRF attacks by raising an exception.
|
3
3
|
# For APIs, you may want to use :null_session instead.
|
4
4
|
protect_from_forgery with: :exception
|
5
|
+
|
6
|
+
def payola_can_modify_subscription?(subscription)
|
7
|
+
true
|
8
|
+
end
|
5
9
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%#= render 'payola/transactions/checkout', sellable: @product, button_class: 'not-a-class' %>
|
2
|
+
|
3
|
+
<hr>
|
4
|
+
|
5
|
+
<%= form_for @plan, url: '/', method: :post, html: { class: 'payola-subscription-form', 'data-payola-base-path' => '/subdir/payola', 'data-payola-plan-type' => @plan.plan_class, 'data-payola-plan-id' => @plan.id } do |f| %>
|
6
|
+
<span class="payola-payment-error"></span>
|
7
|
+
Email:<br>
|
8
|
+
<input type="email" name="stripeEmail" data-payola="email"></input><br>
|
9
|
+
Card Number<br>
|
10
|
+
<input type="text" data-stripe="number"></input><br>
|
11
|
+
Exp Month<br>
|
12
|
+
<input type="text" data-stripe="exp_month"></input><br>
|
13
|
+
Exp Year<br>
|
14
|
+
<input type="text" data-stripe="exp_year"></input><br>
|
15
|
+
CVC<br>
|
16
|
+
<input type="text" data-stripe="cvc"></input><br>
|
17
|
+
Coupon Code<br>
|
18
|
+
<input type="text" name="coupon" data-payola="coupon"></input><br>
|
19
|
+
<input type="submit"></input>
|
20
|
+
<% end %>
|
21
|
+
|
data/spec/dummy/config/routes.rb
CHANGED
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSubscriptionPlans < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :subscription_plans do |t|
|
4
|
+
t.integer :amount
|
5
|
+
t.string :interval
|
6
|
+
t.integer :interval_count
|
7
|
+
t.string :name
|
8
|
+
t.string :stripe_id
|
9
|
+
t.integer :trial_period_days
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20141114163841) do
|
15
15
|
|
16
16
|
create_table "owners", force: true do |t|
|
17
17
|
t.datetime "created_at"
|
@@ -75,6 +75,45 @@ ActiveRecord::Schema.define(version: 20141029140518) do
|
|
75
75
|
t.datetime "updated_at"
|
76
76
|
end
|
77
77
|
|
78
|
+
create_table "payola_subscriptions", force: true do |t|
|
79
|
+
t.string "plan_type"
|
80
|
+
t.integer "plan_id"
|
81
|
+
t.datetime "start"
|
82
|
+
t.string "status"
|
83
|
+
t.string "owner_type"
|
84
|
+
t.integer "owner_id"
|
85
|
+
t.string "stripe_customer_id"
|
86
|
+
t.boolean "cancel_at_period_end"
|
87
|
+
t.datetime "current_period_start"
|
88
|
+
t.datetime "current_period_end"
|
89
|
+
t.datetime "ended_at"
|
90
|
+
t.datetime "trial_start"
|
91
|
+
t.datetime "trial_end"
|
92
|
+
t.datetime "canceled_at"
|
93
|
+
t.integer "quantity"
|
94
|
+
t.string "stripe_id"
|
95
|
+
t.string "stripe_token"
|
96
|
+
t.string "card_last4"
|
97
|
+
t.date "card_expiration"
|
98
|
+
t.string "card_type"
|
99
|
+
t.text "error"
|
100
|
+
t.string "state"
|
101
|
+
t.string "email"
|
102
|
+
t.datetime "created_at"
|
103
|
+
t.datetime "updated_at"
|
104
|
+
t.string "currency"
|
105
|
+
t.integer "amount"
|
106
|
+
t.string "guid"
|
107
|
+
t.string "stripe_status"
|
108
|
+
t.integer "affiliate_id"
|
109
|
+
t.string "coupon"
|
110
|
+
t.text "signed_custom_fields"
|
111
|
+
t.text "customer_address"
|
112
|
+
t.text "business_address"
|
113
|
+
end
|
114
|
+
|
115
|
+
add_index "payola_subscriptions", ["guid"], name: "index_payola_subscriptions_on_guid"
|
116
|
+
|
78
117
|
create_table "products", force: true do |t|
|
79
118
|
t.string "name"
|
80
119
|
t.string "permalink"
|
@@ -83,4 +122,15 @@ ActiveRecord::Schema.define(version: 20141029140518) do
|
|
83
122
|
t.datetime "updated_at"
|
84
123
|
end
|
85
124
|
|
125
|
+
create_table "subscription_plans", force: true do |t|
|
126
|
+
t.integer "amount"
|
127
|
+
t.string "interval"
|
128
|
+
t.integer "interval_count"
|
129
|
+
t.string "name"
|
130
|
+
t.string "stripe_id"
|
131
|
+
t.integer "trial_period_days"
|
132
|
+
t.datetime "created_at"
|
133
|
+
t.datetime "updated_at"
|
134
|
+
end
|
135
|
+
|
86
136
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -4107,3 +4107,278 @@ Migrating to CreateOwners (20141029140518)
|
|
4107
4107
|
FROM sqlite_temp_master
|
4108
4108
|
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4109
4109
|
|
4110
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4111
|
+
Migrating to CreateSubscriptionPlans (20141105010234)
|
4112
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4113
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "subscription_plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "interval" varchar(255), "interval_count" integer, "name" varchar(255), "stripe_id" varchar(255), "trial_period_days" integer, "created_at" datetime, "updated_at" datetime) [0m
|
4114
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141105010234"]]
|
4115
|
+
[1m[36m (3.2ms)[0m [1mcommit transaction[0m
|
4116
|
+
Migrating to CreatePayolaSubscriptions (20141105043439)
|
4117
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4118
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "payola_subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "plan_type" varchar(255), "plan_id" integer, "start" datetime, "status" varchar(255), "owner_type" varchar(255), "owner_id" integer, "stripe_customer_id" varchar(255), "cancel_at_period_end" boolean, "current_period_start" datetime, "current_period_end" datetime, "ended_at" datetime, "trial_start" datetime, "trial_end" datetime, "canceled_at" datetime, "quantity" integer, "stripe_id" varchar(255), "stripe_token" varchar(255), "card_last4" varchar(255), "card_expiration" date, "card_type" varchar(255), "error" text, "state" varchar(255), "email" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
4119
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141105043439"]]
|
4120
|
+
[1m[36m (0.9ms)[0m [1mcommit transaction[0m
|
4121
|
+
Migrating to AddCurrencyToPayolaSubscriptions (20141106034610)
|
4122
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4123
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "payola_subscriptions" ADD "currency" varchar(255)[0m
|
4124
|
+
[1m[35m (0.1ms)[0m ALTER TABLE "payola_subscriptions" ADD "amount" integer
|
4125
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141106034610"]]
|
4126
|
+
[1m[35m (0.7ms)[0m commit transaction
|
4127
|
+
Migrating to AddGuidToPayolaSubscriptions (20141107025420)
|
4128
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4129
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "payola_subscriptions" ADD "guid" varchar(255)
|
4130
|
+
[1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
4131
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_payola_subscriptions_on_guid" ON "payola_subscriptions" ("guid")
|
4132
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141107025420"]]
|
4133
|
+
[1m[35m (0.8ms)[0m commit transaction
|
4134
|
+
Migrating to AddStripeStatusToPayolaSubscription (20141109203101)
|
4135
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
4136
|
+
[1m[35m (0.8ms)[0m ALTER TABLE "payola_subscriptions" ADD "stripe_status" varchar(255)
|
4137
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141109203101"]]
|
4138
|
+
[1m[35m (0.8ms)[0m commit transaction
|
4139
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4140
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
4141
|
+
FROM sqlite_master
|
4142
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4143
|
+
UNION ALL
|
4144
|
+
SELECT sql
|
4145
|
+
FROM sqlite_temp_master
|
4146
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4147
|
+
|
4148
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4149
|
+
FROM sqlite_master
|
4150
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4151
|
+
UNION ALL
|
4152
|
+
SELECT sql
|
4153
|
+
FROM sqlite_temp_master
|
4154
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4155
|
+
[0m
|
4156
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4157
|
+
FROM sqlite_master
|
4158
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4159
|
+
UNION ALL
|
4160
|
+
SELECT sql
|
4161
|
+
FROM sqlite_temp_master
|
4162
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4163
|
+
|
4164
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4165
|
+
FROM sqlite_master
|
4166
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4167
|
+
UNION ALL
|
4168
|
+
SELECT sql
|
4169
|
+
FROM sqlite_temp_master
|
4170
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4171
|
+
[0m
|
4172
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4173
|
+
FROM sqlite_master
|
4174
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4175
|
+
UNION ALL
|
4176
|
+
SELECT sql
|
4177
|
+
FROM sqlite_temp_master
|
4178
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4179
|
+
|
4180
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4181
|
+
FROM sqlite_master
|
4182
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4183
|
+
UNION ALL
|
4184
|
+
SELECT sql
|
4185
|
+
FROM sqlite_temp_master
|
4186
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4187
|
+
[0m
|
4188
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4189
|
+
FROM sqlite_master
|
4190
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4191
|
+
UNION ALL
|
4192
|
+
SELECT sql
|
4193
|
+
FROM sqlite_temp_master
|
4194
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4195
|
+
|
4196
|
+
|
4197
|
+
|
4198
|
+
Started GET "/" for 127.0.0.1 at 2014-11-13 10:28:29 -0500
|
4199
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4200
|
+
Processing by Rails::WelcomeController#index as HTML
|
4201
|
+
Rendered /Users/peter/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/templates/rails/welcome/index.html.erb (2.3ms)
|
4202
|
+
Completed 200 OK in 8ms (Views: 7.6ms | ActiveRecord: 0.0ms)
|
4203
|
+
|
4204
|
+
|
4205
|
+
Started GET "/" for 127.0.0.1 at 2014-11-13 10:28:31 -0500
|
4206
|
+
Processing by Rails::WelcomeController#index as HTML
|
4207
|
+
Rendered /Users/peter/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/templates/rails/welcome/index.html.erb (0.1ms)
|
4208
|
+
Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
|
4209
|
+
|
4210
|
+
|
4211
|
+
Started GET "/" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4212
|
+
Processing by Rails::WelcomeController#index as HTML
|
4213
|
+
Rendered /Users/peter/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/templates/rails/welcome/index.html.erb (0.1ms)
|
4214
|
+
Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms)
|
4215
|
+
|
4216
|
+
|
4217
|
+
Started GET "/buy" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4218
|
+
Processing by BuyController#index as HTML
|
4219
|
+
[1m[35mProduct Load (0.6ms)[0m SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
|
4220
|
+
Rendered /Users/peter/devel/payola/app/views/payola/transactions/_checkout.html.erb (50.5ms)
|
4221
|
+
Rendered buy/index.html.erb within layouts/application (55.5ms)
|
4222
|
+
Rendered /Users/peter/devel/payola/app/views/payola/transactions/_stripe_header.html.erb (0.4ms)
|
4223
|
+
Completed 200 OK in 179ms (Views: 169.3ms | ActiveRecord: 1.4ms)
|
4224
|
+
|
4225
|
+
|
4226
|
+
Started GET "/assets/payola/checkout_button.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4227
|
+
|
4228
|
+
|
4229
|
+
Started GET "/assets/buy.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4230
|
+
|
4231
|
+
|
4232
|
+
Started GET "/assets/payola/application.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4233
|
+
|
4234
|
+
|
4235
|
+
Started GET "/assets/buy.css?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4236
|
+
|
4237
|
+
|
4238
|
+
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4239
|
+
|
4240
|
+
|
4241
|
+
Started GET "/assets/payola/form.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4242
|
+
|
4243
|
+
|
4244
|
+
Started GET "/assets/payola.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4245
|
+
|
4246
|
+
|
4247
|
+
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-11-13 10:28:32 -0500
|
4248
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4249
|
+
Migrating to AddAffiliateIdToPayolaSubscriptions (20141112024805)
|
4250
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4251
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "payola_subscriptions" ADD "affiliate_id" integer[0m
|
4252
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141112024805"]]
|
4253
|
+
[1m[36m (0.9ms)[0m [1mcommit transaction[0m
|
4254
|
+
Migrating to AddCouponCodeToPayolaSubscriptions (20141114032013)
|
4255
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4256
|
+
[1m[36m (0.5ms)[0m [1mALTER TABLE "payola_subscriptions" ADD "coupon" varchar(255)[0m
|
4257
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141114032013"]]
|
4258
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
4259
|
+
Migrating to AddSignedCustomFieldsToPayolaSubscription (20141114154223)
|
4260
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4261
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "payola_subscriptions" ADD "signed_custom_fields" text[0m
|
4262
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141114154223"]]
|
4263
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
4264
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
4265
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4266
|
+
FROM sqlite_master
|
4267
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4268
|
+
UNION ALL
|
4269
|
+
SELECT sql
|
4270
|
+
FROM sqlite_temp_master
|
4271
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4272
|
+
[0m
|
4273
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4274
|
+
FROM sqlite_master
|
4275
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4276
|
+
UNION ALL
|
4277
|
+
SELECT sql
|
4278
|
+
FROM sqlite_temp_master
|
4279
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4280
|
+
|
4281
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4282
|
+
FROM sqlite_master
|
4283
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4284
|
+
UNION ALL
|
4285
|
+
SELECT sql
|
4286
|
+
FROM sqlite_temp_master
|
4287
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4288
|
+
[0m
|
4289
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4290
|
+
FROM sqlite_master
|
4291
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4292
|
+
UNION ALL
|
4293
|
+
SELECT sql
|
4294
|
+
FROM sqlite_temp_master
|
4295
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4296
|
+
|
4297
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4298
|
+
FROM sqlite_master
|
4299
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4300
|
+
UNION ALL
|
4301
|
+
SELECT sql
|
4302
|
+
FROM sqlite_temp_master
|
4303
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4304
|
+
[0m
|
4305
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4306
|
+
FROM sqlite_master
|
4307
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4308
|
+
UNION ALL
|
4309
|
+
SELECT sql
|
4310
|
+
FROM sqlite_temp_master
|
4311
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4312
|
+
|
4313
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
4314
|
+
FROM sqlite_master
|
4315
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4316
|
+
UNION ALL
|
4317
|
+
SELECT sql
|
4318
|
+
FROM sqlite_temp_master
|
4319
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4320
|
+
[0m
|
4321
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4322
|
+
Migrating to AddAddressesToPayolaSubscription (20141114163841)
|
4323
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4324
|
+
[1m[36m (0.5ms)[0m [1mALTER TABLE "payola_subscriptions" ADD "customer_address" text[0m
|
4325
|
+
[1m[35m (0.2ms)[0m ALTER TABLE "payola_subscriptions" ADD "business_address" text
|
4326
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141114163841"]]
|
4327
|
+
[1m[35m (1.2ms)[0m commit transaction
|
4328
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4329
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
4330
|
+
FROM sqlite_master
|
4331
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4332
|
+
UNION ALL
|
4333
|
+
SELECT sql
|
4334
|
+
FROM sqlite_temp_master
|
4335
|
+
WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
|
4336
|
+
|
4337
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4338
|
+
FROM sqlite_master
|
4339
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4340
|
+
UNION ALL
|
4341
|
+
SELECT sql
|
4342
|
+
FROM sqlite_temp_master
|
4343
|
+
WHERE name='index_payola_sales_on_stripe_customer_id' AND type='index'
|
4344
|
+
[0m
|
4345
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4346
|
+
FROM sqlite_master
|
4347
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4348
|
+
UNION ALL
|
4349
|
+
SELECT sql
|
4350
|
+
FROM sqlite_temp_master
|
4351
|
+
WHERE name='index_payola_sales_on_product' AND type='index'
|
4352
|
+
|
4353
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4354
|
+
FROM sqlite_master
|
4355
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4356
|
+
UNION ALL
|
4357
|
+
SELECT sql
|
4358
|
+
FROM sqlite_temp_master
|
4359
|
+
WHERE name='index_payola_sales_on_guid' AND type='index'
|
4360
|
+
[0m
|
4361
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4362
|
+
FROM sqlite_master
|
4363
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4364
|
+
UNION ALL
|
4365
|
+
SELECT sql
|
4366
|
+
FROM sqlite_temp_master
|
4367
|
+
WHERE name='index_payola_sales_on_email' AND type='index'
|
4368
|
+
|
4369
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4370
|
+
FROM sqlite_master
|
4371
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4372
|
+
UNION ALL
|
4373
|
+
SELECT sql
|
4374
|
+
FROM sqlite_temp_master
|
4375
|
+
WHERE name='index_payola_sales_on_coupon_id' AND type='index'
|
4376
|
+
[0m
|
4377
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4378
|
+
FROM sqlite_master
|
4379
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4380
|
+
UNION ALL
|
4381
|
+
SELECT sql
|
4382
|
+
FROM sqlite_temp_master
|
4383
|
+
WHERE name='index_payola_subscriptions_on_guid' AND type='index'
|
4384
|
+
|