Skip to content

Installation & Initialization

Add the package

Add the SDK to your Xcode project via Swift Package Manager. In Xcode, go to File → Add Package Dependencies and enter the repository URL:

https://github.com/finix-payments/finix-pax-mpos-ios-sdk
Physical device required

The SDK requires a physical iOS device. The simulator is not supported.

Add Bluetooth permission

Add the following key to your app's Info.plist. Without it, the OS will not grant access to Bluetooth and scanning will fail.

<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app uses Bluetooth to communicate with your payment device.</string>

Initialization

Initialize the SDK

Create a FinixClient instance with your credentials. Set deviceId to an empty string on first initialization — you will update it after device discovery.

Scan for devices

Scan for devices

Call startScan() to begin scanning for nearby PAX D135 devices over Bluetooth. Each discovered device is reported via FinixDelegate.

Delegate MethodTrigger
didDiscoverDevice(_ deviceInfo: DeviceInfo)Called each time a nearby device is found. deviceInfo.id is the Bluetooth identifier.
Bluetooth permission prompt

When running for the first time, the OS will show a Bluetooth permission dialog. If the user dismisses the device list before granting access, have them dismiss and re-open the scanner after tapping Allow.

Register the device

Register the device

If you haven't already created and activated the device in Finix, do so now before connecting. Use the serial number printed on the PAX D135 (or the one surfaced in didDiscoverDevice).

  1. Create — POST to /merchants/{merchant_id}/devices with "model": "PAX_D135" and "serial_number". Copy the id from the response — this is your deviceId.
  2. Activate — PUT to /devices/{device_id} with "action": "ACTIVATE".

See Device Setup for the full API calls and Dashboard alternative.

Connect to a device

Connect to a device

Call connectDevice(_:) with the DeviceInfo.id from the scan callback. The PAX D135 indicates status with its LED:

  • Orange light - ready for pairing
  • Green light - fully charged
  • Green light only (after connect) - connected and ready
Delegate MethodTrigger
deviceDidConnect(_ deviceInfo: DeviceInfo)Called when the device is connected and ready to accept transactions.

After deviceDidConnect, call finixClient.update(deviceId:) with the connected device's ID before starting a transaction.

// Swift Package Manager — add via Xcode:
// File → Add Package Dependencies
// https://github.com/finix-payments/finix-pax-mpos-ios-sdk
import PaxMposSDK

// Info.plist
// NSBluetoothAlwaysUsageDescription: "This app uses Bluetooth to communicate with your payment device."

import PaxMposSDK

let finixClient = FinixClient(config: FinixConfig(
    environment: .Sandbox, // use .Production for live payments
    credentials: Finix.APICredentials(username: "USxxxxxxxxx", password: "your_api_secret"),
    merchantId: "MUxxxxxx",
    mid: "",
    deviceType: .Pax,
    deviceId: "" // updated after device discovery
))
finixClient.delegate = self
finixClient.interactionDelegate = self

finixClient.startScan()

extension PaymentViewController: FinixDelegate {
    func didDiscoverDevice(_ deviceInfo: DeviceInfo) {
        // deviceInfo.id is the Bluetooth identifier — pass it to connectDevice
        finixClient.connectDevice(deviceInfo.id)
    }
}

extension PaymentViewController: FinixDelegate {
    func deviceDidConnect(_ deviceInfo: DeviceInfo) {
        // Update the client with the connected device's ID before transacting
        finixClient.update(deviceId: deviceInfo.id)
        // device is now ready for transactions
    }
}