diff --git a/Gemfile b/Gemfile index cdb29cbbd3..f0d5362f66 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'spree_auth_devise', github: 'openfoodfoundation/spree_auth_devise', branch: # - Change type of password from string to password to hide it in the form gem 'spree_paypal_express', :github => "openfoodfoundation/better_spree_paypal_express", :branch => "spree-upgrade-intermediate" #gem 'spree_paypal_express', :github => "spree-contrib/better_spree_paypal_express", :branch => "1-3-stable" +gem 'stripe', '~>1.51.0' gem 'delayed_job_active_record' gem 'daemons' diff --git a/Gemfile.lock b/Gemfile.lock index b02f75d716..46c2224f26 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -271,6 +271,8 @@ GEM devise (>= 2.1.0) diff-lcs (1.2.4) diffy (3.1.0) + domain_name (0.5.20160615) + unf (>= 0.0.5, < 1.0.0) em-websocket (0.5.0) eventmachine (>= 0.12.9) http_parser.rb (~> 0.5.3) @@ -429,6 +431,8 @@ GEM tilt highline (1.6.15) hike (1.2.3) + http-cookie (1.0.2) + domain_name (~> 0.5) http_parser.rb (0.5.3) httparty (0.9.0) multi_json (~> 1.0) @@ -480,6 +484,7 @@ GEM i18n (~> 0.6.0) multi_json (1.12.1) multi_xml (0.6.0) + netrc (0.11.0) newrelic_rpm (3.12.0.288) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) @@ -573,6 +578,10 @@ GEM representative_view (1.2.2) actionpack (> 2.3.0, < 4.0.0) representative (~> 1.0.2) + rest-client (2.0.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) roadie (3.0.1) css_parser (~> 1.3.4) nokogiri (~> 1.6.0) @@ -629,6 +638,8 @@ GEM tilt (~> 1.1, != 1.3.0) state_machine (1.2.0) stringex (1.3.3) + stripe (1.51.0) + rest-client (>= 1.4, < 3.0) therubyracer (0.12.0) libv8 (~> 3.16.14.0) ref @@ -650,6 +661,9 @@ GEM execjs (>= 0.3.0) json (>= 1.8.0) unicode-display_width (1.3.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.2) unicorn (4.9.0) kgio (~> 2.6) rack @@ -762,6 +776,7 @@ DEPENDENCIES spree_auth_devise! spree_i18n! spree_paypal_express! + stripe (~> 1.51.0) therubyracer timecop truncate_html diff --git a/db/migrate/20160828115018_create_stripe_accounts.rb b/db/migrate/20160828115018_create_stripe_accounts.rb new file mode 100644 index 0000000000..56ab206540 --- /dev/null +++ b/db/migrate/20160828115018_create_stripe_accounts.rb @@ -0,0 +1,12 @@ +class CreateStripeAccounts < ActiveRecord::Migration + def change + create_table :stripe_accounts do |t| + t.string :stripe_user_id + t.string :stripe_publishable_key + t.timestamps + t.belongs_to :enterprise + end + + add_index :stripe_accounts, :enterprise_id, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 77459f7d73..24eb666244 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1044,6 +1044,16 @@ ActiveRecord::Schema.define(:version => 20170921065259) do t.integer "zone_members_count", :default => 0 end + create_table "stripe_accounts", :force => true do |t| + t.string "stripe_user_id" + t.string "stripe_publishable_key" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "enterprise_id" + end + + add_index "stripe_accounts", ["enterprise_id"], :name => "index_stripe_accounts_on_enterprise_id", :unique => true + create_table "suburbs", :force => true do |t| t.string "name" t.string "postcode"