feat: Prepare to use Stripe a checkout component
This commit is contained in:
@@ -21,7 +21,5 @@ Rails.application.configure do
|
||||
}
|
||||
end
|
||||
|
||||
# Only set the API key if it exists
|
||||
if Rails.application.config.stripe[:secret_key].present?
|
||||
Stripe.api_key = Rails.application.config.stripe[:secret_key]
|
||||
end
|
||||
# Note: Stripe.api_key is NOT set here - it will be set during checkout process
|
||||
Rails.logger.info "Stripe configuration loaded - will initialize during checkout"
|
||||
@@ -12,25 +12,11 @@ Rails.application.routes.draw do
|
||||
# Defines the root path route ("/")
|
||||
root "pages#home"
|
||||
|
||||
# Pages
|
||||
get "dashboard", to: "pages#dashboard", as: "dashboard"
|
||||
|
||||
# Events
|
||||
get "events", to: "events#index", as: "events"
|
||||
get "events/:slug.:id", to: "events#show", as: "event"
|
||||
post "events/:slug.:id/checkout", to: "events#checkout", as: "event_checkout"
|
||||
get "events/:slug.:id/names", to: "events#collect_names", as: "event_collect_names"
|
||||
post "events/:slug.:id/names", to: "events#process_names", as: "event_process_names"
|
||||
|
||||
# Payment success
|
||||
get "payments/success", to: "events#payment_success", as: "payment_success"
|
||||
|
||||
# Tickets
|
||||
get "tickets/:ticket_id/download", to: "events#download_ticket", as: "download_ticket"
|
||||
# === Devise ===
|
||||
|
||||
# Routes for devise authentication Gem
|
||||
# Bind devise to user
|
||||
# devise_for :users
|
||||
devise_for :users, path: "auth", path_names: {
|
||||
sign_in: "sign_in", # Route for user login
|
||||
sign_out: "sign_out", # Route for user logout
|
||||
@@ -47,6 +33,27 @@ Rails.application.routes.draw do
|
||||
confirmation: "authentications/confirmations" # Custom controller for confirmations
|
||||
}
|
||||
|
||||
# === Pages ===
|
||||
get "dashboard", to: "pages#dashboard", as: "dashboard"
|
||||
|
||||
# === Events ===
|
||||
get "events", to: "events#index", as: "events"
|
||||
# Step 1: Show event
|
||||
get "events/:slug.:id", to: "events#show", as: "event"
|
||||
# Step 2: Checkout
|
||||
post "events/:slug.:id/checkout", to: "events#checkout", as: "event_checkout"
|
||||
# Step 3: Collect names
|
||||
get "events/:slug.:id/names", to: "events#collect_names", as: "event_collect_names"
|
||||
# Step 4: Process names
|
||||
post "events/:slug.:id/names", to: "events#process_names", as: "event_process_names"
|
||||
|
||||
# Payment success
|
||||
get "payments/success", to: "events#payment_success", as: "payment_success"
|
||||
|
||||
# === Tickets ===
|
||||
get "tickets/:ticket_id/download", to: "events#download_ticket", as: "download_ticket"
|
||||
|
||||
|
||||
# API routes versioning
|
||||
namespace :api do
|
||||
namespace :v1 do
|
||||
|
||||
Reference in New Issue
Block a user