2017-02-14 20:36:38 -05:00
|
|
|
# name: discourse-payments
|
2017-01-31 21:35:18 -05:00
|
|
|
# about: Integrating Discourse with Stripe
|
2017-02-14 21:03:58 -05:00
|
|
|
# version: 1.1.0
|
2017-02-14 20:36:38 -05:00
|
|
|
# url: https://github.com/choiceaustralia/discourse-payments
|
2017-01-30 21:28:41 -05:00
|
|
|
|
2017-01-31 19:44:55 -05:00
|
|
|
gem 'stripe', '1.58.0'
|
2017-01-31 19:35:21 -05:00
|
|
|
|
2017-02-14 21:03:58 -05:00
|
|
|
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
|
2017-02-16 00:29:42 -05:00
|
|
|
load File.expand_path('../config/stripe.rb', __FILE__)
|
2017-01-31 21:35:18 -05:00
|
|
|
|
2017-02-16 21:15:32 -05: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-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
|