On This Page
Creating an mposUIReader Instance
mposUIReader
Instance Use this information to create and configure an
mposUIReader
instance.
Before creating this instance, you must first create Credentials
and
Configuration
objects.Create an mposUIReader
Credentials Object
mposUIReader
Credentials
ObjectBefore starting this task, obtain a merchant ID and secret key. You use these
values when creating the
Credentials
object.IMPORTANT
Things to know about migrating from SDK 3.5.0 to SDK 3.6.0:
- Theenvironmentparameter was removed from theCredentialsobject.
- Use the standaloneMposEnvironmentenum, with the value.liveor.test, when callingactivate().
- Themerchantparameter was renamed tomerchantId.
The
Credentials
object is required to access the functionality of
the Tap to Pay on iPhone SDK. Before you can create an mposUIReader
instance, you must create the Credentials
object.- ImportMposUI.
- Create aCredentialsobject.
- Set themerchantIdfield value to the merchant ID that you obtained.
- Set thesecretfield value to the secret key that you obtained.import MposUI let credentials = try Credentials(merchantId: "MerchantId", secret: "SecretKey")
Create an mposUIReader Configuration Object
mposUIReader
Configuration
ObjectBefore you can create the
mposUIReader
instance in the Tap to Pay on iPhone SDK,
you must create the Configuration
object.Use the
Configuration
object to configure these parameters for the
mposUIReader
instance:- Configure these Summary screen features:
- Refund a transaction (.refundTransaction).
- Send a receipt by email (.sendReceiptViaEmail).
- Capture a transaction (.captureTransaction).
- Increment a transaction (.incrementTransaction).
- Retry 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 device activation process to prompt the merchant to enter the serial number of a previously activated device (.manualInput). The default setting is to show a list of previously activated 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).
- Create theConfigurationobject.let configuration = Configuration(summaryFeatures: [.sendReceiptViaEmail, .refundTransaction, .captureTransaction, .incrementTransaction, .retryTransaction], resultConfiguration: .displayIndefinitely, signatureCapture: .onScreen, enrollmentConfiguration: .init(serialNumberInputMethod: deviceList, confirmationScreenOption: showWithSerialNumber) )
Create an mposUIReader Instance
mposUIReader
InstanceBefore you can create the
mposUIReader
instance, you must create
and configure the Configuration
object.IMPORTANT
Things to know about migrating from SDK 3.5.0 to SDK 3.6.0: If your app
has activated devices in production, use the migration builder to preserve existing
activations. This step migrates the device state from the old storage location to
the new Apple Keychain-backed storage location and merchants do not need to
reactivate their
devices.
Both builders return the samelet reader: MposUIReader = await mposUiBuilder( credentials: credentials, environment: .live, configuration: configuration )
MposUIReader
type. When
all of your in-production merchants have upgraded to and used SDK 3.6.0 at least one
time, switch to mposUIReaderBuilder
in a future release.- CallmposUIReaderBuilderwith theConfigurationobject to create anmposUIReaderinstance.let reader: MposUIReader = await mposUIReaderBuilder( configuration: configuration )