Private preview
Collect tapped data for NFC instruments Private preview
Use Terminal for data collection of NFC instruments with the reader hardware interfaces.
Private preview
Request access to the Collect data private preview by sending an email to . Provide your use case, Terminal device, and integration type.
Use the Terminal SDK and the reader’s contactless interface to read the unique identifier (UID) of NFC instruments, such as cards or wristbands. This feature is available offline.
After tapping your NFC instrument, Stripe provides a collected data object with the NFC UID, or an error if one occurred.
Warning
You can’t use this feature to collect card payments. Follow these instructions to collect payments using Stripe Terminal.
Collecting tapped data for NFC instruments is available on:
Collect data
Use Terminal.collectData() to prompt for data collection from your point-of-sale application. Specify the type of collected data you want to receive, such as .nfcUid, in a configuration passed to the function. After a customer taps an NFC instrument, the SDK collects a data object with the NFC UID or returns an error if the read is unsuccessful.
Note
On supported readers, the ability for customers to cancel transactions is now enabled by default. To disable customer cancellation on smart readers, set customerCancellation to .disableIfAvailable.
Select a language
Swift
Objective-C
No results
import UIKit
import StripeTerminal
class PaymentViewController: UIViewController {
func readNfcUid() throws {
let config = try CollectDataConfigurationBuilder().setCollectDataType(.nfcUid).build()
self.cancelable = Terminal.shared.collectData(config) { collectedData, collectError in
if let error = collectError {
// Placeholder for handling exceptions
} else if let nfcUid = collectedData?.nfcUid {
// Placeholder for receiving NFC UID
print("NFC UID is: \(nfcUid)")
}
}
}
}
