Logo
Api reference

NGHeadlessSetup

NGHeadlessSetup

Overview

The NGHeadlessSetup 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

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

Returns

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

Usage

val initResult = NGHeadlessSetup.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)?Optional configuration for the setup options.

Returns

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

Usage

// with default option
val setupResult1 = NGHeadlessSetup.initialSetup(context)

// with test capk
val setupResult2 = NGHeadlessSetup.initialSetup(context) {
  withTestCapk = true
}

getEmvParams

Retrieves the list of configured EMV parameters.

Returns

TypeDescription
List<EmvParam>A list of EMV parameters.

Usage

val emvParams = NGHeadlessSetup.getEmvParams()

getCapks

Retrieves the list of configured CAPKs.

Returns

TypeDescription
List<CapkParam>A list of CAPKs.

Usage

val capks = NGHeadlessSetup.getCapks()

getTermParam

Retrieves the terminal parameters.

Returns

TypeDescription
TerminalParamThe terminal parameters.

Usage

val termParam = NGHeadlessSetup.getTermParam()

Data Classes

SetupResp

Represents the setup response.

Properties

NameTypeDescription
sdkResNGWrappedResult<SdkInitResp>The SDK initialization result.
emvResList<NGWrappedResult<EmvParamResp>>The EMV setup results.
capkResList<NGWrappedResult<CapkResp>>The CAPK setup results.
termResNGWrappedResult<TermParamResp>The terminal setup result.
keyResList<NGWrappedResult<InjectKeyResp>>The key setup results.

SdkInitResp

Represents the SDK initialization response.

Properties

NameTypeDescription
sdkVersionStringThe SDK version.
sdkIdStringThe SDK ID.

EmvParamResp

Represents the EMV parameter response.

Properties

NameTypeDescription
aidStringThe AID of the EMV parameter.

CapkResp

Represents the CAPK response.

Properties

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

TermParamResp

Represents the terminal parameter response.

Properties

NameTypeDescription
terminalTypeStringThe terminal type.

InjectKeyResp

Represents the injected key response.

Properties

NameTypeDescription
clientKeyTypeStringThe client key type.

On this page