FILTER BY TAG

Creating an mposUI Instance

Use this information to create and configure an
mposUI
 instance. Before creating an
mposUI
instance, you must create the
Credentials
and
Configuration
objects.

Create an
mposUI
Credentials Object

Before starting this task, obtain a merchant ID and secret key. For more information, see Generating a Secret Key for an Existing Merchant ID.
The
mposUI Credentials
 object is required in order to access the functionality of the Tap to Pay on iPhone SDK. You must create this object before you can create an
mposUI
instance.
Follow these steps to create the
mposUI Credentials
object.
  1. Import
    MposUI
    .
  2. Create a
    Credentials
    object.
  3. Set the
    merchant
    field value to the merchant ID that you obtained.
  4. Set the
    secret
    field value to the secret key that you obtained.
  5. Set the
    environment
    field value to
    test
    or to
    live
    .
    • Use the
      test
      setting to test your integration without charging a real payment card. Use the merchant ID and secret key that you obtained from the test environment.
    • Use the
      live
      setting to process live transactions. Use the merchant ID and secret key that you obtained from the production environment.
    import MposUI let credentials = Credentials(merchant: "MerchantId", secret: "SecretKey", environment: .live)

Create an
mposUI
Configuration Object

To create and use the
mposUI
instance with the Tap to Pay on iPhone SDK, you must create the
mposUI Configuration
 object.
Use the
Configuration
 object to configure these parameters for the
mposUI
 instance:
  • Configure these Summary screen features:
    • Refund a transaction (
      .refundTransaction
      ).
    • Send a receipt by email (
      .sendReceiptViaEmail
      ).
    • Capture a transaction (
      .captureTransaction
      ).
    • Increment a transaction (
      .incrementTransaction
      ).
    • Re-try a failed transaction (
      .retryTransaction
      ).
  • Configure the Summary screen so that it can be skipped (
    .skipSummaryScreen
    ). The default setting is to show the Summary screen (
    .displayIndefinitely
    ).
  • Configure the signature capture so that it prints on the paper receipt (
    .onReceipt
    ) or is skipped (
    .none
    ). The default setting is on-screen signature capture.
  • Configure the enrollment process to prompt the merchant to enter the serial number of a previously enrolled device (
    .manualInput
    ). The default setting is to show a list of previously enrolled devices and prompt the merchant to choose a device from the list (
    .deviceList
    ).
  • Configure the Serial Number Confirmation screen to be skipped (
    .skip
    ). The default setting is to show the screen (
    .showWithSerialNumber
    ).
Follow this step to create the
mposUI Configuration
object.
  1. Create the
    Configuration
    object.
    let configuration = Configuration(summaryFeatures: [.sendReceiptViaEmail, .refundTransaction, .captureTransaction, .incrementTransaction, .retryTransaction], resultConfiguration: .displayIndefinitely, signatureCapture: .onScreen, enrollmentConfiguration: .init(serialNumberInputMethod: deviceList, confirmationScreenOption: showWithSerialNumber) )

Create an
mposUI
Instance

Before you can create the
mposUI
instance, create and configure the
Credentials
and
Configuration
 objects.
Follow this step to create the
mposUI
instance.
  1. Create the
    mposUI
    instance.
    let mposUi = await mposUiBuilder(credentials: credentials, configuration: configuration)