add stripe-gem and payment schema
This commit is contained in:
parent
2b4bf2fff7
commit
b639d2eec5
5 changed files with 37 additions and 0 deletions
3
Gemfile
3
Gemfile
|
|
@ -184,6 +184,9 @@ gem 'faker'
|
||||||
# for seeds
|
# for seeds
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_girl_rails'
|
||||||
|
|
||||||
|
# for integrating Stripe payment gateway
|
||||||
|
gem 'stripe'
|
||||||
|
|
||||||
# Use guard and spring for testing in development
|
# Use guard and spring for testing in development
|
||||||
group :development do
|
group :development do
|
||||||
# to launch specs when files are modified
|
# to launch specs when files are modified
|
||||||
|
|
|
||||||
|
|
@ -481,6 +481,8 @@ GEM
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sqlite3 (1.3.9)
|
sqlite3 (1.3.9)
|
||||||
|
stripe (1.43.0)
|
||||||
|
rest-client (~> 1.4)
|
||||||
term-ansicolor (1.3.2)
|
term-ansicolor (1.3.2)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
|
|
@ -615,6 +617,7 @@ DEPENDENCIES
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
spring-commands-rspec
|
spring-commands-rspec
|
||||||
sqlite3
|
sqlite3
|
||||||
|
stripe
|
||||||
timecop
|
timecop
|
||||||
transitions
|
transitions
|
||||||
turbolinks
|
turbolinks
|
||||||
|
|
|
||||||
14
db/migrate/20160606040848_create_payments.rb
Normal file
14
db/migrate/20160606040848_create_payments.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
class CreatePayments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :payments do |t|
|
||||||
|
t.string :last4, null: false
|
||||||
|
t.integer :amount, null: false
|
||||||
|
t.string :authorization_code, null: false
|
||||||
|
t.integer :status, default: 0, null: false
|
||||||
|
t.integer :user_id, null: false
|
||||||
|
t.integer :conference_id, null: false
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddPaymentIdToTicketPurchases < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :ticket_purchases, :payment_id, :integer
|
||||||
|
end
|
||||||
|
end
|
||||||
12
db/schema.rb
12
db/schema.rb
|
|
@ -263,6 +263,17 @@ ActiveRecord::Schema.define(version: 20160704092023) do
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "payments", force: :cascade do |t|
|
||||||
|
t.string "last4", null: false
|
||||||
|
t.integer "amount", null: false
|
||||||
|
t.string "authorization_code", null: false
|
||||||
|
t.integer "status", default: 0, null: false
|
||||||
|
t.integer "user_id", null: false
|
||||||
|
t.integer "conference_id", null: false
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "programs", force: :cascade do |t|
|
create_table "programs", force: :cascade do |t|
|
||||||
t.integer "conference_id"
|
t.integer "conference_id"
|
||||||
t.integer "rating", default: 0
|
t.integer "rating", default: 0
|
||||||
|
|
@ -423,6 +434,7 @@ ActiveRecord::Schema.define(version: 20160704092023) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.integer "quantity", default: 1
|
t.integer "quantity", default: 1
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
t.integer "payment_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "tickets", force: :cascade do |t|
|
create_table "tickets", force: :cascade do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue