diff --git a/app/Services/Events/EventRegistrationService.php b/app/Services/Events/EventRegistrationService.php index 03c4d04..122b9e9 100644 --- a/app/Services/Events/EventRegistrationService.php +++ b/app/Services/Events/EventRegistrationService.php @@ -130,16 +130,18 @@ class EventRegistrationService ? sprintf('%s — %s', $content['name'] ?? $qrCode->label, $tierName) : sprintf('%s ticket — %s', $content['name'] ?? $qrCode->label, $tierName); - $sellerEmail = trim((string) ($qrCode->user->email ?? '')); - if ($sellerEmail === '' || ! str_contains($sellerEmail, '@')) { - $sellerEmail = 'seller+'.($qrCode->user->public_id ?? 'events').'@checkout.ladill.local'; + // Ticket buyers (not till staff): gateways get the attendee email so + // receipts and 3DS challenges belong to the person purchasing. + $buyerEmail = $email; + if ($buyerEmail === '' || ! str_contains($buyerEmail, '@')) { + $buyerEmail = 'buyer+'.($registration->reference).'@checkout.ladill.local'; } $checkout = $this->gateway->initializeCheckout( $qrCode->user, $amountMinor, (string) ($registration->currency ?? 'GHS'), - $sellerEmail, + $buyerEmail, LadillLink::path($qrCode->short_code, 'register/callback'), $registration->reference, [ @@ -148,6 +150,7 @@ class EventRegistrationService 'registration_reference' => $registration->reference, 'qr_code_id' => $qrCode->id, 'mode' => $mode, + 'attendee_email' => $email, ], ); diff --git a/resources/views/components/user/service-topup-modal.blade.php b/resources/views/components/user/service-topup-modal.blade.php index f9a5675..0b13e45 100644 --- a/resources/views/components/user/service-topup-modal.blade.php +++ b/resources/views/components/user/service-topup-modal.blade.php @@ -118,7 +118,11 @@ - @include('partials.paystack-sheet') + @include('partials.paystack-sheet', [ + 'audience' => 'operator', + 'sheetTitle' => 'Add credits', + 'sheetSubtitle' => 'Complete payment to top up this account.', + ]) diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index eed268f..167e5ba 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -1,14 +1,44 @@ {{-- Payment checkout shell: bottomsheet on mobile, centered modal on desktop. + + Audiences: + - buyer (default): public ticket buyers, donors, shoppers — self-serve checkout + - operator: signed-in staff flows such as wallet top-up + + Optional overrides: $sheetTitle, $sheetSubtitle, $sheetFooter, $sheetAria, $iframeTitle Requires Alpine ancestor with: showSheet (bool), checkoutUrl (string). --}} +@php + $audience = $audience ?? 'buyer'; + $defaults = match ($audience) { + 'operator' => [ + 'title' => 'Complete payment', + 'subtitle' => null, + 'aria' => 'Complete payment', + 'iframe' => 'Payment checkout', + 'footer' => null, + ], + default => [ + 'title' => 'Complete your payment', + 'subtitle' => 'Pay securely. You\'ll get a confirmation when it succeeds.', + 'aria' => 'Complete your payment', + 'iframe' => 'Secure payment checkout', + 'footer' => 'Your payment is processed securely. Do not close this window until finished.', + ], + }; + $sheetTitle = $sheetTitle ?? $defaults['title']; + $sheetSubtitle = $sheetSubtitle ?? $defaults['subtitle']; + $sheetAria = $sheetAria ?? $defaults['aria']; + $iframeTitle = $iframeTitle ?? $defaults['iframe']; + $sheetFooter = $sheetFooter ?? $defaults['footer']; +@endphp diff --git a/resources/views/public/payment-return.blade.php b/resources/views/public/payment-return.blade.php index 78e28fd..82ed789 100644 --- a/resources/views/public/payment-return.blade.php +++ b/resources/views/public/payment-return.blade.php @@ -10,7 +10,7 @@ -

Finishing payment…

+

Confirming your payment…