Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Version

Date

Changes

Author

1.01

11 April 20 December 2024

Initial Documentation for V4

Anne-Claire FemiaAdded Sample of Demo

Julien Garnier

1.10

14 Oct 28 October 2024

Added Json Ticket Example

David GuignardInitial Documentation

Julien Garnier

Pre-requirements

  • SUNMI POS Model number is P1N or P1-4G or P2PRO or P2 Lite SE (Check SeetingSettings-->About-->Mode >Model number)

  • SUNMI PayHardware Service (SPHS) SDK. Version 3.3.0 or the lastest latest version. SunmiPayHardwareService_v3.3.0_release.apk

    • Go to Setting Settings in the Device → Then search in the bar “SunmiPayHardwareService” → Click on it → Click on the Advanced button Advanced → In the advanced section, check the version of the SPHS SDK.

  • Android Studio Quick integrate, Put the PayLib-release-xxx.aar package under the libs folders of your App.

    View file
    namepaylib-2.0.14.aar.zip

    Code Block
    repositoriesdependencies {
          flatDir {
          dirs 'libs'
      }
    }
    dependencies {
      ......
      compile(name: 'PayLib-release-xxx', ext: 'aar')
    }

...

Warning

...

  • implementation(files("libs/paylib-2.0.14.aar"))
    }
Note

Warning

  • PayLib-release-xxx.aar package: This is a package which must be used carefully. Only use it to disable the Android Nav Bar, not for any other function (for example, payment functions). In case you have any doubts please reach out to the PayXpert teams.

  • If merchant app/integrator disables the navigation bar, they will need to implement a mechanism to activate it temporaryfunctionality that will allow it to be activated temporarily. Otherwise, the POS terminal will be blocked in case there is a manual intervention that needs to be done on the POS Devicedevice.

  • The variable to desactivate deactivate the Nav Bar via SUNMI will be is shared between merchant app and payXpress PayXpress app.

  • By Default, PayXpress app deployed in the P2 LITE SE / P2 PRO devices will activate the Nav Bar in the standbyscreen standby screen (initial screen) and then it will disable it during the payment transaction. Once the payment has been finalize finalized it will be activated it back reactivated automatically.

Android Version and IDE Version supported by the SDK

SDK only supports API-19 (Android 4.4) or the latest version.
SDK only support supports Android Studio, Intellij.

SunmiPayKernel SDK Operation Object

...

Create Instance

...

Public Member Variable - mBasicOptV2

...

Method to disable Navigation Bar

...

Example Code

Extract of the Navigation Bar to Activate or Desactivate Deactivate in Kotlin.
Here attached you will find the complete sample.

View file
nameSunmi - NavBar - Sample.zip

Code Block
languagekotlin
object SunmiSdkIntegrationExample {
    private val instance: SunmiPayKernel = SunmiPayKernel.getInstance()
    private var isInitialized: Boolean = false

    /**
     * Initialize Sunmi SDK before calling it
     */
    suspend fun init(context: Context): Boolean {
        if (isInitialized) {
            return true
        }

        isInitialized = suspendCoroutine {
            SunmiPayKernel.getInstance().initPaySDK(
                context,
                object : SunmiPayKernel.ConnectCallback {
                    override fun onConnectPaySDK() {
                        it.resume(true)
                    }

                    override fun onDisconnectPaySDK() {
                        it.resume(false)
                    }
                }
            )
        }

        return isInitialized
    }

    /**
     * Change navigation bar visibility according a flag
     */
    fun setNavigationBarVisibility(enabled: Boolean) {
        if (enabled) {
            instance.mBasicOptV2.setNavigationBarVisibility(AidlConstants.SystemUI.SHOW_NAV_BAR)
        } else {
            instance.mBasicOptV2.setNavigationBarVisibility(AidlConstants.SystemUI.HIDE_NAV_BAR)
        }
    }
} 

...