2019-09-11 19:55:35 +10:00
|
|
|
# frozen_string_literal: true
|
2019-09-11 19:27:24 +10:00
|
|
|
|
2019-09-12 09:25:06 +10:00
|
|
|
# name: discourse-patrons
|
2019-09-11 19:18:30 +10:00
|
|
|
# about: Integrates Stripe into Discourse to allow visitors to make payments
|
2019-09-11 13:19:07 +10:00
|
|
|
# version: 1.0.0
|
2019-09-11 19:18:30 +10:00
|
|
|
# url: https://github.com/rimian/discourse-patrons
|
2019-09-11 19:11:02 +10:00
|
|
|
# authors: Rimian Perkins
|
2017-01-31 13:28:41 +11:00
|
|
|
|
2019-09-11 13:19:07 +10:00
|
|
|
enabled_site_setting :discourse_patrons_enabled
|
2017-02-01 11:35:21 +11:00
|
|
|
|
2019-09-11 19:42:59 +10:00
|
|
|
gem 'stripe', '5.1.1'
|
2019-09-11 19:18:30 +10:00
|
|
|
|
2019-09-11 21:14:48 +10:00
|
|
|
register_asset "stylesheets/common/discourse-patrons.scss"
|
|
|
|
register_asset "stylesheets/mobile/discourse-patrons.scss"
|
|
|
|
|
2019-09-11 19:18:30 +10:00
|
|
|
register_html_builder('server:before-head-close') do
|
|
|
|
"<script src='https://js.stripe.com/v3/'></script>"
|
|
|
|
end
|
|
|
|
|
|
|
|
extend_content_security_policy(
|
|
|
|
script_src: ['https://js.stripe.com/v3/']
|
|
|
|
)
|
|
|
|
|
2019-09-11 17:13:12 +10:00
|
|
|
after_initialize do
|
2019-09-11 21:14:48 +10:00
|
|
|
::Stripe.api_version = "2019-08-14"
|
|
|
|
::Stripe.set_app_info('Discourse Patrons', version: '1.0.0', url: 'https://github.com/rimian/discourse-patrons')
|
|
|
|
|
2019-09-11 18:32:09 +10:00
|
|
|
load File.expand_path('../lib/discourse_patrons/engine.rb', __FILE__)
|
2019-09-11 17:13:12 +10:00
|
|
|
load File.expand_path('../config/routes.rb', __FILE__)
|
|
|
|
load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__)
|
2019-09-11 18:32:09 +10:00
|
|
|
|
|
|
|
Discourse::Application.routes.append do
|
|
|
|
mount ::DiscoursePatrons::Engine, at: 'patrons'
|
|
|
|
end
|
2017-02-17 13:15:32 +11:00
|
|
|
end
|