2017-02-15 12:36:38 +11:00
|
|
|
# name: discourse-payments
|
2017-02-01 13:35:18 +11:00
|
|
|
# about: Integrating Discourse with Stripe
|
2017-02-20 11:43:12 +11:00
|
|
|
# version: 1.2.0
|
2017-02-15 12:36:38 +11:00
|
|
|
# url: https://github.com/choiceaustralia/discourse-payments
|
2017-01-31 13:28:41 +11:00
|
|
|
|
2017-02-01 11:44:55 +11:00
|
|
|
gem 'stripe', '1.58.0'
|
2017-02-01 11:35:21 +11:00
|
|
|
|
2017-02-15 13:03:58 +11:00
|
|
|
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
|
2017-02-16 16:29:42 +11:00
|
|
|
load File.expand_path('../config/stripe.rb', __FILE__)
|
2017-02-01 13:35:18 +11:00
|
|
|
|
2017-02-17 13:15:32 +11:00
|
|
|
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-07 13:56:22 +11:00
|
|
|
Discourse::Application.routes.prepend do
|
2017-02-15 13:03:58 +11:00
|
|
|
mount ::DiscoursePayments::Engine, at: '/'
|
2017-01-31 13:28:41 +11:00
|
|
|
end
|