FILTER BY TAG

Creating an mposUI Instance

Use this information to create and configure an
mposUI
 instance.

Create an
mposUI
Instance

Before starting this procedure, you must obtain secret key and merchant ID (MID) values to enter in to your
mposUI
 instance. For more information, see Generating a Secret Key for an Existing Merchant ID.
Create an
mposUI
 instance to access the functionality of the Tap to Pay on Android SDK.
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.
  5. Configure the accessory as Tap to Phone.
    val mposUi = MposUi.create( providerMode = ProviderMode.LIVE, // ProviderMode.TEST merchantId = "MerchantId", merchantSecret = "SecretKey", terminalParameters = AccessoryParameters.Builder(AccessoryFamily.TAP_TO_PHONE).integrated().build() )

Configure an mposUI Instance

To use the
mposUI
instance with the Tap to Pay on Android SDK, you must configure the
mposUI
instance by creating a
UiConfiguration
 instance.

Create a
UiConfiguration
Instance

Use a
UiConfiguration
 instance to configure the UI functionality of the Tap to Pay on Android SDK.
You can configure these parameters in the
UiConfiguration
 instance that you create:
  • Configure these Summary screen features:
    • Refund a transaction (
      REFUND_TRANSACTION
      ).
    • Send a receipt by email (
      SEND_RECEIPT_VIA_EMAIL
      ).
    • Capture a transaction (
      CAPTURE_TRANSACTION
      ).
    • Retry a failed transaction (
      RETRY_TRANSACTION
      ).
    • Increment a transaction (
      INCREMENT_TRANSACTION
      ).
  • Configure the Summary screen so that it can be skipped (
    SKIP_SUMMARY_SCREEN
    ) or so that it closes after 5 seconds (
    CLOSE_AFTER_TIMEOUT
    ). The default setting is to show the Summary screen.
  • Configure the signature capture so that it prints on the paper receipt (
    ON_RECEIPT
    ) or is skipped (
    NONE
    ). The default setting is on-screen signature capture.
Follow this step to create the
UiConfiguration
 instance in your app:
  1. Create and configure the
    UiConfiguration
     instance.
    mposUi.configuration = UiConfiguration( summaryFeatures = setOf( SummaryFeature.REFUND_TRANSACTION, SummaryFeature.SEND_RECEIPT_VIA_EMAIL, SummaryFeature.CAPTURE_TRANSACTION, SummaryFeature.RETRY_TRANSACTION, SummaryFeature.INCREMENT_TRANSACTION ) // Use this to skip the summary screen // resultDisplayBehavior = UiConfiguration.ResultDisplayBehavior.SKIP_SUMMARY_SCREEN, // Use this to set signature capture to be on paper receipt // signatureCapture = SignatureCapture.ON_RECEIPT, )

Create a
TapToPhoneConfiguration
Instance

Create a
TapToPhoneConfiguration
 instance to configure the device enrollment process of the Tap to Pay on Android SDK.
You can configure these parameters in the
TapToPhoneConfiguration
instance that you create:
  • Configure the enrollment process to prompt the merchant to enter the serial number of a previously enrolled device (
    MANUAL_INPUT
    ). The default setting is to show a list of previously enrolled devices and prompt the merchant to select a device from the list (
    DEVICE_LIST
    ).
  • Configure the Serial Number Confirmation screen to be skipped (
    SKIP
    ). The default setting is to show the screen (
    SHOW_WITH_SERIAL_NUMBER
    ).
  • Configure the operating mode to enable foreground mode (
    FOREGROUND_MODE
    ). The default setting is
    BACKGROUND_MODE
    .
Follow this step to create and configure the
TapToPhoneConfiguration
instance in your app:
  1. Create and configure the instance.
    mposUi.tapToPhone.tapToPhoneConfiguration = TapToPhoneConfiguration( serialNumberInputMethod = SerialNumberInputMethod.DEVICE_LIST, confirmationScreenOption = ConfirmationScreenOption.SHOW_WITH_SERIAL_NUMBER, operatingMode = FOREGROUND_MODE )