Read Card
METHOD NAME readCard
This method is Cancelable.
Requires state
IDLEand during process moves toREAD_CARD
Description
This method creates a request to read an industry card from the device. According to PCI regulations, an industry card does not hold sensitive data. The process waits until the card is read on the requested interface, a cancel event, or a timeout occurs.
Parameters
object
-
commandIdstringREQUIRED
Id that is used as a reference to cancel the command -
titlestring
The title at the top of the screen is displayed to the user -
bodystring
The message body on the screen displayed to the user -
timeoutint
Time in seconds until a response with aTIMEOUTresult is returned.
Default: 60 seconds. The value must be greater than zero -
cancelableboolean
A flag indicates if the user can cancel the operation from the selection screen. Defaulttrue -
readMagCardboolean
Wait for a card on the magnetic reader. Defaultfalse -
readNfcCardboolean
Wait for a card on the NFC reader. Defaultfalse
At least one of readMagCard or readNfcCard must be enabled.
Result
object on when a request is valid and the menu prompted on the device.
-
commandIdstring
Echo back the id from the request -
resultResult
General Error is returned if the card is unable to be read. Possible results are:OK,CANCELED,TIMEOUT,GENERAL_ERROR,CARD_NOT_ALLOWED
(1) Show values-
Result
Result of new request. Each command has possible values in the field.
OKRequest is okGENERAL_ERRORAn error occurredCANCELEDCommand was canceled either by the user (on-screen) or throughcancelcommand.TIMEOUTOperation was timed out.NETWORK_ERRORNo internet connection is available.HOST_ERRORHost returned an error regarding the request.SMART_READER_ERRORAn error occurred with the smart-readerSMART_CARD_ERRORAn error occurred with the smart card, or the reader couldn't communicate with the card.NONE_CREDIT_CARDIndustrial card was detected when performing a transaction.CARD_NOT_ALLOWEDWhen the detected card is not allowed to be processed
-
-
cardTypeCardTypeThe type of interface used to read the card. This value is populated if theresultisOK. -
magDataMagDataThe data related to magnetic card. This value is populated ifcardTypeisMAG. -
nfcDataNfcDataThe data related to the RF card. This value is populated ifcardTypeisNFC.
Errors
MissingParamsInvalidParamsIllegalState
Example