add the third party js my registering some html in the header

This commit is contained in:
Rimian Perkins 2017-02-17 13:15:32 +11:00
parent d88b473af7
commit 00cf25ee65
1 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,20 @@ gem 'stripe', '1.58.0'
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
load File.expand_path('../config/stripe.rb', __FILE__)
after_initialize do
header_script = '<script src="https://js.stripe.com/v3/"></script>'
discourse_payments_customization = SiteCustomization.find_or_create_by({
name: 'Discourse Payments Header',
header: header_script,
mobile_header: header_script,
enabled: true,
user_id: -1
})
SiteCustomization.where(name: discourse_payments_customization.name).where.not(id: discourse_payments_customization.id).delete_all
end
Discourse::Application.routes.prepend do
mount ::DiscoursePayments::Engine, at: '/'
end