Skip to main content

Single-answer option

For cases where you require the user to select only one option, you can use a single-answer question. We describe here how you can use an input request to ask the shopper a question and allow them to select more than one answer. You can use this, for example, to create a customer survey. You can show a header (your question) and up to 15 scrollable option buttons. Each option button can contain one text line.

Requirements

Before you begin, take into account the following requirement.

How it works

When you use a MenuButtons InputRequest, the terminal prompts the shopper to answer a question that allows them to select multiple answers. The terminal continues to show your input request until one of these events occurs:
  • The user has provided input.
  • The maximum input time expires. You can set this time in the request.
  • On the terminal, Cancel is selected.
  • The terminal receives a request to cancel collecting input or any other request from the POS app.

Examples

This example shows a list where the shopper can select more than one of the answers on a portrait, small portrait, and landscape display

Make a multiple-answers MenuButtons input request

We support two MenuButtons input requests: To enable the selection of multiple answers, your request needs to include the MinLength or MaxLength parameters. To use the payment terminal to show a menu that allows the user to select more than one option:
  1. Make a Terminal API input request, specifying:
    • The standard SaleToPOIRequest.MessageHeader object, with MessageClass set to Device and MessageCategory set to Input. To allow selecting multiple answers, you must include the MinLength or MaxLength parameters.
    The following example asks the shopper to select options from a list.

    JSON

    Java

  2. Wait for the user to supply the requested input. If input is received from the terminal, the input response includes an InputResult object with:
    • Input.MenuEntryNumber: An array that indicates the options that the user selected. For example, if the shopper selects the first and third options, the first and third items in the array are 1 and all other array items are 0.
    Example response when the shopper selects the first and third options
    • If the user selects fewer than the minimum number of answers specified in the MinLength parameter or more than the maximum number of answers specified in the MaxLength parameter, the response contains:
      • InputResult.Response.Result: Failure
      • Response.ErrorCondition: NotAllowed
      • AdditionalResponse: contains the message The number of selections are below the MinLength or The number of selections are above the MaxLength.
    • If the input request times out, you receive an EventNotification with EventDetails: message=Did+not+receive+a+response+from+the+POI.
    • If you make a payment request while the input request is waiting for input on the terminal, the payment request overrides the input request. The InputResult has Response.Result: Failure, Response.ErrorCondition: Busy, and an AdditionalResponse containing the message A higher priority request has been received.
    • If the user declined to respond (selected the Cancel key ), the InputResult has Response.Result: Failure and Response.ErrorCondition: Cancel.
  3. Pass the relevant data from InputResult.Input to your system for validation and further use.

See also