diff --git a/app/Http/Controllers/Public/BookingController.php b/app/Http/Controllers/Public/BookingController.php index 538fb25..533af45 100644 --- a/app/Http/Controllers/Public/BookingController.php +++ b/app/Http/Controllers/Public/BookingController.php @@ -42,8 +42,8 @@ class BookingController extends Controller $validated = $request->validate([ 'customer_name' => ['required', 'string', 'max:120'], - 'customer_email' => ['required', 'email', 'max:200'], - 'customer_phone' => ['nullable', 'string', 'max:30'], + 'customer_email' => ['nullable', 'email', 'max:200'], + 'customer_phone' => ['required', 'string', 'max:30'], 'service_index' => ['required', 'integer', 'min:0'], 'starts_at' => ['required', 'date'], ]); diff --git a/app/Http/Controllers/Public/SaleOrderController.php b/app/Http/Controllers/Public/SaleOrderController.php index 64dab7f..fda2128 100644 --- a/app/Http/Controllers/Public/SaleOrderController.php +++ b/app/Http/Controllers/Public/SaleOrderController.php @@ -34,7 +34,7 @@ class SaleOrderController extends Controller $validated = $request->validate([ 'customer_name' => ['required', 'string', 'max:120'], - 'customer_email' => ['required', 'email', 'max:200'], + 'customer_email' => ['nullable', 'email', 'max:200'], 'customer_phone' => ['required', 'string', 'max:30'], 'shipping_fee' => ['nullable', 'numeric', 'min:0', 'max:10000'], 'items' => ['required', 'array', 'min:1'], diff --git a/app/Services/Merchant/GiveDonationService.php b/app/Services/Merchant/GiveDonationService.php index 40358b6..dcfa53e 100644 --- a/app/Services/Merchant/GiveDonationService.php +++ b/app/Services/Merchant/GiveDonationService.php @@ -56,7 +56,7 @@ class MerchantSaleService 'amount_minor' => $amountMinor, 'currency' => $qrCode->content()['currency'] ?? 'GHS', 'payer_name' => trim((string) ($data['customer_name'] ?? '')), - 'payer_email' => trim((string) ($data['customer_email'] ?? '')), + 'payer_email' => ($email = trim((string) ($data['customer_email'] ?? ''))) !== '' ? $email : null, 'payer_phone' => trim((string) ($data['customer_phone'] ?? '')), 'status' => QrSaleOrder::STATUS_PENDING, 'payment_reference' => null, diff --git a/resources/views/public/qr/book-landing.blade.php b/resources/views/public/qr/book-landing.blade.php index d9b28c7..fe773d9 100644 --- a/resources/views/public/qr/book-landing.blade.php +++ b/resources/views/public/qr/book-landing.blade.php @@ -6,7 +6,7 @@ $price = number_format((float) ($c['price_ghs'] ?? 0), 2); $fileType = strtoupper($c['file_type'] ?? 'PDF'); $hasCover = !empty($c['cover_path']); - $orderUrl = route('qr.public.book.checkout', $qrCode->short_code); + $orderUrl = $qrCode->publicPath('book/order'); $csrfToken = csrf_token(); @endphp @@ -35,7 +35,7 @@ customerPhone: '', async submitOrder() { if (!this.customerName.trim()) { this.errorMsg = 'Enter your full name.'; return; } - if (!this.customerEmail.trim() || !this.customerEmail.includes('@')) { this.errorMsg = 'Enter a valid email address.'; return; } + if (!this.customerPhone.trim()) { this.errorMsg = 'Enter your phone number.'; return; } this.loading = true; this.errorMsg = ''; try { const res = await fetch(@js($orderUrl), { @@ -63,7 +63,7 @@ {{-- Left column: cover panel (desktop only) --}}
4. Your details
- - +Show this badge code at check-in. A confirmation was sent to {{ $registration->attendee_email }}.
+ @else +Show this badge code at check-in.
+ @endif @endif