Files
aperonight/bin/test_stripe_initialization.rb
kbe 48547f3aad feat: Implement complete ticket purchasing flow with new TicketsController │
│
- Create new TicketsController with actions for name collection, creation, and checkout                                                                                                                                                                   │
- Add dedicated ticket views (new.html.erb, checkout.html.erb, show.html.erb)                                                                                                                                                                             │
- Update ticket_selection_controller.js to handle form submission via AJAX                                                                                                                                                                                │
- Add store_cart endpoint in EventsController for session-based cart management                                                                                                                                                                           │
- Update routes to support new ticket flow: /tickets/new, /create, /checkout                                                                                                                                                                              │
- Fix attribute name consistency across views (title→name, starts_at→start_time)                                                                                                                                                                          │
- Add Stripe checkout integration with proper error handling                                                                                                                                                                                              │
- Remove deprecated collect_names flow in favor of streamlined approach                                                                                                                                                                                   │
                                                                                                                                                                                                                                                          │
The flow is now: Event selection → AJAX cart storage → Name collection → Checkout → Payment
2025-08-30 20:01:59 +02:00

25 lines
820 B
Ruby
Executable File

#!/usr/bin/env ruby
# Test Stripe initialization
puts "Testing Stripe initialization..."
puts "Rails.application.config.stripe: #{Rails.application.config.stripe}"
puts "Secret key present?: #{Rails.application.config.stripe[:secret_key].present?}"
# Try to initialize Stripe directly
begin
Stripe.api_key = Rails.application.config.stripe[:secret_key]
puts "Stripe successfully initialized with API key"
rescue => e
puts "Error initializing Stripe: #{e.message}"
end
# Test creating a simple Stripe object
begin
# This won't actually create a customer, just test if the API key works
Stripe::Customer.list(limit: 1)
puts "Stripe API connection successful"
rescue Stripe::AuthenticationError => e
puts "Stripe Authentication Error: #{e.message}"
rescue => e
puts "Other Stripe Error: #{e.message}"
end