Token Developer Portal
OKC Platform
OKC Platform
  • Architecture
  • Quick Start Guide
  • Template Banking App
  • Payment Services
    • UI Components
    • Card Service
    • Bank App Protocol
    • SDK Integrations
    • 🆕Doviz POS Integration
    • In Car Pay Integration
  • System and Security Services
    • KMS Library
    • Device Library
    • RKL CA service
    • TMS Service
    • Printer Service
    • TokenUSDK
  • Versions
    • Platform Versions
Powered by GitBook
On this page
  • Introduction
  • Integration Guide
  • Definitions
  • Functions
  • Function List
  • DeviceInfo(Context context)
  • void getFiscalId(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getImeiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getImsiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getSecureBoardVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getModemVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getDeviceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getFiscalVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getOperationMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getServiceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getCardRedirection(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getEmvKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getLinuxKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getROOTFSVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getEMVCLVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void getFields(DeviceInfoResponseHandler deviceInfoResponseHandler)
  • void setAppParams(DeviceInfoAppParamsSetterHandler deviceInfoResponseHandler, final String terminalId, final String merchantId)
  1. System and Security Services

Device Library

The Device Library simplifies device information management by utilizing the Device Info Service for efficient data handling. This document outlines how to use the available functions.

PreviousKMS LibraryNextRKL CA service

Last updated 2 months ago

Introduction

The DeviceInfoService enables applications to retrieve detailed device information such as IMEI, IMSI, EMVCL version, fiscal ID, ROOTFS version, and more. It supports both single-field queries and batch requests, providing an easy way to access important device details. The service also allows configuring the terminal and merchant IDs for the application.

Integration Guide

  1. Copy most recent aar lib file into your project.

  2. Make sure you include aar lib in your Project. In this example project, it is done in /app/.build.gradle file like this:

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
    ...
}

You can access example usage from .

Definitions

Device Operation Mods;

public static enum PosModeEnum {
    VUK507,
    POS,
    GIB,
    ECR,
    EFT_POS;
}

The PosModeEnum defines various modes representing specific regulatory, functional, and technical implementations for POS systems.

  • VUK507 refers to compliance with the 507th circular under the Tax Procedure Law (Vergi Usul Kanunu). It enables businesses to issue e-documents (e-invoices, e-archives) and process payments through secure and integrated systems. This mode is commonly used in Android-based applications or devices to reduce costs by eliminating the need for physical POS terminals. It is ideal for businesses aiming to digitize financial operations in accordance with Turkish tax regulations.

  • POS represents traditional Point of Sale systems. These systems are used for in-store payment processing and sales tracking while integrating with inventory control and other retail management tools. This mode is suitable for retail businesses operating with physical POS hardware or software solutions.

  • GIB denotes integration with the Gelir İdaresi BaÅŸkanlığı (Revenue Administration of Turkey). This mode ensures compliance with government standards for secure financial transactions, tax reporting, and electronic document exchange. It is used in scenarios requiring direct communication with government systems for tax and audit purposes.

  • ECR, or Electronic Cash Register, is designed for managing sales and printing fiscal receipts in compliance with tax regulations. These systems are often used in retail environments where real-time tax reporting is mandatory through integration with government systems.

  • EFT_POS stands for Electronic Funds Transfer at Point of Sale. This mode supports secure electronic payment transactions through credit or debit cards. It integrates with various payment systems to ensure seamless fund transfers between customers and businesses, making it ideal for operations focused on digital and card-based payment methods.

Card Redirection Mods;

public static enum CardRedirect {
    NO,
    YES,
    NOT_ASSIGNED;
}

The CardRedirect enumeration is used to define the status of card redirection during the payment processing flow, particularly when managing transactions across multiple active bank applications with card routing capabilities. This enumeration is relevant for determining whether a sales transaction is routed to a specific bank application after a contactless card is read. The values in this enum represent the routing behavior as follows:

  • NO indicates that card redirection is disabled. In this case, the transaction will not be routed to an external bank application and will proceed using the current bank's processing flow.

  • YES signifies that card redirection is enabled. When a card is read, the payment gateway will route the transaction to the appropriate bank application based on the card routing flow. This could be to a default contactless bank, issuer bank, or brand-specific bank, depending on the routing logic.

  • NOT_ASSIGNED represents an undefined or uninitialized state for card redirection. This status is typically used when the card redirection setting has not been configured yet, leaving the routing behavior to be determined at a later stage.

Field Class;

public static class Field
{
    public static final int SECURE_BOARD_VERSION;
    public static final int MODEM_VERSION;
    public static final int FISCAL_ID;
    public static final int IMEI_NUMBER;
    public static final int IMSI_NUMBER;
    public static final int DEVICE_MODE;
    public static final int FISCAL_VERSION;
    public static final int OPERATION_MODE;
    public static final int SERVICE_MODE;
    public static final int CARD_REDIRECTION;
    public static final int GET_EMV_KERNEL_VERSION;
    public static final int GET_LINUX_KERNEL_VERSION;
    public static final int GET_ROOTFS_VERSION;
    public static final int GET_EMVCL_VERSION;
}

The Field class contains constants that represent different fields of device information that can be retrieved through the DeviceInfoService. These constants are used when querying specific data points related to the device's configuration and status. The following fields are defined:

  • SECURE_BOARD_VERSION refers to the version of the secure board in the device, which is essential for verifying the integrity and security of the hardware.

  • MODEM_VERSION represents the version of the modem in the device, which is useful for identifying the capabilities and compatibility of the device's communication module.

  • FISCAL_ID identifies the unique fiscal identifier of the device.

  • IMEI_NUMBER corresponds to the International Mobile Equipment Identity (IMEI) number, a unique identifier for the device used for mobile network operations.

  • IMSI_NUMBER stands for the International Mobile Subscriber Identity (IMSI) number, which is associated with the SIM card used for network identification.

  • DEVICE_MODE indicates the operational mode of the device, which can be development, testing, or production, defining the environment in which the device is currently operating.

  • FISCAL_VERSION specifies the version of the fiscal software or system running on the device, which is relevant for ensuring compliance with local fiscal regulations.

  • OPERATION_MODE describes the mode in which the device is operating, for payments, administrative tasks, or other specific functionalities.

  • SERVICE_MODE represents the service or customer mode of the device, indicating whether the device is operating in a service/maintenance mode or a customer-facing mode for transactions.

  • CARD_REDIRECTION indicates whether card redirection is enabled, determining if payment processing is routed to an external service for handling.

  • GET_EMV_KERNEL_VERSION specifies the version of the EMV kernel used in the device for processing card transactions.

  • GET_LINUX_KERNEL_VERSION refers to the version of the Linux kernel running on the device, which is important for understanding the underlying operating system and compatibility.

  • GET_ROOTFS_VERSION indicates the version of the root filesystem on the device, which includes the core system files and configurations.

  • GET_EMVCL_VERSION specifies the version of the EMV Contactless (EMVCL) protocol supported by the device, which is used for contactless card transactions.

Functions

Function List

DeviceInfo(Context context)

The DeviceInfo is a constructor function which creates an instance of DeviceInfo class. It is recommended to reuse this instance when possible instead of creating a new one each time.

val deviceInfo = DeviceInfo(this)
DeviceInfo deviceInfo = new DeviceInfo(this);

void getFiscalId(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getFiscalId function retrieves the fiscal ID from the service.

deviceInfo.getFiscalId(object: DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Fiscal ID", result)
    }
    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
});
deviceInfo.getFiscalId(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Fiscal ID", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getImeiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getImeiNumber function retrieves the IMEI from the service.

deviceInfo.getImeiNumber(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("IMEI Number", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getImeiNumber(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("IMEI Number", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getImsiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getImsiNumber function retrieves the IMSI from the service.

deviceInfo.getImsiNumber(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("IMSI Number", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getImsiNumber(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("IMSI Number", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getSecureBoardVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getSecureBoardVersion function retrieves the secure board version from the service.

deviceInfo.getSecureBoardVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Secure Board Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getSecureBoardVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Secure Board Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getModemVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getModemVersion function retrieves the modem version from the service.

deviceInfo.getModemVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Modem Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Modem Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getDeviceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getDeviceMode function retrieves the device mode from the service.

deviceInfo.getDeviceMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Device Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getDeviceMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Device Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getFiscalVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getFiscalVersion function retrieves the fiscal version from the service.

deviceInfo.getFiscalVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Fiscal Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getFiscalVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Fiscal Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getOperationMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getOperationMode function retrieves the operation mode from the service.

deviceInfo.getOperationMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Operation Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getOperationMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Operation Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getServiceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getServiceMode function retrieves the service mode from the service.

deviceInfo.getServiceMode(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Service Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getServiceMode(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Service Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getCardRedirection(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getCardRedirection function retrieves the card redirection mode from the service.

deviceInfo.getCardRedirection(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Card Redirection Mode", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Card Redirection Mode", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getEmvKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getEmvKernelVersion function retrieves the EMV kernel version from the service.

deviceInfo.getEmvKernelVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("EMV Kernel Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getEmvKernelVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Modem Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getLinuxKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getLinuxKernelVersion function retrieves the linux kernel version from the service.

deviceInfo.getLinuxKernelVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("Linux Kernel Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getLinuxKernelVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("Linux Kernel Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getROOTFSVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getROOTFSVersion function retrieves the ROOTFS version from the service.

deviceInfo.getModemVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("ROOTFS Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getModemVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("ROOTFS Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getEMVCLVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getEMVCLVersion function retrieves the EMVCL version from the service.

deviceInfo.getEMVCLVersion(object : DeviceInfoResponseHandler {
    override fun onSuccess(result: String) {
        Log.i("EMVCL Version", result)
    }

    override fun onFail(errMessage: String) {
        Log.i("Error Message", errMessage)
    }
})
deviceInfo.getEMVCLVersion(new DeviceInfo.DeviceInfoResponseHandler() {
    @Override
    public void onSuccess(String result) {
        Log.i("EMVCL Version", result)
    }
    @Override
    public void onFail(String errMessage) {
        Log.i("Error Message", errMessage)
    }
});

void getFields(DeviceInfoResponseHandler deviceInfoResponseHandler)

The getFields function retrieves multiple fields with a single call.

deviceInfo.getFields(
        { fields ->
            if (fields == null) return
            Log.i("Example 1", "Fiscal ID: " + fields.get(0))
            Log.i("Example 2", "IMEI Number: " + fields.get(1))
            Log.i("Example 3", "IMSI Number: " + fields.get(2))
            Log.i("Example 4", "Secure Board Version: " + fields.get(3))
            Log.i("Example 5", "Modem Version: " + fields.get(4))
            Log.i("Example 6", "Device Mode: " + fields.get(5))
            Log.i("Example 7", "Fiscal Version: " + fields.get(6))
            Log.i("Example 8", "Operation Mode: " + fields.get(7))
            Log.i("Example 9", "Service Mode: " + fields.get(8))
            Log.i("Example 10", "Card Redirection: " + fields.get(9))
            Log.i("Example 11", "EMV Kernel Version: " + fields.get(10))
            Log.i("Example 12", "Linux Kernel Version: " + fields.get(11))
            Log.i("Example 13", "ROOTFS Version: " + fields.get(12))
            Log.i("Example 14", "EMVCL Version: " + fields.get(13))
        },
        DeviceInfo.Field.FISCAL_ID, 
        DeviceInfo.Field.IMEI_NUMBER, 
        DeviceInfo.Field.IMSI_NUMBER, 
        DeviceInfo.Field.SECURE_BOARD_VERSION, 
        DeviceInfo.Field.MODEM_VERSION, 
        DeviceInfo.Field.DEVICE_MODE,
        DeviceInfo.Field.FISCAL_VERSION,
        DeviceInfo.Field.OPERATION_MODE, 
        DeviceInfo.Field.SERVICE_MODE, 
        DeviceInfo.Field.CARD_REDIRECTION, 
        DeviceInfo.Field.GET_EMV_KERNEL_VERSION, 
        DeviceInfo.Field.GET_LINUX_KERNEL_VERSION, 
        DeviceInfo.Field.GET_ROOTFS_VERSION, 
        DeviceInfo.Field.GET_EMVCL_VERSION
)
deviceInfo.getFields(fields -> {
        if (fields == null) return
            Log.i("Example 1", "Fiscal ID: " + fields[0]);
            Log.i("Example 2", "IMEI Number: " + fields[1]);
            Log.i("Example 3", "IMSI Number: " + fields[2]);
            Log.i("Example 4", "Secure Board Version: " + fields[3]);
            Log.i("Example 5", "Modem Version: " + fields[4]);
            Log.i("Example 6", "Device Mode: " + fields[5]);
            Log.i("Example 7", "Fiscal Version: " + fields[6]);
            Log.i("Example 8", "Operation Mode: " + fields[7]);
            Log.i("Example 9", "Service Mode: " + fields[8]);
            Log.i("Example 10", "Card Redirection: " + fields[9]);
            Log.i("Example 11", "EMV Kernel Version: " + fields[10]);
            Log.i("Example 12", "Linux Kernel Version: " + fields[11]);
            Log.i("Example 13", "ROOTFS Version: " + fields[12]);
            Log.i("Example 14", "EMVCL Version: " + fields[13]);
        },
        DeviceInfo.Field.FISCAL_ID, 
        DeviceInfo.Field.IMEI_NUMBER, 
        DeviceInfo.Field.IMSI_NUMBER, 
        DeviceInfo.Field.LYNX_VERSION, 
        DeviceInfo.Field.SECURE_BOARD_VERSION, 
        DeviceInfo.Field.MODEM_VERSION, 
        DeviceInfo.Field.DEVICE_MODE,
        DeviceInfo.Field.FISCAL_VERSION,
        DeviceInfo.Field.OPERATION_MODE, 
        DeviceInfo.Field.SERVICE_MODE, 
        DeviceInfo.Field.CARD_REDIRECTION, 
        DeviceInfo.Field.GET_EMV_KERNEL_VERSION, 
        DeviceInfo.Field.GET_LINUX_KERNEL_VERSION, 
        DeviceInfo.Field.GET_ROOTFS_VERSION, 
        DeviceInfo.Field.GET_EMVCL_VERSION
)

void setAppParams(DeviceInfoAppParamsSetterHandler deviceInfoResponseHandler, final String terminalId, final String merchantId)

The setAppParams function sets the payment application parameters, such as terminal ID and merchant ID, for the device. The result is returned asynchronously through the provided callback handler.

deviceInfo.setAppParams(
    object : DeviceInfoAppParamsSetterHandler {
        override fun onReturn(result: Boolean) {
            Log.i("RESULT", result.toString())
        }
    },
    "TERMINAL_ID", "MERCHANT_ID",
)
deviceInfo.setAppParams(
    new DeviceInfoAppParamsSetterHandler() {
        @Override
        public void onReturn(boolean result) {
            Log.i("RESULT", Boolean.toString(result));
        }
    }, 
    "TERMINAL_ID", "MERCHANT_ID"
);

void

void

void

void

void

void

void

void

void

void

void

void

void

void

void

void

DeviceInfo(Context context)
getFiscalId(DeviceInfoResponseHandler deviceInfoResponseHandler)
getImeiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)
getImsiNumber(DeviceInfoResponseHandler deviceInfoResponseHandler)
getSecureBoardVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getModemVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getDeviceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
getFiscalVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getOperationMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
getServiceMode(DeviceInfoResponseHandler deviceInfoResponseHandler)
getCardRedirection(DeviceInfoResponseHandler deviceInfoResponseHandler)
getEmvKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getLinuxKernelVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getROOTFSVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getEMVCLVersion(DeviceInfoResponseHandler deviceInfoResponseHandler)
getFields(DeviceInfoMultipleResponseHandler deviceInfoResponseHandler, final int... fields)
setAppParams(DeviceInfoAppParamsSetterHandler deviceInfoResponseHandler, final String terminalId, final String merchantId)
example project
34KB
TDeviceInfo_1.3.aar