If you are using CocoaPods, update your Podfile:
pod 'StripeTerminal', '~> 2.0'
2.0.0 2021-06-23
This changelog includes a more detailed list of all the API and behavior changes since version 1.4.0 of the Stripe Terminal iOS SDK. In addition to this changelog, we've prepared a migration guide that will help you upgrade your integration and explain the differences between the two SDKs.
iOS Compatibility
The 2.0.0 Stripe Terminal iOS SDK requires iOS 10 and above.
Connecting to a Reader
connectReader
is now split into two separate methods: connectBluetoothReader
and connectInternetReader
.
connectBluetoothReader
connectBluetoothReader
should be used to connect to any Bluetooth reader like the BBPOS WisePad 3 and BBPOS Chipper 2X BT.
connectBluetoothReader
requires providing a newBluetoothReaderDelegate
which is used to report all reader events.- The
terminal:didReportReaderEvent:info:
andterminalDidReportLowBatteryWarning:
events have been moved from theTerminalDelegate
into theBluetoothReaderDelegate
. - The
ReaderDisplayDelegate
has been removed and thedidRequestReaderInput:
anddidRequestReaderDisplayMessage:
have moved to theBluetoothReaderDelegate
. - The
ReaderSoftwareUpdateDelegate
has been removed and theBluetoothReaderDelegate
is used for communicating to your app about updates for the reader.
See Updating reader software: Required updates for more details.
connectInternetReader
connectInternetReader
should be used to connect to Internet connected countertop readers like the Verifone P400 and the BBPOS WisePOS E. There are no changes required between connectReader
and connectInternetReader
for your countertop reader integration.
Bluetooth Reader Updates
The checkForUpdate
method has been removed. The Stripe Terminal SDK now checks for required and optional updates during reader connection.
Required update installation is reported to the new BluetoothReaderDelegate
with the didStartInstallingUpdate
method. Progress will be reported to that same delegate with didReportReaderSoftwareUpdateProgress
. When the installation of the required update finishes the delegate will receive the didFinishInstallingUpdate
.
For more information about implementing reader updates, see Updating reader software and Testing Bluetooth reader updates.
Collecting Payments
collectPaymentMethod
and readReusableCard
no longer require a ReaderDisplayDelegate
. Instead, the BluetoothReaderDelegate
, provided during connectBluetoothReader
, is used to communicate the didRequestReaderInput:
and didRequestReaderDisplayMessage:
methods. These methods are only needed when using a Bluetooth connected reader and do not apply when using connectInternetReader
.
Bluetooth Reader Locations
Like Internet readers, Bluetooth readers must now be registered to Locations. Registering your Bluetooth readers to a location ensures that the readers install the proper regional configurations and are properly grouped on your account.
To register the reader to a location, create and use a BluetoothConnectionConfiguration
object with the locationId
set accordingly, and pass that object in when calling Terminal.shared.connectBluetoothReader()
.
When discovering readers that have already been registered to a location, those reader objects will have a valid locationId
property during discovery. If it makes sense for your application, you can pass that locationId
from the discovered Reader
object into the BluetoothConnectionConfiguration
initializer to keep that reader registered to the same location. This is the pattern we recommend when discovering and connecting to simulated Bluetooth readers, which are now automatically registered to a mock location.
When connecting to a reader, you may want to display a list of Locations in your app. To enable this, the SDK provides the Terminal.shared.listLocations(:completion:)
method that takes the same parameters as the List all Locations API endpoint. You may want to adjust your connection flow to allow users to pick a location before they select a reader, should they want to switch that reader's location manually.
Other Changes
SCPReaderSoftwareUpdate
now has acomponents
property that can be used to determine the changes that will be applied with this update.deviceSoftwareVersion
can still be used to identify the specific firmware, config, and keys that will be installed with the update.- Adds support for setting a
SCPSimulatedCard
on theSCPSimulatorConfiguration
object, allowing simulation of different card brands and decline types. See Simulated Test Cards for more details. - Added optional delegate method,
reader:didReportBatteryLevel:status:isCharging
, to announce battery updates from Bluetooth readers. - Adds error codes:
- Added error
SCPErrorBluetoothAccessDenied
returned when Bluetooth is enabled on the device but access for your application has been denied. SCPErrorBluetoothPeerRemovedPairingInformation
andSCPErrorBluetoothAlreadyPairedWithAnotherDevice
to increase clarity when discovery or connection fails unexpectedly.SCPErrorFeatureNotAvailable
, which will get returned when the initiated operation is not available for your account.
- Added error
- Added
SCPDeviceTypeStripeM2
toSCPDeviceType
. This reader is in beta testing and not yet generally available. - Renames
SCPErrorPaymentDeclinedByStripeAPI
toSCPErrorDeclinedByStripeAPI
, referencing the fact that this error will be returned if Stripe rejects the SetupIntent or Refund as well as the payment. - Bug fix: If your reader battery was low (around 15 percent or less), we did not invoke
readerDidReportLowBatteryWarning
until an action (such as a transaction) was taken. NowreaderDidReportLowBatteryWarning
is also announced upon connection to the reader. - Bug fix:
requestError
on theSCPProcessingPaymentError
is now being properly populated in the case server has responded with an error and causesprocessPayment
to fail. - Bug fix: The very first
discoverReaders
call using Bluetooth with iOS 13.4 or later no longer results with a "Generic Bluetooth Error" and should now successfully start discovery.
New features
- Added support for Swift Package Manager.
- Added support for running with iOS Simulator on Macs with M1 processors.
- The SDK's card-present refund functionality now works with the BBPOS WisePad 3 reader.
- Invite only: Stripe Terminal now supports creating SetupIntents to save card information outside the United States. When saving card information in the United States, please continue to use readReusableCard.