public class PaymentSdkInterface

The PaymentSdk is the main entry point for the SDK. Connection management is handled by this component.



public void UseDevice(PsdkDeviceInformation device, boolean saveDevice)

Sets/Removes this device as the one to use for future connections.


public void addListener(CommerceListener2 listener)

Allows adding new listeners for events.

  • listener – A listener for events.


public static boolean configureLogFile(String filename, long size)

Sets the filename (including path) and maximum size (in KiB) for the log. The log will be truncated on reaching maximum size. Can be called before Initialize().


public static void configureLogLevel(PsdkLogLevel level)

Sets the log verbosity to desired level


public static PaymentSdkInterface create(PlatformContextInterface platformContext)


public void displayConfiguration(CommerceListener2 listener)

Displays the current configuration, or launches the setup wizard if setup is required. This is useful both when handling StatusCode.SetupRequired and displaying a general settings screen. This should be overridden by a method that also accepts the appropriate context/controller to display the setup screens, or returns the controller to be pushed onto the stack, this method is only provided to require subclasses to implement the necessary command, and should be hidden or restricted from being called directly.


public AccessibilityManager getAccessibilityManager()

Get AccessibilityManager for this session. Must have called setupSession successfully prior to making this call


public PsdkDeviceInformation getDeviceInformation()

Simply returns the cached information about the device, does not perform any type of query to the device.


public TransactionManager getTransactionManager()

Get TransactionManager for this session Must have called setupSession successfully prior to making this call


public static String getVersion()


public void initialize(CommerceListener2 listener)

Initializes the SDK, checking that the configuration is correct and the Engage device is configured and reachable. The listener receives a Status with type Status.STATUS_INITIALIZED. Expect StatusCode.SetupRequired to be sent if the device is not configured. Internally, create the platform context, coordinator, load the configuration, and initialize the various modules such as transport, payment adapter, and navigator.


public void initializeFromFile(CommerceListener2 listener, String path)

Initializes the SDK using the values read from the file combined with the values configured by the user and detected by the system. It’s important that the application already has the necessary permissions to read this file, the SDK will only try to read it directly. The file must be configured according to the configuration file documentation.


public void initializeFromValues(CommerceListener2 listener, HashMap<String, String> config)

Initializes the SDK using a parameter map passed into the method.


public void initializeWithConnection(CommerceListener2 listener, HashMap<String, String> config, ConnectionInterface connection)

Initializes the SDK using a parameter map passed into the method and using the provided connection.


public void removeListener(CommerceListener2 listener)

Removes a listener. The last listener cannot be removed through this method, as there must always be a listener until the PSDK is torn down.

  • listener – A registered listener for the session events.


public void tearDown()

Teardown the session and all associated connections. Any objects that were returned from methods like getTransactionManager() will also be torn down after this call and any remaining references should not be used.