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
Name | Type | Condition | Description |
---|---|---|---|
app | Application | Required | The application instance. |
licenseFileName | String | Required | The name of the license file. |
Returns
Return Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
context | Context | The application or activity context. |
builderAction | (SetupOptionBuilder.() -> Unit)? = null | Optional configuration for the setup options. |
Returns
Return Type | Description |
---|---|
SetupResp | The 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 Type | Description |
---|---|
List<EmvParam> | A list of EMV parameters. |
Usage
val emvParams = HeadlessSetup.getEmvParams()
getCapks
Retrieves the list of configured CAPKs.
Returns
Return Type | Description |
---|---|
List<CapkParam> | A list of CAPKs. |
Usage
val capks = HeadlessSetup.getCapks()
getTermParam
Retrieves the terminal parameters.
Returns
Return Type | Description |
---|---|
TerminalParam | The terminal parameters. |
Usage
val termParam = HeadlessSetup.getTermParam()
Data Classes
SetupResp
Represents the setup response.
Properties
Property | Type | Description |
---|---|---|
sdkRes | WrappedResult<SdkInitResp> | The SDK initialization result. |
emvRes | List<WrappedResult<EmvParamResp>> | The EMV setup results. |
capkRes | List<WrappedResult<CapkResp>> | The CAPK setup results. |
termRes | WrappedResult<TermParamResp> | The terminal setup result. |
keyRes | List<WrappedResult<InjectKeyResp>> | The key setup results. |
SdkInitResp
Represents the SDK initialization response.
Properties
Property | Type | Description |
---|---|---|
sdkVersion | String | The SDK version. |
sdkId | String | The SDK ID. |
EmvParamResp
Represents the EMV parameter response.
Properties
Property | Type | Description |
---|---|---|
aid | String | The AID of the EMV parameter. |
CapkResp
Represents the CAPK response.
Properties
Property | Type | Description |
---|---|---|
rid | String | The RID of the CAPK. |
keyIndex | Int | The key index of the CAPK. |
TermParamResp
Represents the terminal parameter response.
Properties
Property | Type | Description |
---|---|---|
terminalType | String | The terminal type. |
InjectKeyResp
Represents the injected key response.
Properties
Property | Type | Description |
---|---|---|
clientKeyType | String | The client key type. |