Accéder directement au contenu
Créez un compte
ou
connecter-vous
Logo de la documentation Stripe
/
Demander à l'assistant IA
Créez un compte
Connectez-vous
Démarrer
Paiements
Automatisation des opérations financières
Plateformes et places de marché
Gestion de fonds
Outils de développement
Démarrer
Paiements
Automatisation des opérations financières
Démarrer
Paiements
Automatisation des opérations financières
Plateformes et places de marché
Gestion de fonds
Aperçu
À propos des paiements Stripe
Mettre votre intégration à niveau
Analyses des paiements
Paiements en ligne
PrésentationTrouver votre cas d'usageManaged Payments
Utiliser Payment Links
Créer une page de paiement
Développer une intégration avancée
Développer une intégration dans l'application
Moyens de paiement
Ajouter des moyens de paiement
Gérer les moyens de paiement
Paiement accéléré avec Link
Interfaces de paiement
Payment Links
Checkout
Web Elements
Elements intégrés à l'application
Scénarios de paiement
Tunnels de paiement personnalisés
Acquisition flexible
Orchestration
Paiements par TPE
Terminal
    Présentation
    Accepter les paiements par TPE
    Conception d'intégration
    Choisir votre lecteur
    Concevoir une intégration
    Démarrage rapide
    Exemples d'applications
    Tests
    Configuration de Terminal
    Configurer votre intégration
    Se connecter à un lecteur
      Exigences du réseau
    Acceptation d'un paiement
    Encaisser des paiements par carte
    Autres moyens de paiement
    Accepter les paiements hors ligne
    Paiement des commande par courrier/par téléphone
    Spécificités régionales
    Lors du règlement
    Collecter des pourboires
    Collecter et enregistrer des informations de paiement pour une utilisation ultérieure
    Autorisations flexibles
    Après le paiement
    Rembourser des transactions
    Fournir des reçus
    Personnalisez Checkout
    Affichage du panier
    Collecter les données saisies à l'écran
    Collecter les données des lectures de la piste magnétique
    Collecter les données des paiements NFC sans contact
    Applications sur des appareils
    Gérer les lecteurs
    Commander, renvoyer ou remplacer des lecteurs
    Enregistrer des lecteurs
    Gérer les emplacements et les zones
    Configurer des lecteurs
    Chiffrement
    Références
    Documentation de l'API
    Lecteurs mobiles
    Lecteurs intelligents
    Guide de migration du SDK
    Liste de contrôle pour le déploiement
    Fiches produit du lecteur Stripe Terminal
Autres produits Stripe
Financial Connections
Cryptomonnaies
Climate
AccueilPaiementsTerminal

Remarque

Cette page n'est pas encore disponible dans cette langue. Nous faisons tout notre possible pour proposer notre documentation dans davantage de langues et nous vous fournirons la version traduite dès qu'elle sera disponible.

Connect to a reader

Connect your application to a Stripe Terminal reader.

Copier la page

Remarque

If you haven’t chosen a reader yet, compare the available Terminal readers and choose one that best suits your needs.

Bluetooth-connected readers are Bluetooth LE devices. They collect payment details, but rely on a paired mobile device for communication with Stripe.

Follow these steps to connect your app to a Terminal reader using Bluetooth:

  1. Discover readers.
  2. Connect to a reader.

Mise en garde

Don’t use mobile device settings to pair with your reader. Pairing the reader through device settings makes the reader unavailable to connect to your app.

Discover readers
Client-side

SDK Reference

  • discoverReaders (Android)
  • BluetoothDiscoveryConfiguration (Android)

To start, make sure your reader is powered on and within close proximity.

Then from your app, search for nearby Bluetooth-connected readers with the discoverReaders method, using BluetoothDiscoveryConfiguration.

DiscoverReadersActivity.kt
Kotlin
class DiscoverReadersActivity : AppCompatActivity(), DiscoveryListener { var discoverCancelable: Cancelable? = null // ... // Action for a "Discover Readers" button fun discoverReadersAction() { val timeout = 0 val isSimulated = false val config = BluetoothDiscoveryConfiguration( timeout = timeout, isSimulated = isSimulated ) discoverCancelable = Terminal.getInstance().discoverReaders( config, this, object : Callback { override fun onSuccess() { // Placeholder for handling successful operation } override fun onFailure(e: TerminalException) { // Placeholder for handling exception } } ) } // DiscoveryListener override fun onUpdateDiscoveredReaders(readers: List<Reader>) { // In your app, display the discovered readers to the user. // Call `connectReader` after the user selects a reader to connect to. } }

Bluetooth scan

Bluetooth scan searches for all nearby readers and returns a list of discovered readers to your app. As the discovery process continues, the SDK continues to invoke the onUpdateDiscoveredReaders method with the latest list of nearby readers.

During the discovery process, the Terminal’s connectionStatus transitions to ConnectionStatus.DISCOVERING while the discovery is in progress.

With the Bluetooth scan discovery method, you can set a timeout to scan for a set period of time, which you can use for managing battery life or triggering an error message if no devices are found.

In your mobile application, we recommend displaying an auto-updating list of discovered readers, with serial numbers or labels to help users identify their reader.

Connect to a reader
Client-side

SDK Reference

  • connectReader (Android)
  • BluetoothConnectionConfiguration (Android)

To connect to a discovered reader, call the connectReader method from your app.

You must register your reader to a location upon connection. To do so, create and use a BluetoothConnectionConfiguration with the locationId set to the relevant location ID when connecting.

ConnectReaderActivity.kt
Kotlin
// Implement your MobileReaderListener val mobileReaderListener = yourMobileReaderListener val autoReconnectOnUnexpectedDisconnect = true val connectionConfig = BluetoothConnectionConfiguration(
"{{LOCATION_ID}}"
, autoReconnectOnUnexpectedDisconnect, mobileReaderListener ) Terminal.getInstance().connectReader( selectedReader, connectionConfig, object : ReaderCallback { override fun onSuccess(reader: Reader) { // Placeholder for handling successful operation } override fun onFailure(e: TerminalException) { // Placeholder for handling exception } } )

Use standby mode

Don’t program your app to call disconnectReader to conserve power. The reader efficiently handles power management using its standby mode.

Handle reader disconnects

SDK Reference

  • MobileReaderListener (Android)
  • DisconnectReason (Android)

Reader disconnects can sometimes occur between your app and the reader. For example, the reader can disconnect from your app if it’s out of range or runs out of battery. You can simulate an unexpected disconnect while testing by powering off the reader.

The MobileReaderListener includes an onDisconnect callback that provides your application with the DisconnectReason to help identify why the reader disconnected.

When a reader disconnects, we automatically attempt reconnection by default and recommend that you display notifications in your app relaying the reader status throughout the process.

To display notifications in your app during automatic reconnection, do the following:

  1. Implement the reader reconnect callbacks in the MobileReaderListener.
  2. Pass the MobileReaderListener to your BluetoothConnectionConfiguration.
    ReaderActivity.kt
    Kotlin
    val mobileReaderListener = yourMobileReaderListener Terminal.getInstance().connectReader( reader, BluetoothConnectionConfiguration(
    "{{LOCATION_ID}}"
    , true, mobileReaderListener ), readerCallback )
  3. When the SDK sends onReaderReconnectStarted to your app, display a message announcing that the reader lost connection and reconnection is in progress.
    • You can use the Cancelable object to stop the reconnection attempt at any time.
  4. When the SDK indicates successful reconnection by sending onReaderReconnectSucceeded, display a message announcing the connection was restored and to continue normal operations.
  5. If the SDK can’t reconnect to the reader and sends both onReaderReconnectFailed and onDisconnect, display a message stating that an unexpected disconnect occurred.
CustomMobileReaderListener.kt
Kotlin
class CustomMobileReaderListener : MobileReaderListener { // ... override fun onReaderReconnectStarted(reader: Reader, cancelReconnect: Cancelable, reason: DisconnectReason) { // 1. Notified at the start of a reconnection attempt // Use cancelable to stop reconnection at any time } override fun onReaderReconnectSucceeded(reader: Reader) { // 2. Notified when reader reconnection succeeds // App is now connected } override fun onReaderReconnectFailed(reader: Reader) { // 3. Notified when reader reconnection fails // App is now disconnected } // ... }

To handle reader disconnects yourself, you can do the following:

  1. Set autoReconnectOnUnexpectedDisconnect to false during connection.
  2. Handle the disconnect callback to display a message in the app alerting the user that the reader unexpectedly disconnected and initiate reader discovery and connection.
ReaderActivity.kt
Kotlin
class ReaderActivity : AppCompatActivity(), MobileReaderListener { // ... override fun onDisconnect(reason: DisconnectReason) { // Consider displaying a UI to notify the user and start rediscovering readers } // ... }

Reboot the connected reader

SDK Reference

  • rebootReader (Android)

Stripe Reader M2 and BBPOS WisePad 3 automatically reboot after operating for 24 hours. However, you can force the reader to reboot and reset its 24-hour timer by using the rebootReader API. After this action, the reader disconnects from the SDK and then reboots. If you’re using automatic reconnect, the SDK attempts to restore the connection with the reader.

RebootReaderActivity.kt
Kotlin
Terminal.getInstance().rebootReader( object : Callback { override fun onSuccess() { // Reboot succeeded and the reader will disconnect. // If your app is using automatic reconnect the reconnect will begin. } override fun onFailure(e: TerminalException) { // Placeholder for handling exception } } )

Automatic reconnection on application start

Stripe Terminal doesn’t automatically reconnect to a reader when your application starts. Instead, you can build a reconnection flow by storing reader IDs and attempting to connect to a known reader on startup.

  1. When you successfully connect to a reader, save its serial number in a persistent data storage location, such as the Shared Preferences API (Android).
  1. When your app launches, check the persistent data storage location for a saved serial number. If one is found, call the discoverReaders method so your application can try to find that reader again.
  2. If the saved serial number matches any of the discovered readers, try connecting to that reader with the matching reader object returned from the call to discoverReaders. If the previously connected reader isn’t found, stop the discovery process.

Display some UI during the discovery and connection process to indicate that an automatic reconnection is happening.

Update reader software
Client-side

SDK Reference

  • MobileReaderListener (Android)

Your application must update mobile readers to apply the following:

  • Regional configurations that keep you up to date with card network and issuer requirements
  • Security updates

Required updates start installing on connection to the reader. You can’t use the reader until updating completes.

Remarque

To install updates, the reader’s battery level must be higher than 50%.

Required updates

When immediately required updates are available for the reader, the integration’s MobileReaderListener receives onStartInstallingUpdate with a ReaderSoftwareUpdate.

The ReaderSoftwareUpdate provides the necessary details of the update, including an estimate of the total update duration, indicated by durationEstimate.

During the installation process, the Terminal’s connectionStatus transitions to ConnectionStatus.CONNECTING while the update installs on the reader.

Your application must notify users that an update is installing and display the progress in your UI. Make it clear why connecting might take longer than usual.

If the required update process fails, Stripe communicates the error to the MobileReaderListener with onFinishInstallingUpdate. You can’t reconnect to the reader after a required update fails, unless the following conditions are met:

  • The reader runs the latest software version for the location within the last 30 days.
  • The Android SDK version is greater than or equal to 3.5.0.

If the conditions are met, the connection process succeeds despite an incomplete update. Stripe retries the required update the next time you connect to that reader until it’s successfully installed.

ReaderActivity.kt
Kotlin
class ReaderActivity : AppCompatActivity(), MobileReaderListener { // ... override fun onStartInstallingUpdate(update: ReaderSoftwareUpdate, cancelable: Cancelable) { // Show UI communicating that a required update has started installing } override fun onReportReaderSoftwareUpdateProgress(progress: Float) { // Update the progress of the installation } override fun onFinishInstallingUpdate(update: ReaderSoftwareUpdate?, e: TerminalException?) { // Report success or failure of the update } // ... }

You can cancel required updates using the Cancelable object, which also results in a failed connection to the reader. You can’t cancel incremental-only updates.

Optional updates

You can defer optional updates until the specified date, after which they become required. The SDK notifies you of optional updates through the MobileReaderListener any time the reader is connected but not performing a transaction. If an optional update is available, your application’s MobileReaderListener receives the onReportAvailableUpdate callback with the ReaderSoftwareUpdate object containing the update details, including:

  • Estimated time for update to complete (durationEstimate)
  • Date after which the update becomes required (requiredAt)

In your application, notify users that an update is available, and display a prompt to optionally continue with the update.

To proceed with the update previously reported with onReportAvailableUpdate, call Terminal.getInstance().installAvailableUpdate.

The available update is also stored on the reader object as reader.availableUpdate.

As the update proceeds, block the user from leaving the page in your app, and instruct the user to keep the reader in range and powered on until the update completes. We recommend also providing your user with a visual indicator of the update’s progress. The MobileReaderListener reports the update’s progress in the onReportReaderSoftwareUpdateProgress method.

When an optional update’s requiredAt date has passed, the update installs the next time the reader is connected.

ReaderActivity.kt
Kotlin
class ReaderActivity : AppCompatActivity(), MobileReaderListener { // ... override fun onReportAvailableUpdate(update: ReaderSoftwareUpdate) { // An update is available for the connected reader. Show this update in your application. // Install this update using `Terminal.getInstance().installAvailableUpdate`. } // ... }

See Testing reader updates to learn more about making sure your application handles the different update types that a reader can have.

Next steps

You’ve connected your application to the reader. Next, collect your first Stripe Terminal payment.

The BBPOS and Chipper™ name and logo are trademarks or registered trademarks of BBPOS Limited in the United States and/or other countries. The Verifone® name and logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. Use of the trademarks does not imply any endorsement by BBPOS or Verifone.

Cette page vous a-t-elle été utile ?
OuiNon
Besoin d'aide ? Contactez le service Support.
Rejoignez notre programme d'accès anticipé.
Consultez notre log des modifications.
Des questions ? Contactez l'équipe commerciale.
LLM ? Lire llms.txt.
Propulsé par Markdoc