Aceptar una transferencia bancaria
Utiliza la API Payment Intents para aceptar pagos con transferencia bancaria.
La primera vez que aceptas un pago mediante transferencia bancaria de un cliente, Stripe genera una cuenta bancaria virtual para ese cliente, que luego puedes compartir con esa persona directamente. Todos los pagos futuros con transferencia bancaria de ese cliente se envían a esta cuenta bancaria. En algunos países, Stripe también te proporciona un número de referencia para transferencias exclusivo que tu cliente debe incluir en cada transferencia a fin de facilitar la comparación entre la transferencia y los pagos pendientes. En algunos países hay límites en la cantidad de números de cuentas bancarias virtuales que puedes crear gratis.
Puedes encontrar un resumen de los pasos más comunes para aceptar un pago mediante transferencia bancaria en el siguiente diagrama de secuencia:
Manejo de pagos insuficientes y sobrepagos
En el caso de los pagos con transferencia bancaria, es posible que el cliente te envíe un importe mayor o menor que el importe de pago previsto. Si el cliente envía un importe menor, Stripe cubre parte de un Payment Intent abierto. Las facturas no se cubren en parte, sino que quedan abiertas hasta que se reciben fondos para cubrir el importe total.
If the customer sends more than the expected amount, Stripe attempts to reconcile the incoming funds against an open payment and keep the remaining excess amount in the customer cash balance. You can find more details on how Stripe handles reconciliation in the reconciliation section of our documentation.
Cómo gestionar varias facturas o pagos abiertos
Puedes tener varias facturas o pagos abiertos que se pueden saldar con una transferencia bancaria. Según la configuración predeterminada, Stripe hará el intento de conciliar automáticamente la transferencia bancaria utilizando datos como el código de referencia de la transferencia o el importe transferido.
Puedes deshabilitar la conciliación automática y conciliar manualmente pagos y facturas tú mismo. Puedes omitir el comportamiento de conciliación automática por cliente configurando el modo de conciliación en manual.
Configurar StripeLado del servidor
First, you need a Stripe account. Register now.
Usa nuestras bibliotecas oficiales para acceder a la API de Stripe desde tu aplicación:
Crear o recuperar un objeto CustomerLado del servidor
You must associate a Customer object to reconcile each bank transfer payment. If you have an existing Customer object, you can skip this step. Otherwise, create a new Customer object.
Crear un PaymentIntentLado del servidor
A PaymentIntent is an object that represents your intent to collect payment from a customer and tracks the lifecycle of the payment process through each stage. Create a PaymentIntent on the server, specifying the amount and currency you want to collect. You must also populate the customer parameter of the PaymentIntent creation request. Bank transfers aren’t available on PaymentIntents without a customer.
Recopilar datos de pagoLado del cliente
Collect payment details on the client with the Payment Element. The Payment Element is a prebuilt UI component that simplifies collecting payment details for a variety of payment methods.
El Payment Element contiene un iframe que envía la información de pago a Stripe de manera segura a través de una conexión HTTPS. Evita colocar el Payment Element dentro de otro iframe porque algunos métodos de pago requieren redirigir a otra página para la confirmación del pago.
The checkout page address must start with https://
rather than http://
for your integration to work. You can test your integration without using HTTPS, but remember to enable it when you’re ready to accept live payments.
El Payment Element renderiza un formulario dinámico que le permite a tu cliente elegir un método de pago. Para cada método de pago, el formulario le pide automáticamente al cliente que complete todos los datos de pago necesarios.
Personaliza el aspecto
Customize the Payment Element to match the design of your site by passing the appearance object into options
when creating the Elements
provider.
Recopila las direcciones
By default, the Payment Element only collects the necessary billing address details. To collect a customer’s full billing address (to calculate the tax for digital goods and services, for example) or shipping address, use the Address Element.
Una vez recibida la confirmación, Stripe abre automáticamente un cuadro de diálogo para mostrarle los datos de la transferencia bancaria al cliente.
Enviar pago a StripeLado del cliente
Use stripe.confirmPayment to complete the payment using details from the Payment Element. Provide a return_url to this function to indicate where Stripe should redirect the user after they complete the payment. Your user may be first redirected to an intermediate site, like a bank authorization page, before being redirected to the return_
. Card payments immediately redirect to the return_
when a payment is successful.
If you don’t want to redirect for card payments after payment completion, you can set redirect to if_
. This only redirects customers that check out with redirect-based payment methods.
Asegúrate de que la return_
corresponda a una página de tu sitio web que proporcione el estado del pago. Cuando Stripe redirige al cliente a la return_
, proporcionamos los siguientes parámetros de consulta de URL:
Parámetro | Descripción |
---|---|
payment_ | El identificador único del PaymentIntent . |
payment_ | The client secret of the PaymentIntent object. |
Precaución
Si tienes herramientas que rastrean la sesión del navegador del cliente, es posible que debas agregar el dominio stripe.
a la lista de exclusión de referentes. Los redireccionamientos hacen que algunas herramientas creen nuevas sesiones, lo que te impide realizar un seguimiento de la sesión completa.
Use one of the query parameters to retrieve the PaymentIntent. Inspect the status of the PaymentIntent to decide what to show your customers. You can also append your own query parameters when providing the return_
, which persist through the redirect process.
Confirma que el PaymentIntent se procesó correctamente
El estado del PaymentIntent es requires_
hasta que los fondos llegan a la cuenta bancaria. Cuando los fondos están listos, el estado del PaymentIntent se actualiza y pasa de requires_
a succeeded
.
Tu punto de conexión de webhooks debe estar configurado para empezar a recibir el evento payment_
. Cuando solo se paga parte del PaymentIntent, el estado sigue siendo requires_
.
You can add a webhook from the Dashboard.
Alternatively, you can use the Webhook Endpoints API to start receiving the payment_intent.partially_funded event.
Precaución
The Stripe CLI doesn’t support triggering beta API version events, such as payment_
.
The following events are sent during the payment funding flow when the PaymentIntent is updated.
Evento | Descripción | Próximos pasos |
---|---|---|
payment_ | Se envía durante la confirmación cuando no hay fondos suficientes en el saldo de cliente para conciliar el PaymentIntent. El estado del PaymentIntent pasa a requires_ . | Indícale a tu cliente que envíe una transferencia bancaria con el amount_ . |
payment_ | The customer sent a bank transfer that was applied to the PaymentIntent, but wasn’t enough to complete the payment. This might happen because the customer transferred an insufficient amount (because of a mistaken underpayment or fees charged by their bank) or because a remaining customer balance was applied to this PaymentIntent. PaymentIntents that are partially funded aren’t reflected in your account balance until the payment is complete. | Instruct your customer to send another bank transfer with the new amount_ to complete the payment. If you want to complete the payment with the partially applied funds, you can update the amount and confirm the PaymentIntent again. |
payment_ | El pago del cliente se efectuó correctamente. | Fulfill the goods or services that the customer purchased. |
Precaución
When you change the amount of a partially funded PaymentIntent, the funds are returned to the customer balance. If other PaymentIntents are open, Stripe funds those automatically. If the customer is configured for manual reconciliation, you need to apply the funds again.
We recommend using webhooks to confirm the charge has succeeded and to notify the customer that the payment is complete.
Sample code 
Ver pagos pendientes en el Dashboard
You can view all pending bank transfer PaymentIntents in the Dashboard by applying the Waiting on funding filter to Status .
Probar tu integración
Puedes probar tu integración simulando una transferencia bancaria entrante con la API, a través del Dashboard o con una versión beta de la CLI de Stripe.
Cómo gestionar problemas temporales de disponibilidad
Los siguientes códigos de error indican errores temporales en la disponibilidad del método de pago:
Código | Descripción | Handling |
---|---|---|
payment_ | Too many requests were made in quick succession for this payment method, which has stricter limits than the API-wide rate limits. | These errors can persist for several API requests when many of your customers try to use the same payment method, such as during an ongoing sale on your website. In this case, ask your customers to choose a different payment method. |
Precaución
Si prevés un consumo intensivo en general o debido a un próximo evento, contáctanos tan pronto como lo sepas.