Aceptar un pago con compra exprés
Use a single integration to accept payments through one-click payment buttons.

The Express Checkout Element is an integration for accepting payments through one-click payment method buttons. Supported payment methods include Link, Apple Pay, Google Pay, PayPal, Klarna, and Amazon Pay.
Customers see different payment buttons depending on their device and browser. Compatible devices automatically support Google Pay and Link. You must complete additional steps to support Apple Pay and PayPal.
Try the demo
Toggle the prebuilt options in the demo to change the background color, layout, size, and shipping address collection. The demo displays Google Pay and Apple Pay only on their available platforms. Payment method buttons are only shown in their supported countries.
If you don’t see the demo, try viewing this page in a supported browser.
| Opción | Descripción |
|---|---|
| País del comerciante | Establécelo usando la clave publicable que usas para inicializar Stripe.js. Para cambiar el país, debes desmontar el Express Checkout Element, actualizar la clave publicable y, a continuación, volver a montar el Express Checkout Element. |
| Color de fondo | Define los colores con la API Elements Appearance. Los temas de botones se heredan de la API Appearance, pero también puedes definirlos directamente al crear el Element. |
| Tamaño para ordenadores de sobremesa y móviles | Usa el menú desplegable para establecer el ancho de píxel máximo del elemento principal en el que se monta el Express Checkout Element. Puedes configurarlo en 750 px (escritorio) o 320 px (móvil). |
| Máximo de columnas y filas | Establece estos valores usando el parámetro layout cuando crees el Express Checkout Element. |
| Menú de desbordamiento | Configura esto usando el parámetro layout cuando crees el Express Checkout Element. |
| Recolecta la dirección de envío | Para recolectar la información de envío, debes especificar opciones al crear el Express Checkout Element. Obtén más información sobre cómo recolectar datos del cliente y mostrar partidas individuales. |
Cosas a tener en cuenta
- Add a payment method to your browser. For example, you can add a card to your Google Pay account or to your Wallet for Safari.
- Serve your application over HTTPS. This is required in development and in production. You can use a service such as ngrok.
- Register your domain in both a sandbox and live mode.
Configurar StripeLado del servidor
Primero, crea una cuenta de Stripe o inicia sesión.
Usa nuestras bibliotecas oficiales para acceder a la API de Stripe desde tu aplicación:
Habilitar los métodos de pago
By default, Stripe uses your payment methods settings to determine which payment methods the Express Checkout Element presents. You can also configure specific payment methods on your Checkout Session using the payment_method_types attribute.
Métodos de pago admitidos
The card payment method type automatically enables Apple Pay and Google Pay. When using Link, you must also pass the card payment method type.
| Método de pago | Tipo de método de pago |
|---|---|
| Amazon Pay | amazon_ |
| Apple Pay | card |
| Google Pay | card |
| Link | link, card |
| PayPal | paypal |
Create a Checkout SessionLado del servidor
Create a Checkout Session on your server to control the payment flow. The Checkout Session defines your line items, shipping options, and other settings for the payment.
Set ui_ to custom to integrate with the Express Checkout Element. The returned Checkout Session includes a client secret, which the client uses to securely display the checkout interface.
You can configure additional options on the Checkout Session:
- phone_number_collection: Collect customer phone numbers
- shipping_address_collection: Collect shipping addresses
- shipping_options: Provide shipping rate options
- automatic_tax: Enable automatic tax calculation
Create and mount the Express Checkout ElementLado del cliente
The Express Checkout Element contains an iframe that securely sends the payment information to Stripe over an HTTPS connection. The checkout page address must also start with https://, rather than http://, for your integration to work.
Collect customer details and display line itemsLado del cliente
The Checkout Session you created on the server automatically determines the line items, total amount, and available payment methods. The Express Checkout Element uses this information to display the appropriate interface.
OpcionalListen to the ready eventLado del cliente
After mounting, the Express Checkout Element won’t show buttons for a brief period. To animate the Element when buttons appear, listen to the ready event. Inspect the availablePaymentMethods value to determine which buttons, if any, display in the Express Checkout Element.
OpcionalStyle the buttonLado del cliente
You can style each payment method button differently and control the overall appearance of the Express Checkout Element.
Prueba la integración
Before you go live, test each payment method integration. To determine a payment method’s browser compatibility, see supported browsers. If you use the Express Checkout Element within an iframe, the iframe must have the allow attribute set to payment *.
OpcionalUse the Express Checkout Element with Stripe Connect
Connect platforms can use the Express Checkout Element with Checkout Sessions by including the connected account in the session.
Compara las referencias de Customers v1 y Accounts v2
Si tu plataforma Connect utiliza Cuentas configuradas por el cliente, utiliza nuestra guía para reemplazar las referencias del cliente y de los eventos en tu código por las referencias equivalentes de la API Accounts v2.
When creating the Checkout Session on your server, include the connected account:
Command Linecurl https://api.stripe.com/v1/checkout/sessions \ -u sk_test_...: \ -d "line_items[0][price]"="price_..." \ -d "line_items[0][quantity]"=1 \ -d "mode"="payment" \ -d "ui_mode"="custom" \ -d "return_url"="https://example.com/return" \ -H "Stripe-Account:"{{CONNECTED_ACCOUNT_ID}}Register all of the domains where you plan to show the Express Checkout Element.
Comunica a tus clientes qué es Stripe
Stripe recoge información sobre las interacciones de los clientes con Elements para brindarte servicios, prevenir el fraude y mejorar sus servicios. Entre los datos recogidos, se incluyen el uso de cookies y direcciones IP para identificar qué Elements ha visto un cliente durante una sola sesión del proceso de compra. Tú eres responsable de divulgar y obtener todos los derechos y consentimientos necesarios para que Stripe use los datos de estas maneras. Para obtener más información, visita nuestro centro de privacidad.