30 lines
825 B
Ruby
Raw Normal View History

2019-09-11 19:27:24 +10:00
# frozen_string_literal: true.
2019-09-11 17:13:12 +10:00
# name: Discourse Patrons
2019-09-11 19:18:30 +10:00
# about: Integrates Stripe into Discourse to allow visitors to make payments
# 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
enabled_site_setting :discourse_patrons_enabled
2019-09-11 19:42:59 +10:00
gem 'stripe', '5.1.1'
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 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
end