On This Page
Creating an mposUi Instance
mposUi
InstanceUse the information in this section to create and configure an
mposUI
instance.Create an mposUI Instance
mposUI
InstanceUse an
mposUi
instance to access the functionality of the PAX
All-in-One Android SDK. 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:- Create anmposUiinstance using thecreatefunction.
- Set themerchantIdfield value to the merchant ID that you obtained.
- Set themerchantSecretfield value to the secret key that you obtained.
- Specify the environment by setting theproviderModefield value toTESTor toLIVE.
- Use theProviderMode.TESTsetting to test your integration without charging a real payment card. Use the merchant ID and secret key you obtained from the test environment.
- Use theProviderMode.LIVEsetting 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" )
Configure an mposUI Instance
mposUI
Instance To use the
mposUi
instance with the PAX All-in-One Android SDK, you must
configure the mposUi
instance by next creating a
UiConfiguration
instance.Create a UiConfiguration Instance
UiConfiguration
InstanceUse the
UiConfiguration
instance to configure the UI functionality
of the PAX All-in-One Android SDK.You can configure these parameters in the
UiConfiguration
instance that you create:- Configure the accessory as PAX.
- Configure these Summary screen features:
- Refund a transaction (REFUND_TRANSACTION).
- Send a receipt by email (SEND_RECEIPT_VIA_EMAIL).
- Capture a transaction (CAPTURE_TRANSACTION).
- Print a customer receipt (PRINT_CUSTOMER_RECEIPT).
- Print a merchant receipt (PRINT_MERCHANT_RECEIPT).
- Retry a failed transaction (RETRY_TRANSACTION).
- Increment a transaction (INCREMENT_TRANSACTION).
- Add a tip after a sale with on-receipt tipping(ADJUST_TIP).
- 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 display 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.
- Configure the merchant receipt (MERCHANT_RECEIPT) or customer receipt (CUSTOMER_RECEIPT) to be printed automatically.
- Configure the accessibility mode.
Follow this step to create and configure the
UiConfiguration
instance in your app:- Create theUiConfigurationinstance.mposUi.configuration = UiConfiguration( terminalParameters = AccessoryParameters.Builder(AccessoryFamily.PAX).integrated().build(), summaryFeatures = setOf( SummaryFeature.REFUND_TRANSACTION, SummaryFeature.SEND_RECEIPT_VIA_EMAIL, SummaryFeature.CAPTURE_TRANSACTION, SummaryFeature.PRINT_CUSTOMER_RECEIPT, SummaryFeature.PRINT_MERCHANT_RECEIPT, SummaryFeature.RETRY_TRANSACTION, SummaryFeature.INCREMENT_TRANSACTION SummaryFeature.ADJUST_TIP ) // 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, // Use this to enable automatic receipt printing // automaticPrintingOption = AutomaticPrintingOption.MERCHANT_RECEIPT, // Use this to enable accessibility mode // accessibilityModeOption = AccessibilityModeOption.OPTION_VISIBLE, )