- Re-enable ActiveRecord pointing at Neon Postgres - Add Customer model with stripe_customer_id, email, slug, status - Add dashboard controller and Apple ID-style device view - Redirect checkout success to /dashboard - Webhook now calls /instances, parses response, creates Customer in Rails DB - Add MIT License Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
458 B
Ruby
14 lines
458 B
Ruby
class DashboardController < ApplicationController
|
|
def show
|
|
if params[:session_id].present?
|
|
stripe_session = Stripe::Checkout::Session.retrieve(params[:session_id])
|
|
@customer = Customer.find_by(stripe_customer_id: stripe_session.customer)
|
|
elsif params[:email].present?
|
|
@customer = Customer.find_by(email: params[:email])
|
|
else
|
|
redirect_to root_path
|
|
end
|
|
rescue Stripe::StripeError
|
|
redirect_to root_path
|
|
end
|
|
end
|