mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Add missing files
This commit is contained in:
committed by
Rob Harrington
parent
df18329233
commit
3623325cab
19
app/helpers/admin/stripe_helper.rb
Normal file
19
app/helpers/admin/stripe_helper.rb
Normal 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
|
||||
5
app/models/stripe_account.rb
Normal file
5
app/models/stripe_account.rb
Normal 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
|
||||
Reference in New Issue
Block a user