[ 'currency' => 'usd', 'product_data' => [ 'name' => 'Basic Plan', ], 'unit_amount' => 500, // $5.00 'recurring' => [ 'interval' => 'month', ], ], 'quantity' => 1, ]; } elseif ($plan === 'pro') { $line_items[] = [ 'price_data' => [ 'currency' => 'usd', 'product_data' => [ 'name' => 'Pro Plan', ], 'unit_amount' => 1500, // $15.00 'recurring' => [ 'interval' => 'month', ], ], 'quantity' => 1, ]; } else { // Redirect to pricing page if plan is not recognized header('Location: pricing.php'); exit; } /* try { $checkout_session = \Stripe\Checkout\Session::create([ 'payment_method_types' => ['card'], 'line_items' => $line_items, 'mode' => 'subscription', 'success_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/ritual.php', 'cancel_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/pricing.php', 'customer_email' => $_SESSION['user_email'], // Pre-fill email 'client_reference_id' => $_SESSION['user_id'], ]); header("Location: " . $checkout_session->url); exit; } catch (Exception $e) { // Handle any errors that occur error_log('Stripe Error: ' . $e->getMessage()); header('Location: pricing.php?error=1'); exit; } */ // For now, we will simulate a successful payment and redirect to the ritual page. header('Location: ritual.php?payment=success'); exit; ?>