User Input
METHOD NAME userInput
This method is Cancelable.
Requires state
IDLEand during process moves toPROMPT
Description
This method creates a custom menu with a text input field. Once the request is processed, the method waits until the user types a valid value according to the request parameters, a cancel event, or a timeout and responds accordingly.
Parameters
object
-
commandIdstringREQUIRED
Id that is used as a reference to cancel the command -
inputTypeUserInputTypeREQUIRED
The type of input -
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 -
minLengthint
The shortest length of string to accept.
REQUIRED ifinputTypeisNUMERIC,ALPHANUMERIC,EMAIL -
maxLengthint
The longest length of string to accept.
REQUIRED ifinputTypeisNUMERIC,ALPHANUMERIC,EMAIL -
minValueint
The smallest value of the number to accept.
REQUIRED ifinputTypeisNUMBER -
maxValueint
The biggest value of the number to accept.
REQUIRED ifinputTypeisNUMBER
Result
object on when the request is valid and the menu prompted on the device.
-
commandIdstring
Echo back the id from the request -
resultResult
Possible results are:OK,CANCELED,TIMEOUT
(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
-
-
inputTypeUserInputTypeEcho back the input type -
userInputstring
The input string that was typed. This value is populated ifinputTypeisNUMERIC,ALPHANUMERIC, orEMAIL. -
intUserInputint
The input integer that was typed. This value is populated ifinputTypeisNUMBER.
Errors
MissingParamsInvalidParamson incorrect OTPIllegalState
Example