Connect the Reader SDK to a Square Contactless Reader to accept chip and tap payments.
Connect a Contactless Reader
You need to install and configure the Reader SDK.
Did you know?
If you're using a Magstripe Reader, you don't need to write explicit code to connect the Reader. If you're using a Contactless and Chip Reader, you must add code to handle pairing.
To pair a Contactless and Chip Card Reader, conform to the SQRDReaderSettingsControllerDelegate
protocol and present the Reader settings flow.
Important
If the iOS device hosting your application is on iOS 14, you must upgrade to the latest Reader SDK to successfully pair with a reader.
import SquareReaderSDK
extension <#YourViewController#>: SQRDReaderSettingsControllerDelegate {
func pairCardReaders() {
let readerSettingsController = SQRDReaderSettingsController(
delegate: self
)
readerSettingsController.present(from: self)
}
// MARK: - SQRDReaderSettingsControllerDelegate
func readerSettingsControllerDidPresent(
_: SQRDReaderSettingsController
) {
print("Reader settings flow presented.")
}
func readerSettingsController(
_: SQRDReaderSettingsController,
didFailToPresentWith error: Error
) {
// Handle the error - this example prints the error to the console
print(error)
}
}