@extends('layouts.app') @section('title', __('Checkout')) @section('content')
@include('partials.how-it-works', ['key' => 'student.checkout'])
@php $selectedMethod = old('payment_method', array_key_first($paymentMethods) ?? ($walletBalance >= $total ? 'wallet' : 'invoice')); $invoiceOpen = $selectedMethod === 'invoice' || $errors->hasAny(['billing_company', 'po_number']); $refundDays = (int) setting('refund_window_days', 14); $itemCount = $cartItems->count(); @endphp

{{ __('Checkout') }}

{{ trans_choice('{1} :count item in your order|[2,*] :count items in your order', $itemCount, ['count' => $itemCount]) }}

  1. {{ __('Cart') }}
  2. 2{{ __('Payment') }}
  3. 3{{ __('Start learning') }}
{{ __('Secure checkout') }}
@if(!empty($bump)) {{-- One relevant extra at a discount, offered before payment. Its own form, because it must not submit the checkout. --}} @php($bumpPrice = round(max(0, (float) $bump->currentPrice() * (1 - max(0, min(90, (float) setting('order_bump_discount', 40))) / 100)), 2))
@csrf
{{ __('One-time offer') }}
{{ $bump->title }}
{{ money($bump->currentPrice()) }} {{ money($bumpPrice) }} {{ __('if you add it now') }}
{{-- Declining posts to a sibling form (below) so it never adds the course. --}}
@csrf
@endif
{{-- The checkout form wraps only the payment picker; the summary's pay button submits it via form="checkoutForm" so the coupon form can live in the other column without nesting forms. --}}
@csrf

{{ __('Payment Method') }}

{{ __('Choose how you want to pay') }}
@if(!empty($paymentMethods))
{{ __('Pay online') }}
@foreach($paymentMethods as $key => $method) @endforeach
@endif
{{ __('Other ways to pay') }}
@if(isset($paymentMethods['manual'])) @include('checkout._manual-panel') @endif
@error('billing_company')
{{ $message }}
@enderror
@error('po_number')
{{ $message }}
@enderror
{{ __("We'll email the invoice to your account address; access opens once it's approved.") }}
{{ __('256-bit SSL encrypted') }} {{ __('Card details never touch our servers') }} @if($refundDays > 0) {{ __(':days-day refund window', ['days' => $refundDays]) }} @endif
@if(config('app.demo'))

{{ __('This is a demo checkout. No real charge will be made.') }}

@endif

{{ __('Your order') }}

{{ __('Edit cart') }}
@foreach($cartItems as $item)
@include('partials.cart-item', ['item' => $item, 'size' => 72]) {{ money($item->price) }}
@endforeach

{{ __('Order Summary') }}

{{ __('Subtotal') }} {{ money($subtotal) }}
@if($discount > 0)
{{ __('Discount') }} @if($coupon){{ $coupon->code }}@endif -{{ money($discount) }}
@endif @if(($tax ?? 0) > 0)
{{ $taxRule?->name ?: __('Tax') }} ({{ rtrim(rtrim(number_format((float) $taxRule?->rate, 2), '0'), '.') }}%) {{ money($tax) }}
@endif
{{ __('Total') }} {{ __('Billed once, in :currency', ['currency' => $currency->code ?? setting('currency', 'USD')]) }}
{{ money($total) }}
@if(!$coupon)
@csrf
@endif

{{ __('By completing this purchase you agree to our') }} @if(Route::has('pages.terms')){{ __('terms') }}@else{{ __('terms') }}@endif. {{ __('Back to cart') }}

{{ __('Instant access') }}{{ __('Your courses unlock the moment payment is confirmed.') }}
{{ __('Learn on any device') }}{{ __('Web, tablet and the mobile app — your progress stays in sync.') }}
{{ __('Certificate of completion') }}{{ __('Earn a shareable certificate when you finish a course.') }}
@if($refundDays > 0)
{{ __(':days-day money-back guarantee', ['days' => $refundDays]) }}{{ __("Not the right fit? Request a refund from your order history.") }}
@endif
{{ __('Questions before you pay?') }} @if(Route::has('pages.faq')){{ __('Read the FAQ') }}@endif @if(Route::has('support.index')) · {{ __('Contact support') }}@endif
{{-- Phones: the summary card scrolls away, so the total + pay button ride along the bottom. --}}
{{ __('Total') }}{{ money($total) }}
@endsection @push('scripts') @endpush @push('analytics') @endpush