Make User PIN Alphanumeric

Which mag reader do you have?

MSR605X I can’t see anywhere in the settings that’ll let you create a card without % and ? Symbols at start and end

Ill show screenshots tonight, I can get it to login as I’m guessing the login screen only accepts numbers so when i format the card a certain way it works to login

However the input field on the pos screen is alphanumeric so it doesn’t work there and displays all letters and numbers

Simple solution would be to allow alphanumeric digits in PIN so I can leave the format as it and it’ll work on login screen, pos screen and switch user setup which checks the user pin against what is swiped

Then they would have to alter keypad to show full keyboard that wouldn’t look very good.

The login screen downt accept % and ?, I have used cheap magswipes which didnt offer utlity to strip the prefix/suffix and it worked fine for login screen…

As for admin pin, maybe you could look to a custom [?prompt] flow and use a mask to disregard non numeric charicters?

Not if they just used an alphanumeric field to allow mag cards with letters. The numberpad would stay the same on screen to enter number only pins

I’ve got it to work for login and admin pins, I tried a different setting and although there are letters and symbols the login and admin pin fields seem to disregard anything that isn’t a number so only the numbers from the card get Inputted which then match the user pin

Adding entity to the ticket using the mag card is fine as I can just enter any special characters or letters in the custom field used to add the entity

The main issue which you might be able to help with @JTRTech is the switch user system as I used the one you created. So now by typing the pin it works fine to logout and auto login

But as I can’t strip the symbols from my mag card encoding how can I change the action to only use the numbers from the card that is swiped, so the action strips the symbols from start and end and just uses the numbers which will match a user pin

This was the main reason for my request so that I can swipe a staff card to initiate the switch user setup. If the pin was alphanumeric it would just work and no one would see any different from the login screen as that would stay the same

Without that I’d need some help to strip the unnecessary characters from the mag card but I’m not sure how to do this and format it in the switch user actions

The simplest format that my mag card encoder outputs is %nnnmmnn? Where n are numbers, so for example a user with pin 2575613 when encoded onto a mag card outputs ad %2575613?

So I need a way to ignore the % and ? Symbols. I briefly used the subst(n,n) function before, could that be used in the action that “grabs” the pin to only use the 2nd digit as the start and use the following 6 digits as the rest of the number?

You could use a script to splice of the first and last characters, so the parts then either change [:NumberPad] to something like {CALL:tools.cutfirstandlast([:NumberPad])} or do it just once and adapt the switch user flow to start with an execute automation command cation which strips into the command value before passing into the existing flow.

Yea that’s what I thought I’d prob need to do, gunna need some help with the call bit and what I need to do to split the numbers down

Splice is the script function.
There may be a helper that would work within the action directly but not sure… Q would probably have been the person to ask that but…
A script should definatly do the job. I use a script call for my locals discount fobs which are numberpad entered based so definatly doable.

Seeing as I seem to be able to get login and admin pins working maybe Instead of just swiping the card to switch users I could create a button to press instead that opens keypad then swipe card to see if that works

Adds an extra step of pressing a button but if it works like login and admin pin does it will be much simpler to make work

Not sure, I checked admin pin and at least on keyboard it accepts ; and ? so not sure if its different on msr.
The script method should allow same flow just stripping the ; and ? but up to you.

@emre i just came across this in a post from 4 years ago!!

emre

Sep '14

sukasem try [=’[:CommandValue]’.substr(1,6)]

I thing you are trying to strip mag card control chars. If you tell us more about your implementation I can give more info about how to deal with that.

Thats what i am trying to do, strip the first and last characters of the mag card control

The only thing this is affecting is my switch user setup where it uses the number pad entry on the pos screen. the login screen pin field and admin pin fields seem to automatically strip the control characters from the start and end and they work fine.

The numberpad entry on the pos screen doesnt do this, so for example i have a user with pin 2575613, when encoding this to a mag card it outputs as %2575613?

%2575613? works fine on the main pos login screen and logs in user with pin 2575163
%2575613? works fine for admin pin confirmation and accepts 2575613 as a pin

My switch user setup relies on a user pin being entered on the numberpad field on the pos screen, if i manually type 2575613 everything works perfect and current user logs out and user with pin 2575613 gets logged in

This obviously doesnt work when i swipe my mag card as it inputs %2575613? which isnt a user pin so doesnt work. How can a change the actions below to strip off the 1st and last characters (% and?) so the rule thinks we have just entered 2575613 and not %2575613?

image

So i think in need to amend [:NumberpadValue]:F.Count in the rule constraint to be numberpad value minus the first and last digit

and need to change the action command value from [:NumberpadValue] to numberpad value minus fist and last digit

ive tried a few things you suggested in the topic ive reviewed from 2014 but im not doing it correctly, not sure on what the correct string should be to amend the inputted value

i also tried this which you suggested in that topic to remove the 1st and last characters:

[='[:CommandValue]'.substr('[:CommandValue]'.length-1,1)]

I changed CommanValue to NumberpadValue in the string above but this didnt work

You might need to split the rule and do the substring splicing on the first rule and pass the processed value over via automation command value.

Which substring splicing is correct? im not sure what the correct format should be to ignore 1st and last digits

for example in this bit does the -1 mean it is removing the 1st digit and the 1 mean the value is 1 digit in length?

Depends on the function, I think substr which would be substring is the index for start and end. Or it might be start index and length.
Google the jscript function for definition.

BOOM!! worked it out first time!

used show message to see if i got it to display the correct numbers

Rule 1. New numberpad entered rule to strip digits to require pin
image

Rule 2. Changed existing numberpad eneterd rule to auto command exec rule and changef numberpadValue to CommandValue in the rule and action constraints and added the auto command name constraint
image

Just needed to create rule 1 and amend rule 2 and it works perfect now :slight_smile:

5 Likes