add active merchant and payment schema
This commit is contained in:
parent
69a5d41b79
commit
e8f1645fc2
5 changed files with 44 additions and 0 deletions
3
Gemfile
3
Gemfile
|
|
@ -183,6 +183,9 @@ gem 'faker'
|
||||||
# for seeds
|
# for seeds
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_girl_rails'
|
||||||
|
|
||||||
|
# for online payments
|
||||||
|
gem 'activemerchant'
|
||||||
|
|
||||||
# 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
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,11 @@ GEM
|
||||||
activejob (4.2.5.2)
|
activejob (4.2.5.2)
|
||||||
activesupport (= 4.2.5.2)
|
activesupport (= 4.2.5.2)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.0)
|
||||||
|
activemerchant (1.59.0)
|
||||||
|
activesupport (>= 3.2.14, < 5.1)
|
||||||
|
builder (>= 2.1.2, < 4.0.0)
|
||||||
|
i18n (>= 0.6.9)
|
||||||
|
nokogiri (~> 1.4)
|
||||||
activemodel (4.2.5.2)
|
activemodel (4.2.5.2)
|
||||||
activesupport (= 4.2.5.2)
|
activesupport (= 4.2.5.2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
|
|
@ -529,6 +534,7 @@ PLATFORMS
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_model_serializers
|
active_model_serializers
|
||||||
|
activemerchant
|
||||||
activeuuid
|
activeuuid
|
||||||
acts_as_commentable_with_threading
|
acts_as_commentable_with_threading
|
||||||
acts_as_list
|
acts_as_list
|
||||||
|
|
|
||||||
18
db/migrate/20160606040848_create_payments.rb
Normal file
18
db/migrate/20160606040848_create_payments.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
class CreatePayments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :payments do |t|
|
||||||
|
t.string :first_name
|
||||||
|
t.string :last_name
|
||||||
|
t.string :last4
|
||||||
|
t.decimal :amount, precision: 12, scale: 3
|
||||||
|
t.string :authorization_code
|
||||||
|
t.integer :status, default: 0
|
||||||
|
t.integer :user_id
|
||||||
|
t.integer :conference_id
|
||||||
|
t.datetime :created_at
|
||||||
|
t.datetime :updated_at
|
||||||
|
|
||||||
|
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
|
|
@ -250,6 +250,17 @@ ActiveRecord::Schema.define(version: 20160624151257) do
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "payments", force: :cascade do |t|
|
||||||
|
t.string "first_name"
|
||||||
|
t.string "last_name"
|
||||||
|
t.string "last4"
|
||||||
|
t.decimal "amount", precision: 12, scale: 3
|
||||||
|
t.string "authorization_code"
|
||||||
|
t.integer "status", default: 0
|
||||||
|
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
|
||||||
|
|
@ -396,6 +407,7 @@ ActiveRecord::Schema.define(version: 20160624151257) 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