Ir a contenido
Crea una cuenta
o
Inicia sesión
Logotipo de Stripe Docs
/
Pregúntale a la IA
Crear una cuenta
Iniciar sesión
Empieza ahora
Pagos
Ingresos
Plataformas y marketplaces
Gestión del dinero
Recursos para desarrolladores
Resumen
Acerca de Stripe Payments
Actualiza tu integración
Análisis de pagos
Pagos electrónicos
ResumenEncuentra tu caso de usoPagos administrados
Usa Payment Links
Crea una página del proceso de compra
Desarrolla una integración avanzada
Desarrolla una integración en la aplicación
Métodos de pago
Agrega métodos de pago
Gestiona los métodos de pago
Finalización de compra más rápida con Link
Interfaces de pago
Payment Links
Checkout
Elements para la web
Elements en la aplicación
Escenarios de pago
Administrar varias monedas
Flujos de pago personalizados
Capacidad adquirente flexible
Orquestación
Pagos en persona
Terminal
    Resumen
    Acepta pagos en persona
    Diseño de la integración
    Selecciona tu lector
    Diseña una integración
    Inicio rápido
    Aplicaciones de ejemplo
    Pruebas
    Configuración de Terminal
    Configura tu integración
    Conectarse a un lector
    Cómo aceptar un pago
    Cobra pagos con tarjeta
    Otros métodos de pago
    Acepta pagos sin conexión
    Pagos de pedidos telefónicos o pedidos por correo
    Consideraciones regionales
    Durante el proceso de compra
    Cobrar propinas
    Recopila y guarda datos de pago para usarlos más adelante
    Autorizaciones flexibles
    Después del proceso de compra
    Reembolsar transacciones
    Entregar recibos
    Personaliza Checkout
    Visualización del carrito
    Recopila entradas en pantalla
    Recopila datos deslizados
    Recopila datos pulsados para los instrumentos de NFC
    Aplicaciones en dispositivos
    Gestiona lectores
    Pide, devulve y sustituye lectores
    Lectores de registros
    Gestiona ubicaciones y zonas
    Configurar los lectores
    Monitoreo de los lectores
    Cifrado
    Referencias
    Referencias de la API
    Lectores móviles
    Lectores inteligentes
    Guía de migración del SDK
    Lista de verificación de la implementación
    Fichas de producto del lector de Stripe Terminal
Más allá de los pagos
Constituye tu empresa
Criptomonedas
Financial Connections
Climate
Comprender el fraude
Protección contra fraudes de Radar
Gestionar disputas
Verificar identidades
InicioPagosTerminal

Set up your integration

Set up a Stripe Terminal SDK or server-driven integration to accept in-person payments.

Precaución

Terminal’s React Native library is in public preview and in active development. Please report any issues you encounter to our github project.

Getting started with the React Native SDK requires four steps:

  1. Install the SDK in your app.
  2. Configure your app.
  3. Set up the connection token endpoint in your app and backend.
  4. Initialize the SDK in your app.

Install the SDK
Client-side

The React Native SDK is open source and fully documented. Internally, it makes use of native iOS and Android SDKs. Install the SDK by running:

Command Line
npm install @stripe/stripe-terminal-react-native

Configure your app
Client-side

Pods

You must run pod install in your ios directory to install the native dependencies.

Permissions

To prepare your app to work with the Stripe Terminal SDK, make a few changes to your Info.plist file in Xcode.

  1. Enable location services with the following key-value pair.

    Privacy – Location When In Use Usage Description
    KeyNSLocationWhenInUseUsageDescription
    ValueLocation access is required to accept payments.

    To reduce fraud risks associated with payments, and to minimize disputes, Stripe must know where payments occur. If the SDK can’t determine the location of the iOS device, payments are disabled until location access is restored.

  2. Make sure that your app runs in the background and remains connected to Bluetooth readers.

    Required background modes for Bluetooth readers
    KeyUIBackgroundModes
    Valuebluetooth-central (Uses Bluetooth LE accessories)

    Setting the bluetooth-central background mode lets the reader remain in standby mode when your app is running in the background, or when the iOS device is locked. Without this value, standby fails. When your app is running in the background, the reader can turn off automatically to conserve power.

  3. Allow your app to display a Bluetooth permission dialog. The app store requires including this, even if your app doesn’t support connecting to Bluetooth readers.

    Privacy - Bluetooth Always Usage Description
    KeyNSBluetoothAlwaysUsageDescription
    ValueThis app uses Bluetooth to connect to supported card readers.

    iOS 13 introduced more specific permissions concerning an app’s use of Bluetooth peripherals. Apps that link with Core Bluetooth must include this key in their Info.plist file to prevent the app from crashing on its first launch.

  4. Pass app validation checks when you submit it to the App Store. As of SDK version 3.4.0, this permission requirement is removed.

    Privacy – Bluetooth Peripheral Usage Description
    KeyNSBluetoothPeripheralUsageDescription
    ValueConnecting to supported card readers requires Bluetooth access.

    This is an example—you can rephrase the prompt for user permission in your app.

Save your app’s Info.plist. Now it’s configured correctly and ready for use with the Stripe Terminal SDK.

Set up the connection token endpoint
Server-side
Client-side

Server-side

To connect to a reader, your backend needs to give the SDK permission to use the reader with your Stripe account, by providing it with the secret from a ConnectionToken. Your backend needs to only create connection tokens for clients that it trusts.

Command Line
curl
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/terminal/connection_tokens \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -X "POST"

Obtain the secret from the ConnectionToken on your server and pass it to the client side.

Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
post '/connection_token' do token = # ... Create or retrieve the ConnectionToken {secret: token.secret}.to_json end

Precaución

The secret from the ConnectionToken lets you connect to any Stripe Terminal reader and take payments with your Stripe account. Be sure to authenticate the endpoint for creating connection tokens and protect it from cross-site request forgery (CSRF).

Client-side

To give the SDK access to this endpoint, create a token provider single function that requests a ConnectionToken from your backend.

Root.tsx
import { StripeTerminalProvider } from '@stripe/stripe-terminal-react-native'; const fetchTokenProvider = async () => { const response = await fetch(`{YOUR BACKEND URL}/connection_token`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, }); const { secret } = await response.json(); return secret; };

This function is called whenever the SDK needs to authenticate with Stripe or the Reader. It’s also called when a new connection token is needed to connect to a reader (for example, when your app disconnects from a reader). If the SDK can’t retrieve a new connection token from your backend, connecting to a reader fails with the error from your server.

Precaución

Do not cache or hardcode the connection token. The SDK manages the connection token’s lifecycle.

Initialize the SDK
Client-side

To get started, pass in your token provider implemented in Step 3 to StripeTerminalProvider as a prop.

Root.tsx
import { StripeTerminalProvider } from '@stripe/stripe-terminal-react-native'; function Root() { const fetchTokenProvider = async () => { const response = await fetch(`${API_URL}/connection_token`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, }); const { secret } = await response.json(); return secret; }; return ( <StripeTerminalProvider logLevel="verbose" tokenProvider={fetchTokenProvider} > <App /> </StripeTerminalProvider> ); }

As a last step, call the initialize method from useStripeTerminal hook. You must call the initialize method from a component nested within StripeTerminalProvider and not from the component that contains the StripeTerminalProvider.

App.tsx
function App() { const { initialize } = useStripeTerminal(); useEffect(() => { initialize(); }, [initialize]); return <View />; }

SDK updates

Stripe periodically releases updates which can include new functionality, bug fixes, and security updates. Update your SDK as soon as a new version is available. The currently available SDKs are:

  • Stripe Terminal Android SDK
  • Stripe Terminal iOS SDK
  • Stripe Terminal JavaScript SDK
  • Stripe Terminal React Native SDK

Next steps

  • Connect to a reader
¿Te fue útil esta página?
SíNo
  • ¿Necesitas ayuda? Ponte en contacto con soporte.
  • Únete a nuestro programa de acceso anticipado.
  • Echa un vistazo a nuestro registro de cambios.
  • ¿Tienes alguna pregunta? Contacto.
  • ¿LLM? Lee llms.txt.
  • Con tecnología de Markdoc