Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
CommerceManager Class Referenceabstract

Public Member Functions

abstract boolean startSession (CommerceListener listener)
 
abstract boolean startSession (CommerceListener listener, String userID, String password, int shiftNumber)
 
abstract boolean resumeSession (CommerceListener listener, String sessionId)
 
abstract boolean addSessionListener (CommerceListener listener)
 
abstract boolean removeSessionListener (CommerceListener listener)
 
abstract Set< CommerceListenergetListeners ()
 
abstract boolean endSession ()
 

Detailed Description

The service handle for any communication using the trigger or payment APIs. While multiple Commerce Managers may be created, only one will be able to maintain a session at a given time.

Definition at line 9 of file CommerceManager.java.

Member Function Documentation

◆ addSessionListener()

abstract boolean addSessionListener ( CommerceListener  listener)
abstract

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.

◆ endSession()

abstract boolean endSession ( )
abstract

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 SessionListeners are removed once the Session End event is properly reported.

Returns
True if the session end message was submitted successfully. The SessionListener 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.

◆ getListeners()

abstract Set<CommerceListener> getListeners ( )
abstract

Get the set of currently registered listeners.

Returns
A set of listeners. 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.

◆ removeSessionListener()

abstract boolean removeSessionListener ( CommerceListener  listener)
abstract

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.

◆ resumeSession()

abstract boolean resumeSession ( CommerceListener  listener,
String  sessionId 
)
abstract

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.
sessionIdThe id of the session to resume.
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.

◆ startSession() [1/2]

abstract boolean startSession ( CommerceListener  listener)
abstract

Starts a session. This reserves the terminal for this application, preventing conflicts with other apps. When the Android app starts a session, the service will keep track of the app, allowing the service to handle cases where the app is terminated before endSession() is called.

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 SessionListener 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.

◆ startSession() [2/2]

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

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.