@extends('layouts.guest-landing') {{-- Use public layout --}} @section('title', 'Confirm Order & Payment') @push('styles') {{-- Basic styling for Stripe Element container --}} @endpush @section('content')
{{-- Added dark mode background --}}
{{-- Main Form - Wraps Contact, Summary, and Payment --}}
@csrf {{-- 1. Contact & Billing Address Information Section --}}

Contact & Billing Information

@guest Already have an account? Log in @endguest @auth Logged in as: {{ auth()->user()->email }} @endauth
{{-- Email Input --}}
@error('contact_email')

{{ $message }}

@enderror
{{-- First Name & Last Name --}}
@error('first_name')

{{ $message }}

@enderror
@error('last_name')

{{ $message }}

@enderror
{{-- Company (Optional) --}}
@error('company')

{{ $message }}

@enderror
{{-- Billing Address Line 1 --}}
@error('billing_address_line_1')

{{ $message }}

@enderror
{{-- Billing Address Line 2 --}}
@error('billing_address_line_2')

{{ $message }}

@enderror
{{-- City, State, Zip Row --}}
@error('billing_city')

{{ $message }}

@enderror
@error('billing_state')

{{ $message }}

@enderror
@error('billing_zip_code')

{{ $message }}

@enderror
{{-- Assuming US only for now, add country select if needed --}} {{-- Marketing Opt-in Checkbox --}}
{{-- 2. Order Summary & Payment Section --}}

Payment Details

{{-- Display Total --}}

Total Amount (including donation):

${{ number_format($cartTotal, 2) }}

{{-- Display Stripe Error from Controller (if PI failed) --}} @if (!empty($stripeErrorMessage)) {{-- Check if variable exists and is not empty --}}

Payment Error

{{ $stripeErrorMessage }}

@endif {{-- Only show payment form if Stripe setup was successful --}} {{-- Check if variables exist before using --}} @if (!empty($stripePublicKey) && !empty($paymentIntentClientSecret)) {{-- Stripe Card Element Container --}}
{{-- Used to display form errors. --}}
{{-- Buttons --}}
← Back to Cart {{-- Submit button - Text changes based on state --}}
@else {{-- Message if Stripe isn't configured or PI failed in controller --}}

{{ $stripeErrorMessage ?? 'Payment processing is currently unavailable. Please contact support.' }}

@endif
{{-- End Main Form --}}
@endsection @push('scripts') {{-- Debug Faker Environment Variable --}} @php $fakerEnvValue = env('FAKER_ENABLED', 'NOT_SET'); $fakerEnabled = false; // Only enable if explicitly set to string 'true' if ($fakerEnvValue === 'true') { $fakerEnabled = true; } // Debug output \Log::info('Faker Debug', [ 'env_value' => $fakerEnvValue, 'enabled' => $fakerEnabled, 'type' => gettype($fakerEnvValue), ]); @endphp @if ($fakerEnabled) @else @endif @endpush {{-- Only include Stripe JS if keys are available --}} @if (!empty($stripePublicKey) && !empty($paymentIntentClientSecret)) @endif @endpush