Skip to content

Commit 858aeae

Browse files
committed
Implement handling for new iCard swiper
1 parent 838b40b commit 858aeae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ui/pages/tickets/ScanTickets.page.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,18 @@ const ScanTicketsPageInternal: React.FC<ScanTicketsPageProps> = ({
564564

565565
let email = inputValue;
566566

567+
// Check if input is from ACM card swiper (format: ACMCARD followed by 4 digits, followed by 9 digits)
568+
if (email.startsWith("ACMCARD")) {
569+
const uinMatch = email.match(/^ACMCARD(\d{4})(\d{9})/);
570+
if (!uinMatch) {
571+
setError("Invalid card swipe. Please try again.");
572+
setIsLoading(false);
573+
setShowModal(true);
574+
return;
575+
}
576+
email = uinMatch[2]; // Extract the 9-digit UIN
577+
}
578+
567579
// Check if input is UIN (all digits)
568580
if (/^\d+$/.test(email)) {
569581
try {

0 commit comments

Comments
 (0)