change routes

This commit is contained in:
Rimian Perkins 2017-02-14 10:28:07 +11:00
parent 4eef7131ed
commit 99758dcaa9
3 changed files with 8 additions and 9 deletions

View File

@ -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

6
config/stripe.rb Normal file
View File

@ -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]

View File

@ -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