refactor: Improve code quality and add comprehensive documentation
- Remove unused create_stripe_session method from TicketsController - Replace hardcoded API key with environment variable for security - Fix typo in ApplicationHelper comment - Improve User model validation constraints for better UX - Add comprehensive YARD-style documentation across models, controllers, services, and helpers - Enhance error handling in cleanup jobs with proper exception handling - Suppress Prawn font warnings in PDF generator - Update refactoring summary with complete change documentation All tests pass (200 tests, 454 assertions, 0 failures) RuboCop style issues resolved automatically 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,34 +73,4 @@ class TicketsController < ApplicationController
|
||||
Rails.logger.error "TicketsController#set_event - Event not found with ID: #{event_id}"
|
||||
redirect_to events_path, alert: "Événement non trouvé"
|
||||
end
|
||||
|
||||
|
||||
def create_stripe_session
|
||||
line_items = @tickets.map do |ticket|
|
||||
{
|
||||
price_data: {
|
||||
currency: "eur",
|
||||
product_data: {
|
||||
name: "#{@event.name} - #{ticket.ticket_type.name}",
|
||||
description: ticket.ticket_type.description
|
||||
},
|
||||
unit_amount: ticket.price_cents
|
||||
},
|
||||
quantity: 1
|
||||
}
|
||||
end
|
||||
|
||||
Stripe::Checkout::Session.create(
|
||||
payment_method_types: [ "card" ],
|
||||
line_items: line_items,
|
||||
mode: "payment",
|
||||
success_url: payment_success_url + "?session_id={CHECKOUT_SESSION_ID}",
|
||||
cancel_url: payment_cancel_url,
|
||||
metadata: {
|
||||
event_id: @event.id,
|
||||
user_id: current_user.id,
|
||||
ticket_ids: @tickets.pluck(:id).join(",")
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user