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.
| Package | Product | Required | Repository |
|---|---|---|---|
| Transactions SDK | TransactionSDK | Yes | https://bitbucket.org/geopagos-sdk/ios-transactions-package.git |
| Payments SDK | Payments | Yes | https://bitbucket.org/geopagos-sdk/ios-payments-package.git |
| MagicPos reader | MagicPosHardware | Only when using MagicPos | https://bitbucket.org/geopagos-sdk/ios-magicpossdk-package.git |
| QPos reader | QPosHardware | Only when using QPos | https://bitbucket.org/geopagos-sdk/ios-qpossdk-package.git |
| Apple Tap to Pay reader | TapToPayHardware | Only when using Apple Tap to Pay | https://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)
ENDPOINTis 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()