Skip to content

Commit 77ac411

Browse files
committed
Adds fake auth and fake validation
1 parent 06c2ccb commit 77ac411

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ gem 'sdoc', '~> 0.4.0', group: :doc
3232
# Use Capistrano for deployment
3333
# gem 'capistrano-rails', group: :development
3434

35+
gem 'httparty'
36+
3537
group :development, :test do
3638
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
3739
gem 'rspec'

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ GEM
5858
ffi (1.9.23)
5959
globalid (0.4.1)
6060
activesupport (>= 4.2.0)
61+
httparty (0.13.5)
62+
json (~> 1.8)
63+
multi_xml (>= 0.5.2)
6164
i18n (0.9.5)
6265
concurrent-ruby (~> 1.0)
6366
jbuilder (2.7.0)
@@ -78,6 +81,7 @@ GEM
7881
mini_portile2 (2.3.0)
7982
minitest (5.11.3)
8083
multi_json (1.13.1)
84+
multi_xml (0.5.5)
8185
nio4r (2.3.0)
8286
nokogiri (1.8.2)
8387
mini_portile2 (~> 2.3.0)
@@ -173,6 +177,7 @@ PLATFORMS
173177

174178
DEPENDENCIES
175179
coffee-rails
180+
httparty
176181
jbuilder (~> 2.0)
177182
jquery-rails
178183
pg (~> 0.18)

app/controllers/subscriptions_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
class SubscriptionsController < ApiController
22

33
def create
4-
new_sub_request = HTTParty.request
4+
authed_session = HTTParty.get('https://gist.github.com/freezepl/2a75c29c881982645156f5ccf8d1b139')
5+
new_sub_request = HTTParty.get("https://gist.github.com/freezepl/2a75c29c881982645156f5ccf8d1b139/validate")
56
new_sub_response = JSON.parse(new_sub_request)
67

78
if new_sub_response == response_ok
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddPaymentIdToSubscriptions < ActiveRecord::Migration[5.1]
2+
def change
3+
add_column :subscriptions, :payment_id, :string
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20180403151752) do
13+
ActiveRecord::Schema.define(version: 20180403170913) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"
@@ -25,6 +25,7 @@
2525
t.integer "cc_code"
2626
t.datetime "created_at"
2727
t.datetime "updated_at"
28+
t.string "payment_id"
2829
t.index ["user_id"], name: "index_subscriptions_on_user_id"
2930
end
3031

0 commit comments

Comments
 (0)