diff --git a/plugin.rb b/plugin.rb index f57e18b..36b4b7b 100644 --- a/plugin.rb +++ b/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 = '' + + 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