feat: Implement payment retry system and draft ticket expiry management
- Add 30-minute expiry window for draft tickets with automatic cleanup - Implement 3-attempt payment retry mechanism with tracking - Create background job for cleaning expired draft tickets every 10 minutes - Add comprehensive UI warnings for expiring tickets and retry attempts - Enhance dashboard to display pending draft tickets with retry options - Add payment cancellation handling with smart retry redirections - Include rake tasks for manual cleanup and statistics - Add database fields: expires_at, payment_attempts, last_payment_attempt_at, stripe_session_id - Fix payment attempt counter display to show correct attempt number (1/3, 2/3, 3/3)
This commit is contained in:
@@ -9,6 +9,14 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
|
||||
# Implemented to "temporize" tickets
|
||||
# If a ticket is not paid in time, it is removed from the database
|
||||
#
|
||||
t.string :stripe_session_id
|
||||
t.timestamp :expires_at
|
||||
t.integer :payment_attempts, default: 0
|
||||
t.timestamp :last_payment_attempt_at
|
||||
|
||||
t.references :user, null: true, foreign_key: false
|
||||
t.references :ticket_type, null: false, foreign_key: false
|
||||
|
||||
@@ -22,5 +30,9 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
# Add indexes for better performance
|
||||
# add_index :tickets, :first_name unless index_exists?(:tickets, :first_name)
|
||||
# add_index :tickets, :last_name unless index_exists?(:tickets, :last_name)
|
||||
#
|
||||
# add_index :tickets, :stripe_session_id, unique: true
|
||||
# add_index :tickets, [ :status, :expires_at ]
|
||||
# add_index :tickets, [ :user_id, :status ]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user