Return Meet attendees to join flow after event registration.
Deploy Ladill Events / deploy (push) Successful in 47s
Deploy Ladill Events / deploy (push) Successful in 47s
Add badge verification API, preserve meet_return through registration and payment, and link confirmation back to Meet with badge auto-login. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,6 +33,7 @@ class EventRegistrationController extends Controller
|
||||
'attendee_email' => ['nullable', 'email', 'max:200'],
|
||||
'attendee_phone' => ['required', 'string', 'max:30'],
|
||||
'badge_fields' => ['nullable', 'array'],
|
||||
'meet_return' => ['nullable', 'string', 'max:2048'],
|
||||
]);
|
||||
|
||||
try {
|
||||
@@ -45,7 +46,7 @@ class EventRegistrationController extends Controller
|
||||
'paid' => $result['paid'],
|
||||
'checkout_url' => $result['checkout_url'],
|
||||
'badge_code' => $result['registration']->badge_code,
|
||||
'success_url' => LadillLink::path($qrCode->short_code, 'registered/'.$result['registration']->reference),
|
||||
'success_url' => $this->confirmedUrl($qrCode, $result['registration'], $request->input('meet_return')),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -60,22 +61,43 @@ class EventRegistrationController extends Controller
|
||||
try {
|
||||
$registration = $this->eventService->complete($reference);
|
||||
|
||||
return redirect()->away(LadillLink::path($shortCode, 'registered/'.$registration->reference));
|
||||
return redirect()->away($this->confirmedUrl($registration->qrCode, $registration));
|
||||
} catch (\Throwable $e) {
|
||||
return redirect()->away(LadillLink::url($shortCode))->with('order_error', 'Payment could not be verified. Reference: ' . $reference);
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmed(string $shortCode, string $ref): View
|
||||
public function confirmed(Request $request, string $shortCode, string $ref): View
|
||||
{
|
||||
$registration = QrEventRegistration::query()
|
||||
->where('reference', $ref)
|
||||
->whereHas('qrCode', fn ($q) => $q->where('short_code', $shortCode))
|
||||
->firstOrFail();
|
||||
|
||||
$meetReturn = (string) $request->query('meet_return', '');
|
||||
if ($meetReturn === '') {
|
||||
$meetReturn = (string) (($registration->metadata ?? [])['meet_return'] ?? '');
|
||||
}
|
||||
|
||||
return view('public.qr.event-confirmed', [
|
||||
'registration' => $registration,
|
||||
'qrCode' => $registration->qrCode,
|
||||
'meetReturn' => $meetReturn,
|
||||
]);
|
||||
}
|
||||
|
||||
private function confirmedUrl(QrCode $qrCode, QrEventRegistration $registration, ?string $meetReturn = null): string
|
||||
{
|
||||
$url = LadillLink::path($qrCode->short_code, 'registered/'.$registration->reference);
|
||||
$meetReturn = trim((string) ($meetReturn ?? ''));
|
||||
if ($meetReturn === '') {
|
||||
$meetReturn = trim((string) (($registration->metadata ?? [])['meet_return'] ?? ''));
|
||||
}
|
||||
|
||||
if ($meetReturn !== '') {
|
||||
$url .= '?meet_return='.urlencode($meetReturn);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user