2017-01-29 20:35:04 -05:00
|
|
|
# name: choice-plugin
|
2017-01-31 21:35:18 -05:00
|
|
|
# about: Integrating Discourse with Stripe
|
|
|
|
# version: 0.0.3
|
2017-01-29 20:35:04 -05:00
|
|
|
# authors: Rimian Perkins
|
2017-01-30 21:28:41 -05:00
|
|
|
|
2017-01-31 19:44:55 -05:00
|
|
|
gem 'stripe', '1.58.0'
|
2017-01-31 19:35:21 -05:00
|
|
|
|
2017-01-31 21:35:18 -05:00
|
|
|
Rails.configuration.stripe = {
|
2017-02-01 19:49:22 -05:00
|
|
|
:publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.config_for(:stripe)['publishable_key'],
|
|
|
|
:secret_key => ENV['STRIPE_SECRET_KEY'] || Rails.application.config_for(:stripe)['secret_key']
|
2017-01-31 21:35:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Stripe.api_key = Rails.configuration.stripe[:secret_key]
|
|
|
|
|
2017-01-30 21:28:41 -05:00
|
|
|
module ::Choice
|
|
|
|
class Engine < ::Rails::Engine
|
|
|
|
engine_name 'choice'
|
|
|
|
isolate_namespace Choice
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
after_initialize do
|
|
|
|
Discourse::Application.routes.prepend do
|
|
|
|
mount ::Choice::Engine, at: '/choice'
|
|
|
|
end
|
|
|
|
end
|