add the third party js my registering some html in the header
This commit is contained in:
parent
d88b473af7
commit
00cf25ee65
14
plugin.rb
14
plugin.rb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue