2017-02-23 20:42:59 -05:00
|
|
|
# name: discourse-donations
|
|
|
|
# about: Integrating Discourse with Stripe for donations
|
2017-04-25 22:06:33 -04:00
|
|
|
# version: 1.9.0
|
2017-02-23 20:42:59 -05:00
|
|
|
# url: https://github.com/choiceaustralia/discourse-donations
|
2017-02-22 18:31:30 -05:00
|
|
|
# authors: Rimian Perkins
|
2017-01-30 21:28:41 -05:00
|
|
|
|
2017-04-19 21:11:56 -04:00
|
|
|
gem 'stripe', '2.4.0'
|
2017-01-31 19:35:21 -05:00
|
|
|
|
2017-02-23 21:23:11 -05:00
|
|
|
load File.expand_path('../lib/discourse_donations/engine.rb', __FILE__)
|
2017-02-26 20:07:21 -05:00
|
|
|
|
2017-02-27 21:36:41 -05:00
|
|
|
enabled_site_setting :discourse_donations_enabled
|
|
|
|
|
2017-02-16 21:15:32 -05:00
|
|
|
after_initialize do
|
2017-04-27 02:35:28 -04:00
|
|
|
load File.expand_path('../app/jobs/award_group.rb', __FILE__)
|
2017-04-27 04:47:27 -04:00
|
|
|
load File.expand_path('../app/jobs/grant_badge.rb', __FILE__)
|
2017-04-27 02:35:28 -04:00
|
|
|
|
2017-03-02 18:17:38 -05:00
|
|
|
# Must be placed on every page for fraud protection.
|
|
|
|
header_script = '<script src="https://js.stripe.com/v3/"></script>'
|
2017-04-18 22:51:15 -04:00
|
|
|
discourse_donations_theme = Theme.find_or_create_by(name: 'Discourse Donations Header', hidden: false, user_id: -1)
|
|
|
|
discourse_donations_theme.set_field('common', 'head_tag', header_script)
|
2017-04-18 22:51:15 -04:00
|
|
|
discourse_donations_theme.save
|
2017-02-16 21:15:32 -05:00
|
|
|
end
|
|
|
|
|
2017-02-06 21:56:22 -05:00
|
|
|
Discourse::Application.routes.prepend do
|
2017-02-23 21:23:11 -05:00
|
|
|
mount ::DiscourseDonations::Engine, at: '/'
|
2017-01-30 21:28:41 -05:00
|
|
|
end
|