Skip to main content

Installation and configuration

Installation​

Add the required packages to your Xcode project using File > Add Package Dependencies. Do not pin a package to a specific version in your integration.

PackageProductRequiredRepository
Transactions SDKTransactionSDKYeshttps://bitbucket.org/geopagos-sdk/ios-transactions-package.git
Payments SDKPaymentsYeshttps://bitbucket.org/geopagos-sdk/ios-payments-package.git
MagicPos readerMagicPosHardwareOnly when using MagicPoshttps://bitbucket.org/geopagos-sdk/ios-magicpossdk-package.git
QPos readerQPosHardwareOnly when using QPoshttps://bitbucket.org/geopagos-sdk/ios-qpossdk-package.git
Apple Tap to Pay readerTapToPayHardwareOnly when using Apple Tap to Payhttps://bitbucket.org/geopagos-sdk/ios-taptopaysdk-package.git

Every integration requires TransactionSDK and Payments. Add only the reader modules that your app uses.

Configure the SDK​

Import Payments and the modules for the selected readers:

import MagicPosHardware
import Payments
import QPosHardware

Optionally, implement SDKLogger to collect SDK logs in your preferred destination:

struct CustomSDKLogger: SDKLogger {
func log(message: String, level: LogLevel) {
// Send the log entry to your logging system.
}
}

Create the corresponding installers and configure the SDK before starting a transaction:

let readerInstallers: [ReaderInstaller] = [
MagicPosReaderInstaller(),
QposReaderInstaller()
]

let configuration = try PaymentsConfiguration.Builder(
endpoint: URL(string: ENDPOINT)!,
readerInstallers: readerInstallers
)
.setLogger(logger: CustomSDKLogger())
.build()

PaymentsSDK.configure(paymentsConfiguration: configuration)

ENDPOINT is a String with the URL path of the processor URL. Geopagos will provide this URL.

Configure the swipe PIN decision​

For magnetic stripe transactions, implement SwipePinDecider to decide whether the SDK must request a PIN:

struct CustomSwipePinDecider: SwipePinDecider {
func decide(card: TransactionCard) -> Bool {
true
}
}

Provide it while building the SDK configuration:

let configuration = try PaymentsConfiguration.Builder(
endpoint: URL(string: ENDPOINT)!,
readerInstallers: readerInstallers
)
.setSwipePinDecider(swipePinDecider: CustomSwipePinDecider())
.build()