Creating an
mposUI
Instance

An
mposUi
 instance is required in order to access the functionality of the PAX All-in-One Android SDK. In order to complete this procedure, you must generate a secret key for an existing merchant ID. For more information, seeGenerating a Secret Key for an Existing Merchant ID.
Follow these steps to create an
mposUi
 instance:
  1. Create an
    mposUi
    instance using the
    create
    function.
  2. Set the
    merchantId
    field value to the merchant ID that you obtained.
  3. Set the
    merchantSecret
    field value to the secret key that you obtained.
  4. Specify the environment by setting the
    providerMode
    field value to
    TEST
    or to
    LIVE
    • Use the
      ProviderMode.TEST
      setting to test your integration without charging a real payment card. Use the merchant ID and secret key you obtained from the test environment.
    • Use the
      ProviderMode.LIVE
      setting to process live transactions. Use the merchant ID and secret key you obtained from the production environment.
    val mposUi = MposUi.create( providerMode = ProviderMode.LIVE, // ProviderMode.TEST merchantId = "MerchantId", merchantSecret = "SecretKey" )