Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
TransactionManager Class Reference

Inherits ProxyManager< T extends android.os.IInterface >, and ITransactionManager.

Public Member Functions

boolean isCapable (String capability)
 
boolean startSession (CommerceListener listener, String userID, String password, int shiftNumber)
 
Status login (@Nullable CommerceListener listener, @Nullable String userId, @Nullable String password, @Nullable String shiftNumber)
 
Status login (@Nullable ICommerceListener listener, @Nullable String userId, @Nullable String password, @Nullable String shiftNumber)
 
Status logout ()
 
boolean addGeneralListener (CommerceListener listener)
 
boolean addGeneralListener (ICommerceListener listener)
 
boolean removeGeneralListener (CommerceListener listener)
 
boolean removeGeneralListener (ICommerceListener listener)
 
boolean startSession (CommerceListener listener)
 
boolean startSession (CommerceListener listener, Transaction transaction)
 
boolean resumeSession (CommerceListener listener, String sessionId)
 
boolean addSessionListener (CommerceListener listener)
 
boolean removeSessionListener (CommerceListener listener)
 
boolean startSession (ICommerceListener listener, Transaction transaction)
 
boolean resumeSession (ICommerceListener listener, String sessionId)
 
boolean addSessionListener (ICommerceListener listener)
 
boolean removeSessionListener (ICommerceListener listener)
 
List getListeners ()
 
boolean endSession ()
 
Transaction getTransaction ()
 
boolean updateTransaction (Transaction transaction)
 
CardReader getCardReader ()
 
BasketManager getBasketManager ()
 
ReportManager getReportManager ()
 
Status startPayment (Payment payment)
 
Status startSale (BigDecimal amount, String invoiceId, String currency)
 
Status cancelTransaction ()
 
Status processVoid (Transaction transaction)
 
Status processRefund (Payment payment)
 
Status processRefund (BigDecimal amount, String invoiceId, String currency)
 
Status activateStoredValueCard (Payment payment)
 
Status loadStoredValueCard (Payment payment)
 
Status unloadStoredValueCard (Payment payment)
 
Status getStoredValueCardBalance (StoredValueCardInformation cardInformation)
 
Status determineReceiptDeliveryMethod (int[] availableDeliveryMethods, String customerPhone, String customerEmail)
 
Status presentReceiptDeliveryOptions (int[] availableDeliveryMethods, String customerPhone, String customerEmail)
 
Status presentUserOptions (String header, String[] buttonLabels)
 
Status requestUserInput (String inputType, String message, String defaultValue)
 
Status requestCardToken ()
 
Status requestCardData (@NonNull String message, CardInformation.PresentationMethod[] inputMethods)
 
Status requestCardData (String message, String[] inputMethods)
 
Status sendEventResponse (CommerceResponse response)
 
Status sendInputResponse (Bundle inputResponse)
 
Status updateDisplay (@SuppressWarnings("deprecation") OutputContent outputContent)
 
Status sendPrintResponse (String result)
 
Status getState ()
 
Status abort ()
 
Status sendAbortRequest ()
 
DirectResponse sendDirectMessage (String message)
 
DirectResponse sendDirectMessage (String message, String ipAddress, int port)
 
Status getDeviceInformation ()
 
void enableCpTriggerHandling ()
 
void disableCpTriggerHandling ()
 
void setDeviceParams (Map deviceParams)
 
void setDebugMode (int mode)
 
void setDebugParams (Map debugParams)
 
void setDeviceParams (String ip, int port, String prot)
 

Static Public Member Functions

static TransactionManager getTransactionManager (Context context)
 
static TransactionManager getTransactionManager (final Context context, final ServiceConnection altServiceConnection)
 
static TransactionManager getTransactionManager (final Context context, final ServiceConnection altServiceConnection, final Map deviceParams)
 
static void linkToBinder (ITransactionManager transactionBinder)
 

Static Public Attributes

static final String LOGIN_CAPABILITY = "LOGIN_CAPABILITY"
 
static final String DEBUG_MODE_KEY = "DEBUG_MODE_KEY"
 
static final String DEBUG_DELAY_IN_MS_KEY = "DEBUG_DELAY_IN_MS_KEY"
 
static final String DEBUG_FAIL_EVENT_TYPES_KEY = "DEBUG_FAIL_EVENT_TYPES_KEY"
 
static final String DEVICE_IP_ADDRESS_KEY = "DEVICE_IP_ADDRESS_KEY"
 
static final String DEVICE_PORT_KEY = "DEVICE_PORT_KEY"
 
static final String DEVICE_TRAINING_MODE_KEY = "DEVICE_TRAINING_MODE_KEY"
 
static final String DEVICE_PROTOCOL_KEY = "DEVICE_PROTOCOL_KEY"
 
static final String DEVICE_PROTOCOL_EPAS = "EPAS"
 
static final String DEVICE_PROTOCOL_NEXO = "NEXO"
 
static final String DEVICE_PROTOCOL_SCI = "SCI"
 
static final String DEVICE_PROTOCOL_IL = "SCI_IL"
 
static final String DEVICE_PROTOCOL_LOCAL = "LOCAL"
 
static final String DEVICE_PROTOCOL_CRS = "CRS"
 
static final String DEVICE_APPLICATION_NAME_KEY = "DEVICE_APPLICATION_NAME_KEY"
 
static final String DEVICE_APPLICATION_VERSION_KEY = "DEVICE_APPLICATION_VERSION_KEY"
 
static final String DEVICE_APPLICATION_MANUFACTURER_ID_KEY = "DEVICE_APPLICATION_MANUFACTURER_ID_KEY"
 
static final String DEVICE_APPLICATION_CERTIFICATION_CODE_KEY = "DEVICE_APPLICATION_CERTIFICATION_CODE_KEY"
 
static final String DEVICE_SUPPORTED_CP_TRIGGERS_KEY = "DEVICE_SUPPORTED_CP_TRIGGERS_KEY"
 
static final String STATE_UNKNOWN = "STATE_UNKNOWN"
 
static final String STATE_NOT_LOGGED_IN = "STATE_NOT_LOGGED_IN"
 
static final String STATE_LOGGING_IN = "STATE_LOGGING_IN"
 
static final String STATE_LOGGED_IN = "STATE_LOGGED_IN"
 
static final String STATE_SESSION_CLOSED = "STATE_SESSION_CLOSED"
 
static final String STATE_SESSION_OPENING = "STATE_SESSION_OPENING"
 
static final String STATE_SESSION_OPEN = "STATE_SESSION_OPEN"
 
static final String STATE_PAYMENT_PROCESSING = "STATE_PAYMENT_PROCESSING"
 
static final int SESSION_SERVICE_CONNECTING = -4
 
static final int SESSION_CLOSED = 1
 
static final int SESSION_OPEN = 3
 
static final int TRANSACTION_PROCESSING = 5
 
static final String INPUT_TYPE_SIGNATURE = "INPUT_TYPE_SIGNATURE"
 
static final String INPUT_TYPE_EMAIL = "INPUT_TYPE_EMAIL"
 
static final String INPUT_TYPE_NUMBER = "INPUT_TYPE_NUMBER"
 
static final String INPUT_TYPE_DECIMAL = "INPUT_TYPE_DECIMAL"
 
static final String INPUT_TYPE_TEXT = "INPUT_TYPE_TEXT"
 
static final String INPUT_TYPE_PASSWORD = "INPUT_TYPE_PASSWORD"
 
static final String INPUT_TYPE_CONFIRMATION = "INPUT_TYPE_CONFIRMATION"
 
static final String INPUT_TYPE_MANAGER_APPROVAL = "INPUT_TYPE_MANAGER_APPROVAL"
 
static final String INPUT_TYPE_ANY_KEY = "INPUT_TYPE_ANY_KEY"
 
static final String INPUT_TYPE_MENU_OPTIONS = "INPUT_TYPE_MENU_OPTIONS"
 
static final String CONTENT_TYPE_HTML = "CONTENT_TYPE_HTML"
 
static final String CONTENT_TYPE_TEXT = "CONTENT_TYPE_TEXT"
 

Detailed Description

The service handle for performing transactions. Generally, only the static getTransactionManager methods should be used to obtain an instance of this class, ensuring that the proper service and binder are wrapped by this class.

Definition at line 45 of file TransactionManager.java.

Member Function Documentation

◆ abort()

Status abort ( )

Aborts the most recent command, but does not reset the session unless aborting the startSession call. If a new invoice ID is needed, or a new cart, end the session or purge the basket, respectively.

Returns
A status object indicating if the command was issued properly. Events regarding the effect of the command are sent to the registered listener(s).

Definition at line 1174 of file TransactionManager.java.

◆ activateStoredValueCard()

Status activateStoredValueCard ( Payment  payment)

Activates a stored value card. Fires a StoredValueCardEvent to the listeners.

Parameters
paymentA payment object to provide the information needed. Use Payment#setRequestedPaymentAmount(BigDecimal) to define the amount to load, optionally use Payment#setAuthCode(String) to provide a reference auth code, and optionally use Payment#setCardInformation(CardInformation) to provide a StoredValueCardInformation object to provide further information about the stored value card.

Definition at line 831 of file TransactionManager.java.

◆ addGeneralListener() [1/2]

boolean addGeneralListener ( CommerceListener  listener)

Adds a listener for events that occur without an active session. For example, a com.verifone.commerce.payment.reports.ReconciliationEvent is sent outside of a session, as the reconciliation commands are not issued within the context of a session. Returns success if the listener was added or is already registered, and false if the listener was not registered.

Definition at line 373 of file TransactionManager.java.

◆ addGeneralListener() [2/2]

boolean addGeneralListener ( ICommerceListener  listener)

Refer to addGeneralListener(CommerceListener).

Definition at line 379 of file TransactionManager.java.

◆ addSessionListener() [1/2]

boolean addSessionListener ( CommerceListener  listener)

Allows adding new listeners for session events.

Parameters
listenerA listener for session events. There may be more listeners added, but there must always be at least one registered.
Returns
True if the listener was not already registered.

Definition at line 464 of file TransactionManager.java.

◆ addSessionListener() [2/2]

boolean addSessionListener ( ICommerceListener  listener)

Refer to addSessionListener(CommerceListener).

Definition at line 514 of file TransactionManager.java.

◆ cancelTransaction()

Status cancelTransaction ( )

Cancels the current payment or other action, but does not reset the session. If a new invoice ID is needed, or a new cart, end the session or purge the basket, respectively.

Returns
A status object indicating if the command was issued properly. Events regarding the transaction are sent to the registered listener(s).

Definition at line 754 of file TransactionManager.java.

◆ determineReceiptDeliveryMethod()

Status determineReceiptDeliveryMethod ( int []  availableDeliveryMethods,
String  customerPhone,
String  customerEmail 
)

◆ disableCpTriggerHandling()

void disableCpTriggerHandling ( )

Disables all of the CP Triggers that are supported by this version of the SDK, the opposite of enableCpTriggerHandling().

Definition at line 1279 of file TransactionManager.java.

◆ enableCpTriggerHandling()

void enableCpTriggerHandling ( )

Indicates that the calling application is prepared to handle trigger responses for the listed triggers. Enables all of the CP Triggers that are supported by this version of the SDK.

Definition at line 1264 of file TransactionManager.java.

◆ endSession()

boolean endSession ( )

Ends a session. This releases the terminal reservation for this application, allowing other applications to open sessions. This sends a stop message to the terminal to exit the terminal application if launched by this app. The internal service may send this on behalf of this Android application if this application crashes or exits without closing the session. This method should be called prior to the release of the final reference to the Commerce Manager. Once the session is ended, references to any registered listeners are removed once the Session End event is properly reported.

Returns
True if the session end message was submitted successfully. The listener will receive the end event if the session is ended properly, or will receive the appropriate message if the session is not able to be ended.

Definition at line 578 of file TransactionManager.java.

◆ getBasketManager()

BasketManager getBasketManager ( )

The method to get an appropriate concrete implementation of the Basket Manager.

Returns
A concrete implementation of the basket manager.

Definition at line 657 of file TransactionManager.java.

◆ getCardReader()

CardReader getCardReader ( )

The method to get an appropriate concrete implementation of the Card Reader.

Returns
A concrete implementation of the Card Reader

Definition at line 637 of file TransactionManager.java.

◆ getDeviceInformation()

Status getDeviceInformation ( )

Retrieves information on the device, sending a DeviceInformationReceivedEvent to the listener.

Definition at line 1246 of file TransactionManager.java.

◆ getListeners()

List getListeners ( )

Get the set of currently registered listeners.

Returns
The set of ICommerceListeners that are currently registered. This set is independent of the internal set, and should only used as a reference for the current listeners, and not be expected to update with the addition or removal of listeners.

Definition at line 551 of file TransactionManager.java.

◆ getReportManager()

ReportManager getReportManager ( )

The method to get an appropriate concrete implementation of the Report Manager.

Returns
A concrete implementation of the report manager.

Definition at line 681 of file TransactionManager.java.

◆ getState()

Status getState ( )

Immediately returns the current state of the communication between the Android device and the payment terminal. This may change based on messages already sent but not yet handled.

Definition at line 1153 of file TransactionManager.java.

◆ getStoredValueCardBalance()

Status getStoredValueCardBalance ( StoredValueCardInformation  cardInformation)

Retrieves the current balance for a stored value card. Fires a StoredValueCardEvent to the listeners.

Parameters
cardInformationOptionally pass card information to use when fetching the balance. Use StoredValueCardInformation#setType(String) to define the type of card for which we are checking the balance. Use StoredValueCardInformation#setCardPan(String) or StoredValueCardInformation#setCardToken(String) to pass in the information about the card to be checked.

Definition at line 903 of file TransactionManager.java.

◆ getTransaction()

Transaction getTransaction ( )

Gets the most recent transaction. This transaction may still be in progress, and should be treated accordingly.

Returns
The most recent transaction.

Definition at line 598 of file TransactionManager.java.

◆ getTransactionManager() [1/3]

static TransactionManager getTransactionManager ( Context  context)
static

◆ getTransactionManager() [2/3]

static TransactionManager getTransactionManager ( final Context  context,
final ServiceConnection  altServiceConnection 
)
static

◆ getTransactionManager() [3/3]

static TransactionManager getTransactionManager ( final Context  context,
final ServiceConnection  altServiceConnection,
final Map  deviceParams 
)
static

Creates a representation of the proxy to communicate with the Transaction Service. Starts the service binding and initialization process in the background. If called from a background thread, blocks until the service binding and initialization is complete. If called from the main thread, operations should not be performed immediately, instead giving the service time to bind in the background. Attach a ServiceConnection object to receive the proper notifications when the service is bound or if it disconnects unexpectedly. The manager automatically attempts to recover in the cases where the service disconnects unexpectedly, or if other errors occur that drop the connection, so do not attempt to handle those error cases other than delaying messages until the service is reconnected.

Definition at line 263 of file TransactionManager.java.

◆ isCapable()

boolean isCapable ( String  capability)

Checks if the current terminal implementation allows handling of a specific command, as listed in the constants above. Returns true if the interface can handle the command, or false if not.

Definition at line 282 of file TransactionManager.java.

◆ linkToBinder()

static void linkToBinder ( ITransactionManager  transactionBinder)
static

Use this method when bound to the service to link the Transaction Manager.

Definition at line 271 of file TransactionManager.java.

◆ loadStoredValueCard()

Status loadStoredValueCard ( Payment  payment)

Loads an amount on to an existing stored value card. Refer to activateStoredValueCard(Payment).

Definition at line 852 of file TransactionManager.java.

◆ login() [1/2]

Status login ( @Nullable CommerceListener  listener,
@Nullable String  userId,
@Nullable String  password,
@Nullable String  shiftNumber 
)

Logs in through the payment terminal, possibly synchronizing information from the host to the terminal and performing other similar setup/configuration steps. Also used for following transactions, allowing them to be tracked by user and/or according to the shift. Notifies all general listeners with a TransactionEvent of type TransactionEvent#LOGIN_COMPLETED. Use the status from this event to determine the success or failure of the request, using any of the constant error codes to determine the nature of the failure if not successful. This is not used in all regions, please check the requirement by calling isCapable(String) using the constant LOGIN_CAPABILITY.

Parameters
listenerAn optional listener, this is attached to the general events.
userIdThe userId for the current employee/user, this may be required depending on the implementation.
passwordThe appropriate password for the user, this may be required depending on the implementation.
shiftNumberThe current shift number, if applicable, this may be required depending on the implementation.
Returns
Success or failure of sending the request to the terminal. The actual result will be sent using the notification described earlier.

Definition at line 325 of file TransactionManager.java.

◆ login() [2/2]

Status login ( @Nullable ICommerceListener  listener,
@Nullable String  userId,
@Nullable String  password,
@Nullable String  shiftNumber 
)

◆ logout()

Status logout ( )

Logs out through the payment terminal. This must always be used in conjunction with the login(CommerceListener, String, String, String) method. Returns the success or failure of sending the request to the terminal. The actual result will be sent to the general listeners with a TransactionEvent of type TransactionEvent#LOGOUT_COMPLETED. Use the status from this event to determine the success or failure of the request, using any of the constant error codes to determine the nature of the failure if not successful.

Definition at line 354 of file TransactionManager.java.

◆ presentReceiptDeliveryOptions()

Status presentReceiptDeliveryOptions ( int []  availableDeliveryMethods,
String  customerPhone,
String  customerEmail 
)

Allows the customer to choose how they would prefer to receive the receipt, and displays the appropriate choices to the customer.

Parameters
availableDeliveryMethodsThe delivery methods that the POS application can support.
customerPhoneA phone number to pre-propulate the relevant field, or null.
customerEmailAn email address to pre-populate the relevant field, or null.
Returns
The status of the request to the payment terminal. The selection of the receipt delivery method is sent to the register listener(s) in the appropriate ReceiptDeliveryMethodEvent.

Definition at line 939 of file TransactionManager.java.

◆ presentUserOptions()

Status presentUserOptions ( String  header,
String []  buttonLabels 
)

Presents button options to the user and relaying the selected option back to the listener. This does not automatically include a back/exit/cancel option.

EPAS reference 4.5.3 Input, 4.5.3.1 Processing Overview. For #1 Reading Confirmation (“GetAnyKey”), pass a header with a null or empty array of button labels. For #2 Asks a Question (“GetConfirmation”, “SiteManager”), pass two buttons with the appropriate values. For #4 Select an Item in a Menu (“GetMenuEntry”), pass any number of buttons.

SCA reference Customer Buttons. Automatically breaks the header into the appropriate maximum lengths using word wrapping. Supports up to 6 header lines followed by 6 buttons.

Parameters
headerThe message to be displayed to the user, preferably providing context for the user to select the correct option. This is optional.
buttonLabelsAn array of button labels presented to the user. The corresponding event returns the index of the button selected based on this array. This is required.
Returns
The status of the request to the payment terminal. The selected option is returned in the appropriate UserInputEvent.Values#getSelectedIndices().

Definition at line 976 of file TransactionManager.java.

◆ processRefund() [1/2]

Status processRefund ( Payment  payment)

Attempts to refund the specific payment. If multiple payments were accepted in a transaction, this method will need to be called individually for each payment, allowing the listener(s) to better respond to the related events.

Parameters
paymentThe payment to refund.
Returns
The status object indicating if the refund command was issued properly. Events regarding the refund itself are sent to the registered listener(s).

Definition at line 794 of file TransactionManager.java.

◆ processRefund() [2/2]

Status processRefund ( BigDecimal  amount,
String  invoiceId,
String  currency 
)

Please use processRefund(Payment) instead.

Definition at line 808 of file TransactionManager.java.

◆ processVoid()

Status processVoid ( Transaction  transaction)

Attempts to void the transaction.

Parameters
transactionThe transaction to void.
Returns
A status object indicating if the void command was issued properly. Events regarding the void itself are sent to the registered listener(s).

Definition at line 773 of file TransactionManager.java.

◆ removeGeneralListener() [1/2]

boolean removeGeneralListener ( CommerceListener  listener)

Removes a listener for events that occur without an active session. Refer to addGeneralListener(CommerceListener) for more information. Returns success if the listener was removed or is not registered, and false if the listener was not able to be removed.

Definition at line 400 of file TransactionManager.java.

◆ removeGeneralListener() [2/2]

boolean removeGeneralListener ( ICommerceListener  listener)

◆ removeSessionListener() [1/2]

boolean removeSessionListener ( CommerceListener  listener)

Removes a session listener. The last session listener cannot be removed through this method, as there must always be a listener until the session ends.

Parameters
listenerA registered listener for the session events.
Returns
True if the listener exists.

Definition at line 474 of file TransactionManager.java.

◆ removeSessionListener() [2/2]

boolean removeSessionListener ( ICommerceListener  listener)

◆ requestCardData() [1/2]

Status requestCardData ( @NonNull String  message,
CardInformation.PresentationMethod []  inputMethods 
)

Request information about card data from terminal

Parameters
messageThe message to be displayed in terminal
inputMethodsarray of com.verifone.commerce.entities.CardInformation.PresentationMethod, optional
Returns
The status of the request to the terminal.

Definition at line 1037 of file TransactionManager.java.

◆ requestCardData() [2/2]

Status requestCardData ( String  message,
String []  inputMethods 
)

Use requestCardData(String, CardInformation.PresentationMethod[]) Returns information about card data

Parameters
messagemessage to be displayed in terminal
inputMethodsthe array of com.verifone.commerce.entities.CardInformation.PresentationMethod names
Returns
The status of the request to the terminal.

Definition at line 1056 of file TransactionManager.java.

◆ requestCardToken()

Status requestCardToken ( )

Asks the terminal to collect card information from the user and return a token for the information. In some regions, this can also be called after the payment has started to generate a token for the card that is currently being used for payment, instead of requiring a separate card entry action.

Returns
The status of the request to the terminal.

Definition at line 1019 of file TransactionManager.java.

◆ requestUserInput()

Status requestUserInput ( String  inputType,
String  message,
String  defaultValue 
)

Presents the user with a screen to collect information, specially formatting the keyboard and display based on the input type.

Parameters
inputTypeThe type of input requested from the user. This is required.
messageThe message to display to the user to provide context for the input. This is optional.
defaultValueThe default value for the input field. This is optional.
Returns
The status of the request to the payment terminal. The input value is returned in the appropriate UserInputEvent.

Definition at line 999 of file TransactionManager.java.

◆ resumeSession() [1/2]

boolean resumeSession ( CommerceListener  listener,
String  sessionId 
)

Not currently supported. Attempts to resume a session in the case of a Session Closed event or an application crash. If it is not possible to resume, this may return immediately or may send a Session Resume Failed event to the listener.

Parameters
listenerThe first listener for the session events. There may be more listeners added, but there must always be at least one registered.
Returns
True if the session opening message was submitted successfully. The listener will receive the start event if the session is created, or will receive the appropriate message if the session is not able to be created.

Definition at line 454 of file TransactionManager.java.

◆ resumeSession() [2/2]

boolean resumeSession ( ICommerceListener  listener,
String  sessionId 
)

◆ sendAbortRequest()

Status sendAbortRequest ( )

Please use the abort() method instead.

Definition at line 1190 of file TransactionManager.java.

◆ sendDirectMessage() [1/2]

DirectResponse sendDirectMessage ( String  message)

Use TerminalChannel instead. Sends a direct message to the terminal through the service.

Examples: Request / Response for SCA Session Start

<TRANSACTION><FUNCTION_TYPE>SESSION</FUNCTION_TYPE><COMMAND>START</COMMAND><COUNTER>1</COUNTER><MAC>6kQVBRHpYfrbf7BwUK7ZBFkY5IU3C6dHzzTRus/EyDI=</MAC><MAC_LABEL>P_Z5KQJR</MAC_LABEL><TRAINING_MODE>ON</TRAINING_MODE><INVOICE>2S9OBR</INVOICE></TRANSACTION>
<RESPONSE><RESPONSE_TEXT>SESSION started</RESPONSE_TEXT><RESULT>OK</RESULT><RESULT_CODE>-1</RESULT_CODE><TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS><COUNTER>1</COUNTER></RESPONSE>

Request / Response for SCA Session Finish

<TRANSACTION><FUNCTION_TYPE>SESSION</FUNCTION_TYPE><COMMAND>FINISH</COMMAND><COUNTER>2</COUNTER><MAC>s64RROfvmu81Ws1Wg+E+HlOacgS3BMr0LC0dyVpjhFI=</MAC><MAC_LABEL>P_Z5KQJR</MAC_LABEL></TRANSACTION>
<RESPONSE><RESPONSE_TEXT>SESSION finished</RESPONSE_TEXT><RESULT>OK</RESULT><RESULT_CODE>-1</RESULT_CODE><TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS><COUNTER>2</COUNTER></RESPONSE>

Definition at line 1207 of file TransactionManager.java.

◆ sendDirectMessage() [2/2]

DirectResponse sendDirectMessage ( String  message,
String  ipAddress,
int  port 
)

Refer to sendDirectMessage(String) for exampels and information.

Parameters
messageThe message to be sent.
ipAddressThe ipAddress to target. This should generally be passed as null, allowing the device to automatically choose the correct address for the payment terminal.
portThe port to use when communicating. This can be set to 0, allowing the device to determine the port to use for the protocol, but this may need to change based on the message type or other functionality.
Returns
The response from the payment terminal for the given message.

Definition at line 1223 of file TransactionManager.java.

◆ sendEventResponse()

Status sendEventResponse ( CommerceResponse  response)

Sends back the response to a specific event, allowing the POS to asynchronously respond to received events.

Returns
The status of the request to the terminal.

Definition at line 1074 of file TransactionManager.java.

◆ sendInputResponse()

Status sendInputResponse ( Bundle  inputResponse)

Returns the information requested from the terminal, such as updating configuration options or performing similar administrative tasks.

Definition at line 1096 of file TransactionManager.java.

◆ sendPrintResponse()

Status sendPrintResponse ( String  result)

Formerly returned the status when printing something on behalf of the terminal.

Definition at line 1135 of file TransactionManager.java.

◆ setDebugMode()

void setDebugMode ( int  mode)

Allows the service to be set to a different mode, allowing automated testing and other similar tasks.

Parameters
modeOne of the debug modes from the CommerceConstants.

Definition at line 1310 of file TransactionManager.java.

◆ setDebugParams()

void setDebugParams ( Map  debugParams)

A map of recognized debug parameters. Reference the DEBUG constants for more information. Some regions may include additional constants not defined in this file, but these may be recognized by the underlying service as appropriate. Any unrecognized keys will be ignored.

Definition at line 1329 of file TransactionManager.java.

◆ setDeviceParams() [1/2]

void setDeviceParams ( Map  deviceParams)

A map of recognized device parameters. Reference the DEVICE constants for more information. Some regions may include additional constants not defined in this file, but these may be recognized by the underlying service as appropriate. Any unrecognized keys will be ignored.

Definition at line 1291 of file TransactionManager.java.

◆ setDeviceParams() [2/2]

void setDeviceParams ( String  ip,
int  port,
String  prot 
)

Please use setDeviceParams(Map) instead, using the appropriate DEVICE key constants.

Definition at line 1344 of file TransactionManager.java.

◆ startPayment()

Status startPayment ( Payment  payment)

Starts a payment for the current transaction.

Parameters
paymentThe payment object to use. Use Payment#setRequestedPaymentAmount(BigDecimal) to define the amount for a single payment if it should be different than the current transaction total. Use Payment#setAuthorizationMethod(Payment.AuthorizationMethod) to define the required authorization method for this payment.

Definition at line 709 of file TransactionManager.java.

◆ startSale()

Status startSale ( BigDecimal  amount,
String  invoiceId,
String  currency 
)

Initiates a sale on the payment terminal, generating a new transaction without a basket and processing the amount.

Parameters
amountThe total amount to charge to the customer.
invoiceIdThe optional invoice ID to associate with this transaction.
Returns
A status object indicating if the command was issued properly. Events regarding the transaction are sent to the registered listener(s).

Definition at line 729 of file TransactionManager.java.

◆ startSession() [1/4]

boolean startSession ( CommerceListener  listener,
String  userID,
String  password,
int  shiftNumber 
)

◆ startSession() [2/4]

boolean startSession ( CommerceListener  listener)

Starts a session, automatically generating a transaction associated with the session. This transaction is included in the basic TransactionEvent fired, though the type is still com.verifone.commerce.SessionEvent#SESSION_STARTED SESSION_STARTED.

Parameters
listenerThe first listener for the events. There may be more listeners added, but there must always be at least one registered.
Returns
True if the session opening message was submitted successfully. The listener will receive the start event if the session is created, or will receive the appropriate message if the session is not able to be created.

Definition at line 431 of file TransactionManager.java.

◆ startSession() [3/4]

boolean startSession ( CommerceListener  listener,
Transaction  transaction 
)

Refer to startSession(CommerceListener). Optionally specify the transaction, particularly helpful if this session is being opened solely for a non-payment type of transaction.

Definition at line 440 of file TransactionManager.java.

◆ startSession() [4/4]

boolean startSession ( ICommerceListener  listener,
Transaction  transaction 
)

Refer to startSession(CommerceListener).

Definition at line 480 of file TransactionManager.java.

◆ unloadStoredValueCard()

Status unloadStoredValueCard ( Payment  payment)

Removes the requested amount from the stored value card. Refer to activateStoredValueCard(Payment).

Parameters
paymentIf this is null or Payment#getRequestedPaymentAmount() is not set, the entire available balance will be removed from the card, sometimes requiring a balance inquiry before performing the unload. If Payment#getRequestedPaymentAmount() is set to an amount, attempts to remove that amount from the card.

Definition at line 878 of file TransactionManager.java.

◆ updateDisplay()

Status updateDisplay ( @SuppressWarnings("deprecation") OutputContent  outputContent)

Updates the display with arbitrary content. Please prefer the commands in the BasketManager to control the line item display, or the requestUserInput(String, String, String) or presentUserOptions(String, String[]) for interacting with the customer.

Definition at line 1117 of file TransactionManager.java.

◆ updateTransaction()

boolean updateTransaction ( Transaction  transaction)

Allows a transaction to be updated with new values, particularly helpful if the invoice or type needs to be changed, or other similar values.

Definition at line 617 of file TransactionManager.java.

Member Data Documentation

◆ CONTENT_TYPE_HTML

final String CONTENT_TYPE_HTML = "CONTENT_TYPE_HTML"
static

HTML format of the display/message content, used when sending content to be displayed to the customer or handling requests to display or get input from the cashier.

Definition at line 230 of file TransactionManager.java.

◆ CONTENT_TYPE_TEXT

final String CONTENT_TYPE_TEXT = "CONTENT_TYPE_TEXT"
static

Simple text format of the display/message content, used when sending content to be displayed to the customer or handling requests to display or get input from the cashier.

Definition at line 235 of file TransactionManager.java.

◆ DEBUG_DELAY_IN_MS_KEY

final String DEBUG_DELAY_IN_MS_KEY = "DEBUG_DELAY_IN_MS_KEY"
static

The debug parameters key to set how long the service should arbitrarily delay the response. This is particularly helpful when testing in STUB mode for some use cases.

Definition at line 66 of file TransactionManager.java.

◆ DEBUG_FAIL_EVENT_TYPES_KEY

final String DEBUG_FAIL_EVENT_TYPES_KEY = "DEBUG_FAIL_EVENT_TYPES_KEY"
static

The debug parameters key to set which types of events should be arbitrarily returned as failed. This is particularly helpful when testing in STUB mode for some use cases.

Definition at line 71 of file TransactionManager.java.

◆ DEBUG_MODE_KEY

final String DEBUG_MODE_KEY = "DEBUG_MODE_KEY"
static

Configures the debug mode of the device. Must be one of com.verifone.commerce.CommerceConstants#MODE_DEVICE, com.verifone.commerce.CommerceConstants#MODE_SIMULATOR, com.verifone.commerce.CommerceConstants#MODE_STUBS_DEBUG, or 0 to remove any preference.

Definition at line 61 of file TransactionManager.java.

◆ DEVICE_APPLICATION_CERTIFICATION_CODE_KEY

final String DEVICE_APPLICATION_CERTIFICATION_CODE_KEY = "DEVICE_APPLICATION_CERTIFICATION_CODE_KEY"
static

Allows the calling Android application to provide a certification code, sometimes used for certification or to meet other requirements.

Definition at line 140 of file TransactionManager.java.

◆ DEVICE_APPLICATION_MANUFACTURER_ID_KEY

final String DEVICE_APPLICATION_MANUFACTURER_ID_KEY = "DEVICE_APPLICATION_MANUFACTURER_ID_KEY"
static

Allows the calling Android application to provide a manufacturer ID, sometimes used for certification or to meet other requirements.

Definition at line 135 of file TransactionManager.java.

◆ DEVICE_APPLICATION_NAME_KEY

final String DEVICE_APPLICATION_NAME_KEY = "DEVICE_APPLICATION_NAME_KEY"
static

Allows the calling Android application to provide an application name, sometimes used for certification or to meet other requirements.

Definition at line 125 of file TransactionManager.java.

◆ DEVICE_APPLICATION_VERSION_KEY

final String DEVICE_APPLICATION_VERSION_KEY = "DEVICE_APPLICATION_VERSION_KEY"
static

Allows the calling Android application to provide an application version, sometimes used for certification or to meet other requirements.

Definition at line 130 of file TransactionManager.java.

◆ DEVICE_IP_ADDRESS_KEY

final String DEVICE_IP_ADDRESS_KEY = "DEVICE_IP_ADDRESS_KEY"
static

The device parameters key to set which IP address to use for the device. This should generally be left unset, unless testing in the simulator or some other environment.

Definition at line 76 of file TransactionManager.java.

◆ DEVICE_PORT_KEY

final String DEVICE_PORT_KEY = "DEVICE_PORT_KEY"
static

The device parameters key to set which port to use when connecting to the payment application on the payment terminal. This is useful if integrating with a payment application that uses a non-standard port for the messages, and should only be set in specific regions.

Definition at line 83 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_CRS

final String DEVICE_PROTOCOL_CRS = "CRS"
static

The protocol value for Android Card Reader Service

Definition at line 120 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_EPAS

final String DEVICE_PROTOCOL_EPAS = "EPAS"
static

The protocol value when communicating using EPAS, supported for multiple regions.

Definition at line 98 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_IL

final String DEVICE_PROTOCOL_IL = "SCI_IL"
static

The protocol value for Israel.

Definition at line 112 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_KEY

final String DEVICE_PROTOCOL_KEY = "DEVICE_PROTOCOL_KEY"
static

The device parameters key to set if specifying a specific protocol to use when communicating with the payment application. This is generally discovered, though some regions may require this parameter to be set explicitly.

Definition at line 94 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_LOCAL

final String DEVICE_PROTOCOL_LOCAL = "LOCAL"
static

The protocol value for Android Payment App

Definition at line 116 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_NEXO

final String DEVICE_PROTOCOL_NEXO = "NEXO"
static

The protocol value when communicating using NEXO, supported for multiple regions. EPAS changed its name to NEXO when moving to version 3.0.

Definition at line 103 of file TransactionManager.java.

◆ DEVICE_PROTOCOL_SCI

final String DEVICE_PROTOCOL_SCI = "SCI"
static

The protocol value when communicating using the general SCI protocol, without region-specific modifications.

Definition at line 108 of file TransactionManager.java.

◆ DEVICE_SUPPORTED_CP_TRIGGERS_KEY

final String DEVICE_SUPPORTED_CP_TRIGGERS_KEY = "DEVICE_SUPPORTED_CP_TRIGGERS_KEY"
static

Allows the calling Android application to define which CP Triggers it can support. When passed, this expects an array of the corresponding event types, e.g., if Amount Adjustment is supported, include the value from AmountAdjustedEvent#TYPE in the array. Refer to enableCpTriggerHandling() for more information.

Definition at line 147 of file TransactionManager.java.

◆ DEVICE_TRAINING_MODE_KEY

final String DEVICE_TRAINING_MODE_KEY = "DEVICE_TRAINING_MODE_KEY"
static

The device parameters key to set training mode for the device (true or false). This should generally be left unset, unless testing in the simulator or some other environment.

Definition at line 88 of file TransactionManager.java.

◆ INPUT_TYPE_ANY_KEY

final String INPUT_TYPE_ANY_KEY = "INPUT_TYPE_ANY_KEY"
static

Input type requiring any key to proceed. Used for requestUserInput(String, String, String) and

Definition at line 219 of file TransactionManager.java.

◆ INPUT_TYPE_CONFIRMATION

final String INPUT_TYPE_CONFIRMATION = "INPUT_TYPE_CONFIRMATION"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 210 of file TransactionManager.java.

◆ INPUT_TYPE_DECIMAL

final String INPUT_TYPE_DECIMAL = "INPUT_TYPE_DECIMAL"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 198 of file TransactionManager.java.

◆ INPUT_TYPE_EMAIL

final String INPUT_TYPE_EMAIL = "INPUT_TYPE_EMAIL"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 190 of file TransactionManager.java.

◆ INPUT_TYPE_MANAGER_APPROVAL

final String INPUT_TYPE_MANAGER_APPROVAL = "INPUT_TYPE_MANAGER_APPROVAL"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 214 of file TransactionManager.java.

◆ INPUT_TYPE_MENU_OPTIONS

final String INPUT_TYPE_MENU_OPTIONS = "INPUT_TYPE_MENU_OPTIONS"
static

Input type to present multiple options in a menu. Used for requestUserInput(String, String, String) and

Definition at line 224 of file TransactionManager.java.

◆ INPUT_TYPE_NUMBER

final String INPUT_TYPE_NUMBER = "INPUT_TYPE_NUMBER"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 194 of file TransactionManager.java.

◆ INPUT_TYPE_PASSWORD

final String INPUT_TYPE_PASSWORD = "INPUT_TYPE_PASSWORD"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 206 of file TransactionManager.java.

◆ INPUT_TYPE_SIGNATURE

final String INPUT_TYPE_SIGNATURE = "INPUT_TYPE_SIGNATURE"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 186 of file TransactionManager.java.

◆ INPUT_TYPE_TEXT

final String INPUT_TYPE_TEXT = "INPUT_TYPE_TEXT"
static

This is input type const for requestUserInput(String, String, String) method.

Definition at line 202 of file TransactionManager.java.

◆ LOGIN_CAPABILITY

final String LOGIN_CAPABILITY = "LOGIN_CAPABILITY"
static

To be used with the isCapable(String) method, determining if the current implementation supports login/logout. If an implementation supports login/logout, it is generally a required action that must be performed before starting a session or performing other actions.

Definition at line 53 of file TransactionManager.java.

◆ SESSION_CLOSED

final int SESSION_CLOSED = 1
static

Please use STATE_NOT_LOGGED_IN.

Definition at line 175 of file TransactionManager.java.

◆ SESSION_OPEN

final int SESSION_OPEN = 3
static

Please use STATE_LOGGED_IN.

Definition at line 178 of file TransactionManager.java.

◆ SESSION_SERVICE_CONNECTING

final int SESSION_SERVICE_CONNECTING = -4
static

Please use STATE_LOGGING_IN.

Definition at line 172 of file TransactionManager.java.

◆ STATE_LOGGED_IN

final String STATE_LOGGED_IN = "STATE_LOGGED_IN"
static

A login has been initiated and was accepted.

Definition at line 157 of file TransactionManager.java.

◆ STATE_LOGGING_IN

final String STATE_LOGGING_IN = "STATE_LOGGING_IN"
static

A login has been initiated and is currently being attempted.

Definition at line 155 of file TransactionManager.java.

◆ STATE_NOT_LOGGED_IN

final String STATE_NOT_LOGGED_IN = "STATE_NOT_LOGGED_IN"
static

There is not currently a login session active, which may or may not be a problem.

Definition at line 153 of file TransactionManager.java.

◆ STATE_PAYMENT_PROCESSING

final String STATE_PAYMENT_PROCESSING = "STATE_PAYMENT_PROCESSING"
static

A payment is being processed, which may or may not require further interaction from the customer or cashier.

Definition at line 168 of file TransactionManager.java.

◆ STATE_SESSION_CLOSED

final String STATE_SESSION_CLOSED = "STATE_SESSION_CLOSED"
static

There is not a session active.

Definition at line 159 of file TransactionManager.java.

◆ STATE_SESSION_OPEN

final String STATE_SESSION_OPEN = "STATE_SESSION_OPEN"
static

A session is open, and may already have basket items or even payments processed.

Definition at line 163 of file TransactionManager.java.

◆ STATE_SESSION_OPENING

final String STATE_SESSION_OPENING = "STATE_SESSION_OPENING"
static

A session is currently being opened.

Definition at line 161 of file TransactionManager.java.

◆ STATE_UNKNOWN

final String STATE_UNKNOWN = "STATE_UNKNOWN"
static

The current state is unknown or otherwise unrecognized. This will rarely happen.

Definition at line 151 of file TransactionManager.java.

◆ TRANSACTION_PROCESSING

final int TRANSACTION_PROCESSING = 5
static

Refer to STATE_SESSION_OPEN.

Definition at line 181 of file TransactionManager.java.


The documentation for this class was generated from the following file:

This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.