Embed event checkouts and send seller email to gateways.
Deploy Ladill Events / deploy (push) Successful in 1m42s
Deploy Ladill Events / deploy (push) Successful in 1m42s
Ticket/contribution payments open in a desktop modal or mobile sheet, initialize with the organizer email, and break out of the iframe after callback. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -55,15 +55,21 @@ class EventRegistrationController extends Controller
|
||||
$reference = (string) $request->query('reference', '');
|
||||
|
||||
if ($reference === '') {
|
||||
return redirect()->away(LadillLink::url($shortCode))->with('error', 'Missing payment reference.');
|
||||
return view('public.payment-return', [
|
||||
'redirect' => LadillLink::url($shortCode),
|
||||
]);
|
||||
}
|
||||
|
||||
try {
|
||||
$registration = $this->eventService->complete($reference);
|
||||
|
||||
return redirect()->away($this->confirmedUrl($registration->qrCode, $registration));
|
||||
return view('public.payment-return', [
|
||||
'redirect' => $this->confirmedUrl($registration->qrCode, $registration),
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
return redirect()->away(LadillLink::url($shortCode))->with('order_error', 'Payment could not be verified. Reference: ' . $reference);
|
||||
return view('public.payment-return', [
|
||||
'redirect' => LadillLink::url($shortCode),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,11 +130,16 @@ 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';
|
||||
}
|
||||
|
||||
$checkout = $this->gateway->initializeCheckout(
|
||||
$qrCode->user,
|
||||
$amountMinor,
|
||||
(string) ($registration->currency ?? 'GHS'),
|
||||
$email,
|
||||
$sellerEmail,
|
||||
LadillLink::path($qrCode->short_code, 'register/callback'),
|
||||
$registration->reference,
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user