From 4287e8aa5d48bd24e9c975eae076d926688f2d7a Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Fri, 13 Sep 2019 13:52:41 +1000 Subject: [PATCH] load model --- .../discourse/components/donation-form.js.es6 | 14 ++++++-------- plugin.rb | 12 ++++++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/assets/javascripts/discourse/components/donation-form.js.es6 b/assets/javascripts/discourse/components/donation-form.js.es6 index 42d59cf..0ed310f 100644 --- a/assets/javascripts/discourse/components/donation-form.js.es6 +++ b/assets/javascripts/discourse/components/donation-form.js.es6 @@ -38,15 +38,13 @@ export default Ember.Component.extend({ receiptEmail: this.receiptEmail }; - this.stripePaymentHandler(data).then( - paymentIntent => { - if (paymentIntent.error) { - this.set("paymentError", paymentIntent.error); - } else { - this.paymentSuccessHandler(); - } + this.stripePaymentHandler(data).then(paymentIntent => { + if (paymentIntent.error) { + this.set("paymentError", paymentIntent.error); + } else { + this.paymentSuccessHandler(); } - ); + }); } } }); diff --git a/plugin.rb b/plugin.rb index 8d972f7..a08eca0 100644 --- a/plugin.rb +++ b/plugin.rb @@ -2,7 +2,7 @@ # name: discourse-patrons # about: Integrates Stripe into Discourse to allow visitors to make payments -# version: 1.0.0 +# version: 1.1.0 # url: https://github.com/rimian/discourse-patrons # authors: Rimian Perkins @@ -25,9 +25,13 @@ after_initialize do ::Stripe.api_version = "2019-08-14" ::Stripe.set_app_info('Discourse Patrons', version: '1.0.0', url: 'https://github.com/rimian/discourse-patrons') - load File.expand_path('../lib/discourse_patrons/engine.rb', __FILE__) - load File.expand_path('../config/routes.rb', __FILE__) - load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__) + [ + "../lib/discourse_patrons/engine", + "../config/routes", + "../app/controllers/patrons_controller", + "../app/models/payment", + ].each { |path| require File.expand_path(path, __FILE__) } + Discourse::Application.routes.append do mount ::DiscoursePatrons::Engine, at: 'patrons'