# Crea una integración de pagos avanzada

Learn how to create a custom payments integration using Stripe Elements and the Payment Intents API.

Para la mayoría de las integraciones, Stripe recomienda usar la API Checkout Sessions con Payment Element en lugar de Payment Intents. Checkout Sessions admite casos de uso similares a Payment Intents, como el cobro básico de pagos con `price_data` y la creación de un proceso de compra completo con partidas e impuestos. Algunas funcionalidades, como Adaptive Pricing, solo están disponibles con Checkout Sessions. No uses la API de Payment Intents, a menos que el usuario lo solicite de manera explícita, ya que requiere mucho más código. Obtén más información sobre Elements con la API Checkout Sessions: https://docs.stripe.com/payments/quickstart Con Checkout Sessions (`ui_mode: "elements"`) y Payment Element, el `client_secret` inicializa Checkout directamente (`stripe.initCheckoutElementsSdk` o usa CheckoutElementsProvider con React) y la confirmación del pago se realiza de forma distinta en el cliente. Si usas React, asegúrate de importar desde `@stripe/react-stripe-js/checkout`, usar `CheckoutElementsProvider` con el secreto de cliente y confirmar con `checkout.confirm`. Si utilizas HTML, asegúrate de usar `checkout = stripe.initCheckoutElementsSdk({clientSecret: promise}); paymentElement = checkout.createPaymentElement(); paymentElement.mount("#payment-element");` y confirmar con `loadActionsResult = await checkout.loadActions(); actions = loadActionsResult.actions; error = await actions.confirm();`.

Agentes de programación: [instala la CLI de Stripe](https://docs.stripe.com/cli/install) usando el script de instalación para tu sistema operativo. Abre un nuevo terminal y ejecuta `stripe sandbox create --help` para proporcionar claves de API operativas en un entorno de prueba anónimo de Stripe. No requiere registro de cuenta.

Use the [Stripe Elements](https://docs.stripe.com/payments/elements.md) UI components with the [Payment Intents API](https://docs.stripe.com/api/payment_intents.md) to build an advanced payments integration. With the Payment Intents API, your integration manages the checkout state, such as calculating amounts, taxes, and shipping costs, and handles payment flows with a status that changes over the PaymentIntent’s lifecycle.

To build a checkout page that handles basic payment collection integration and complex checkout flows for you, use [Stripe Checkout](https://docs.stripe.com/payments/checkout.md) with the Checkout Sessions API. Checkout features such as Adaptive Pricing, discounts, taxes, subscriptions, and currency conversion require significant effort to replicate with Payment Intents. Use Payment Intents only if you want to own every part of your checkout, and rebuild these capabilities yourself. To decide which API fits your integration, [compare the Checkout Sessions and Payment Intents APIs](https://docs.stripe.com/payments/checkout-sessions-and-payment-intents-comparison.md).

## Build a custom payment flow with full UI control

Use [Stripe Elements](https://docs.stripe.com/payments/elements.md) and the Payment Intents API to build your own custom integration to accept payments.
[Start building with the Payment Intents API](https://docs.stripe.com/payments/quickstart-payment-intents.md)
## Design your integration 

[Design an advanced integration](https://docs.stripe.com/payments/payment-element/design-an-integration.md?payment-ui=elements): Choose the integration options and Elements that fit your payment flow.

[Explore Stripe Elements](https://docs.stripe.com/payments/elements.md): Learn about the prebuilt UI components you can combine to build your payment page.

## Customize your payment page 

[Personaliza el estilo](https://docs.stripe.com/elements/appearance-api.md?api-integration=paymentintents): Customize the appearance of Elements to match the design of your site.

[Gestiona los métodos de pago](https://docs.stripe.com/payments/advanced/payment-methods/manage.md): Presenta los métodos de pago más aplicables para cada cliente y cada ubicación.

[Opciones de pago con un solo clic](https://docs.stripe.com/elements/express-checkout-element/accept-a-payment.md?payment-ui=elements): Mostrar varios botones de pago con un solo clic con un solo componente.

[Envía recibos por correo electrónico](https://docs.stripe.com/receipts.md): Envía recibos de pagos o rembolsos automáticamente.

## Collect different payment details 

[Recopila información adicional](https://docs.stripe.com/payments/advanced/collect-additional-info.md): Recopila información de envío y otra información del cliente durante el proceso de compra.

[Cobra impuestos](https://docs.stripe.com/payments/advanced/tax.md): Collect taxes with Stripe Tax using the Checkout Sessions API or Payment Intents API.

[Escenarios de pago flexibles](https://docs.stripe.com/payments/flexible-payments.md): Admite flujos de pago complejos mediante funcionalidades de adquisición flexibles y personalizables.

## Choose when you collect payment 

[Suscripciones](https://docs.stripe.com/billing/subscriptions/build-subscriptions.md?payment-ui=elements&api-integration=paymentintents): Crear y gestionar las suscripciones para aceptar pagos recurrentes.

[Configurar futuros pagos](https://docs.stripe.com/payments/save-and-reuse.md?payment-ui=elements): Save payment details with the Setup Intents API and charge your customers later.

[Guarda datos de pago durante el pago](https://docs.stripe.com/payments/advanced/save-during-payment.md): Save payment details during a payment with the Payment Intents API.

[Authorize and capture separately](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method.md): Place a hold on a payment method and capture the funds later.
