discourse-subscriptions/plugin.rb

28 lines
835 B
Ruby
Raw Normal View History

2017-02-14 20:36:38 -05:00
# name: discourse-payments
# about: Integrating Discourse with Stripe
2017-02-19 19:43:12 -05:00
# version: 1.2.0
2017-02-14 20:36:38 -05:00
# url: https://github.com/choiceaustralia/discourse-payments
2017-01-30 21:28:41 -05:00
gem 'stripe', '1.58.0'
2017-02-14 21:03:58 -05:00
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
2017-02-06 21:56:22 -05:00
Discourse::Application.routes.prepend do
2017-02-14 21:03:58 -05:00
mount ::DiscoursePayments::Engine, at: '/'
2017-01-30 21:28:41 -05:00
end