White-label App SDK
API Reference
HeadlessSetup

HeadlessSetup

Overview

The HeadlessSetup object provides essential methods for initializing and configuring the SoftPOS. This includes setting up EMV parameters, CAPKs, terminal parameters and keys.

Methods

initSoftPos

This is a suspended method and should be called within a coroutine.

Initializes the SoftPOS SDK. This method should be called each time the application starts up (for example, in the Application's onCreate).

Parameters

NameTypeConditionDescription
appApplicationRequiredThe application instance.
licenseFileNameStringRequiredThe name of the license file.

Returns

Return TypeDescription
WrappedResult<SdkInitResp>A wrapped result containing the SDK version and ID.

Usage

val initResult = HeadlessSetup.initSoftPos(application, "license_file_name")
// Success(value=SdkInitResp(sdkVersion=1.10.105.12.17, sdkId=4411be126c0c91b7))

initialSetup

This is a suspended method and should be called within a coroutine.

Performs the initial setup for the SoftPOS. This method should be called once per app installation.

Parameters

NameTypeDescription
contextContextThe application or activity context.
builderAction(SetupOptionBuilder.() -> Unit)? = nullOptional configuration for the setup options.

Returns

Return TypeDescription
SetupRespThe setup response containing the results of the setup process.

Usage

// with default option
val setupResult1 = HeadlessSetup.initialSetup(context)
 
// with test capk
val setupResult2 = HeadlessSetup.initialSetup(context) {
    withTestCapk = true
}

getEmvParams

Retrieves the list of configured EMV parameters.

Returns

Return TypeDescription
List<EmvParam>A list of EMV parameters.

Usage

val emvParams = HeadlessSetup.getEmvParams()

getCapks

Retrieves the list of configured CAPKs.

Returns

Return TypeDescription
List<CapkParam>A list of CAPKs.

Usage

val capks = HeadlessSetup.getCapks()

getTermParam

Retrieves the terminal parameters.

Returns

Return TypeDescription
TerminalParamThe terminal parameters.

Usage

val termParam = HeadlessSetup.getTermParam()

Data Classes

SetupResp

Represents the setup response.

Properties

PropertyTypeDescription
sdkResWrappedResult<SdkInitResp>The SDK initialization result.
emvResList<WrappedResult<EmvParamResp>>The EMV setup results.
capkResList<WrappedResult<CapkResp>>The CAPK setup results.
termResWrappedResult<TermParamResp>The terminal setup result.
keyResList<WrappedResult<InjectKeyResp>>The key setup results.

SdkInitResp

Represents the SDK initialization response.

Properties

PropertyTypeDescription
sdkVersionStringThe SDK version.
sdkIdStringThe SDK ID.

EmvParamResp

Represents the EMV parameter response.

Properties

PropertyTypeDescription
aidStringThe AID of the EMV parameter.

CapkResp

Represents the CAPK response.

Properties

PropertyTypeDescription
ridStringThe RID of the CAPK.
keyIndexIntThe key index of the CAPK.

TermParamResp

Represents the terminal parameter response.

Properties

PropertyTypeDescription
terminalTypeStringThe terminal type.

InjectKeyResp

Represents the injected key response.

Properties

PropertyTypeDescription
clientKeyTypeStringThe client key type.