Add missing files

This commit is contained in:
Steve Pettitt
2016-09-05 19:31:40 +01:00
committed by Rob Harrington
parent df18329233
commit 3623325cab
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
module StripeHelper
class << self
attr_accessor :client, :options
end
@options = {
:site => 'https://connect.stripe.com',
:authorize_url => '/oauth/authorize',
:token_url => '/oauth/token'
}
@client = OAuth2::Client.new(
ENV['STRIPE_CLIENT_ID'],
ENV['STRIPE_INSTANCE_SECRET_KEY'],
options
)
def get_token(code, options={params: {scope: 'read_write'}})
@client.get_token(code, options)
end
end

View File

@@ -0,0 +1,5 @@
class StripeAccount < ActiveRecord::Base
belongs_to :enterprise
valdates_presence_of :stripe_user_id, :stripe_publishable_key
validates_uniqueness_of :stripe_user_id
end