StatusCode

public final class StatusCode

Known status codes. Purposes of a predefined status code: - The error can be handled heuristically by the POS, e.g., recieving device_not_ready should retry the command after a short delay without user input. - The POS may want to translate the error message itself, instead of the localized prompts that we provide. - The POS might need to display a different prompt than the normal error message, e.g., show a “Display Configuration” button in addition to the standard “Cancel” and “Retry” buttons for the other error prompts.

Fields

ABORTED

public static final int ABORTED

The operation was aborted by using the abort command.

CACHED_CONFIGURATION_MISMATCH

public static final int CACHED_CONFIGURATION_MISMATCH

A device is configured but could not recognize using the known parameters. POS needs to clear the cache and retry the connection.

CANCELLED

public static final int CANCELLED

The operation was cancelled on the customer-facing display.

COMMAND_IN_PROGRESS

public static final int COMMAND_IN_PROGRESS

Command is already in progress. For example, when a payment is currently in progress and another payment is started. The current payment must be completed before another payment can be started. This can occur for other similar commands as well.

COMMAND_TIMED_OUT

public static final int COMMAND_TIMED_OUT

A response was not received from the terminal in time. If this happens during a payment, querying the last transaction status can help recover. For most other operations, the command can simply be reissued.

CONFIGURATION_REQUIRED

public static final int CONFIGURATION_REQUIRED

The SDK requires configuration, generally because no devices have been paired. This generally happens during the first time the app is being used, and will not happen on subsequent launches, unless the persistent app data is lost. Please use the DisplayConfiguration method when this is encountered.

CONTACT_ACQUIRER

public static final int CONTACT_ACQUIRER

Contact acquirer. Terminal should provide any relevant details for the merchant when contacting the acquirer, including phone #, account information, and the reason.

DEVICE_BUSY

public static final int DEVICE_BUSY

The device is currently handling other commands or interacting with other devices and cannot perform the request. The request should be retried after a period of time, and it might be helpful to display the error to the user.

DEVICE_CONNECTION_FAILED

public static final int DEVICE_CONNECTION_FAILED

The connection was not able to be established with the device. This can happen because the device cannot pair with another device, or the network fails, or a variety of reasons. This should include an option to launch DeviceConfiguration() for more information.

DEVICE_CONNECTION_LOST

public static final int DEVICE_CONNECTION_LOST

The connection to the device has been lost unexpectedly.

DEVICE_ERROR

public static final int DEVICE_ERROR

A general error has occurred with the device, such as powering off due to insufficient battery. The message should be displayed to the user, and should include an option to launch DeviceConfiguration() for more information.

DEVICE_NOT_FOUND

public static final int DEVICE_NOT_FOUND

A device is configured but could not be found using the known connections. The message should be displayed to the current user so that they can make sure that the device is turned on, connected, and ready.

DEVICE_NOT_READY

public static final int DEVICE_NOT_READY

The device can be contacted, but it is still loading or otherwise preparing. Resend the command after a brief delay to allow it to finish preparing.

DEVICE_REJECTED_PAIRING

public static final int DEVICE_REJECTED_PAIRING

Unable to pair, unexpected server response to request. Only occurs when the host or a server decides which devices are allowed to connect to this terminal. This is rare. This cannot be retried, and generally implies that tech support should be contacted.

DEVICE_WARNING

public static final int DEVICE_WARNING

A general warning about the device, such as a low battery, with a message that should be displayed to the user, but does not require input.

GENERAL_ERROR

public static final int GENERAL_ERROR

An error code that is not defined elsewhere. The message should be displayed to the user with options to retry, abort, or wait.

INVALID_ARGUMENTS

public static final int INVALID_ARGUMENTS

Returned when the command is missing some required field. This should generally be resolved during development, though it might occur in production when moving to a different region without testing.

INVALID_CONFIGURATION

public static final int INVALID_CONFIGURATION

Returned when the internal configuration of the SDK is invalid. This should generally be resolved during development, and should not occur in production. This command cannot be retried, the configuration should be fixed before proceeding.

INVALID_STATE

public static final int INVALID_STATE

The current state cannot process the command. This refers to the state as returned by TransactionManager.getState(). The state should be retrieved, and the proper steps taken to enter the desired state.

MISSING_LISTENER

public static final int MISSING_LISTENER

Missing listener. Please attach a listener to perform any actions.

NOT_ALLOWED

public static final int NOT_ALLOWED

The command requested is not allowed, most likely due to the permission granted to the application or the user.

REAUTHENTICATION_REQUIRED

public static final int REAUTHENTICATION_REQUIRED

Reauthenticaton required. This can occur when the current configuration is now out-of-date and must be updated, or the terminal must reauthenticate with the host to continue working. The POS can either call Login() automatically, or prompt the user to login.

RECEIPT_SUPPORT_REQUIRED

public static final int RECEIPT_SUPPORT_REQUIRED

Must Support Receipt Printing. TODO: Indicate if the POS that it can handle the receipt

SUCCESS

public static final int SUCCESS

The constant status code for success.

UNSUPPORTED_COMMAND

public static final int UNSUPPORTED_COMMAND

Invalid command. Occurs when the current device does not support the requested command. Please use the isCapable() methods to determine if the action can be performed before calling the API to avoid this error.

Constructors

StatusCode

public StatusCode()

Methods

toString

public String toString()