From 99758dcaa90375be921da37b7b1a8f44e30bc42d Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Tue, 14 Feb 2017 10:28:07 +1100 Subject: [PATCH] change routes --- config/routes.rb | 2 +- config/stripe.rb | 6 ++++++ plugin.rb | 9 +-------- 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 config/stripe.rb diff --git a/config/routes.rb b/config/routes.rb index 6acee15..ca9e6c6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Choice::Engine.routes.draw do get 'stripe' => 'choice#create' get 'choice-form' => 'choice#index' - get 'users/:username/choice' => 'choice#show' + get 'users/:username/payments' => 'choice#show' end diff --git a/config/stripe.rb b/config/stripe.rb new file mode 100644 index 0000000..e46179d --- /dev/null +++ b/config/stripe.rb @@ -0,0 +1,6 @@ +Rails.configuration.stripe = { + :publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.config_for(:stripe)['publishable_key'], + :secret_key => ENV['STRIPE_SECRET_KEY'] || Rails.application.config_for(:stripe)['secret_key'] +} + +Stripe.api_key = Rails.configuration.stripe[:secret_key] diff --git a/plugin.rb b/plugin.rb index 194ef47..0609c17 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,18 +1,11 @@ # name: choice-plugin # about: Integrating Discourse with Stripe -# version: 1.0.0 +# version: 1.0.1 # authors: Rimian Perkins # url: https://github.com/choiceaustralia/choice-discourse gem 'stripe', '1.58.0' -Rails.configuration.stripe = { - :publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.config_for(:stripe)['publishable_key'], - :secret_key => ENV['STRIPE_SECRET_KEY'] || Rails.application.config_for(:stripe)['secret_key'] -} - -Stripe.api_key = Rails.configuration.stripe[:secret_key] - load File.expand_path('../lib/choice-discourse/engine.rb', __FILE__) Discourse::Application.routes.prepend do