PosLinkSDK

interface PosLinkSDK

Interface for the PosLink integration SDK APIs.

It contains methods specific to PosLink integration type and upon successful setup, the com.teya.unifiedepossdk.TeyaCommonTransactionsApi instance will be available, which has a common API with other integration types for creating transactions.

Types

Link copied to clipboard
sealed interface AuthConfig

Authentication configuration for the PosLink integration. It has two options: Delegated and Managed.

Link copied to clipboard
Link copied to clipboard
class GetTerminalsFailure(val reason: PosLinkSDK.GetTerminalsFailure.Reason, val debugErrorMessage: String? = null)

Represents a failure when retrieving the list of terminals.

Link copied to clipboard
class LinkTerminalFailure(val reason: PosLinkSDK.LinkTerminalFailure.Reason, val debugErrorMessage: String? = null)

Represents a failure when linking to a terminal.

Link copied to clipboard

Callback invoked when setup fails with SetupFailure

Link copied to clipboard

Callback invoked when setup is successful com.teya.unifiedepossdk.TeyaCommonTransactionsApi.

Link copied to clipboard
class SetupFailure(val reason: PosLinkSDK.SetupFailure.Reason, val debugErrorMessage: String? = null)

Represents possible failure reasons during the setup process.

Properties

Link copied to clipboard

Provides information about the currently linked device and store. Only non-null when both store and terminal are linked.

Link copied to clipboard
abstract val linkedStore: Store?

Provides information about the currently linked store.

Link copied to clipboard
abstract val linkedTerminal: Terminal?

Provides information about the currently linked device.

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun clearDeviceLink()

Removes the linked device information. After invoking this method, the previously returned com.teya.unifiedepossdk.TeyaCommonTransactionsApi instance will still reference the same device. To link a new device, setup must be called again.

Link copied to clipboard
abstract fun clearUserAuth()

Removes the stored authentication information as well as store and device linking. After invoking this method, the previously returned com.teya.unifiedepossdk.TeyaCommonTransactionsApi instance will no longer function. To restore functionality, setup must be called again.

Link copied to clipboard
abstract fun getTerminals(onFailure: (PosLinkSDK.GetTerminalsFailure) -> Unit, onSuccess: (List<Terminal>) -> Unit, forceRefresh: Boolean)

Retrieves the list of terminals associated with the currently linked store.

Link copied to clipboard
abstract fun linkTerminal(terminalId: String? = null, onSuccess: (Terminal) -> Unit, onFailure: (PosLinkSDK.LinkTerminalFailure) -> Unit)

Links to a terminal from the current store with the given terminalId, or shows the terminal selection UI if terminalId is null.

Link copied to clipboard

abstract fun setup(onFailure: (PosLinkSDK.SetupFailure) -> Unit, onSuccess: () -> Unit)

Sets up the PosLink integration.

abstract fun setup(preselectedStore: Store, onFailure: (PosLinkSDK.SetupFailure) -> Unit, onSuccess: () -> Unit)

Like setup but allows for passing in a Store that will be used to get the list of terminals. UI to show a list of stores will not be shown in this case.

Link copied to clipboard
abstract fun setupAuthAndStore(onFailure: (PosLinkSDK.SetupFailure) -> Unit, onSuccess: () -> Unit)

Same as setup but skips terminal linking.

abstract fun setupAuthAndStore(preselectedStore: Store, onFailure: (PosLinkSDK.SetupFailure) -> Unit, onSuccess: () -> Unit)

Like setup (the one with preselectedStore parameter), but skips terminal linking.

Link copied to clipboard
abstract fun setupTransactionsApi(onFailure: (PosLinkSDK.Failure) -> Unit, onSuccess: (TeyaCommonTransactionsApi) -> Unit)