# Configurar una suscripción con débito directo SEPA Obtén información sobre cómo crear y cobrar una suscripción con débito directo SEPA. # Integración avanzada Aprende a crear y cobrar una *suscripción* (A Subscription represents the product details associated with the plan that your customer subscribes to. Allows you to charge the customer on a recurring basis) con débito directo SEPA. > Si eres un usuario nuevo, usa el [Payment Element](https://docs.stripe.com/payments/payment-element.md) en lugar de usar Stripe Elements como se describe en esta guía. El Payment Element ofrece una vía de integración sin código con optimizaciones de conversión integradas. Para ver las instrucciones, consulta [Crear una suscripción](https://docs.stripe.com/billing/subscriptions/build-subscriptions.md?payment-ui=elements). ## Crear un producto y un precio [Dashboard] Los [Productos](https://docs.stripe.com/api/products.md) representan el artículo o servicio que vendes. Los [Precios](https://docs.stripe.com/api/prices.md) definen cuánto cobras un producto y con qué frecuencia. Esto incluye el costo del producto, la moneda aceptada y si se trata de un cargo único o recurrente. Si tienes pocos productos y precios, puedes crearlos y gestionarlos en el Dashboard. La guía toma como ejemplo una foto de archivo de un servicio por el que se cobra a los clientes una suscripción mensual de 15 EUR. Para modelar la suscripción: 1. Ve a la página de [Productos](https://dashboard.stripe.com/products?active=true) y haz clic en **Crear producto**. 1. Ingresa el **Nombre** del producto. De forma opcional, puedes agregar una **Descripción** y subir una imagen del producto. 1. Selecciona un **Código de impuesto del producto**. Obtén más información sobre [códigos de impuestos de productos](https://docs.stripe.com/tax/tax-codes.md). 1. Selecciona **Recurrente**. Luego ingresa **15** para el precio y selecciona **EUR** como la moneda. 1. Elige si deseas **Incluir impuestos en el precio**. Puedes usar el valor predeterminado de tu [configuración de impuestos](https://dashboard.stripe.com/test/settings/tax) o establecer el valor manualmente. En este ejemplo, selecciona **Automático**. 1. Selecciona **Mensual** para el **período de facturación**. 1. Haz clic en **Más opciones de tarifas**. Luego selecciona **Tarifa fija** como el modelo de tarifas para este ejemplo. Obtén más información sobre [tarifa fija](https://docs.stripe.com/products-prices/pricing-models.md#flat-rate) y otros [modelos de precios](https://docs.stripe.com/products-prices/pricing-models.md). 1. Agrega una **Descripción del precio** interna y una [Clave de búsqueda](https://docs.stripe.com/products-prices/manage-prices.md#lookup-keys) para organizar, consultar y actualizar precios específicos en el futuro. 1. Haz clic en **Siguiente**. Luego haz clic en **Agregar producto**. Después de crear el producto y el precio, registra el ID del precio para usarlo en pasos sucesivos. La página de tarifas te muestra el ID, que será similar a esto: `price_G0FvDp6vZvdwRZ`. ## Crea un cliente [Lado del servidor] Para crear una suscripción, debes agregar un cliente para reutilizar métodos de pago y dar seguimiento a los pagos recurrentes. > #### Usa la API Accounts v2 para representar a los clientes > > La API Accounts v2 suele estar disponible para usuarios Connect y en versión preliminar pública para otros usuarios de Stripe. Si eres parte de la versión preliminar Accounts v2, debes especificar una [versión preliminar](https://docs.stripe.com/api-v2-overview.md#sdk-and-api-versioning) en tu código. > > Para solicitar el acceso a la versión preliminar Accounts v2, > > Para la mayoría de los casos de uso, te recomendamos que[modeles a tus clientes como objetos Account configurados por el cliente](https://docs.stripe.com/accounts-v2/use-accounts-as-customers.md) en lugar de usar objetos [Customer](https://docs.stripe.com/api/customers.md). Crea un objeto [Account](https://docs.stripe.com/api/v2/core/accounts/create.md#v2_create_accounts-configuration-customer) o [Customer](https://docs.stripe.com/api/customers/create.md) configurado por el cliente cuando este cree una cuenta con tu empresa, o cuando guarde un método de pago. Asocia el ID del objeto con tu propia representación interna de un cliente. Crea un nuevo cliente o recupera uno existente para asociarlo con este pago. #### Accounts v2 ```curl curl -X POST https://api.stripe.com/v2/core/accounts \ -H "Authorization: Bearer <>" \ -H "Stripe-Version: 2026-05-27.preview" \ --json '{ "contact_email": "jenny.rosen@example.com", "display_name": "Jenny Rosen", "configuration": { "customer": {} }, "include": [ "configuration.customer" ] }' ``` #### Customers v1 ```curl curl https://api.stripe.com/v1/customers \ -u "<>:" \ -d "name=Jenny Rosen" \ --data-urlencode "email=jenny.rosen@example.com" ``` ## Crear la suscripción [Lado del servidor] Crea la *suscripción* (A Subscription represents the product details associated with the plan that your customer subscribes to. Allows you to charge the customer on a recurring basis) con los ID de cliente y precio. Devuelve al lado del cliente el `client_secret` del [confirmation_secret.client_secret](https://docs.stripe.com/api/invoices/object.md#invoice_object-confirmation_secret) de la última factura o, para las suscripciones que no cobran un pago por adelantado, el [pending_setup_intent](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-pending_setup_intent). Además, establece lo sigueinte: - Establece [payment_behavior](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-payment_behavior) en `default_incomplete` para simplificar el cobro de la orden de débito directo SEPA. - Establece [save_default_payment_method](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-payment_settings-save_default_payment_method) en `on_subscription` para guardar el método de pago como determinado para la suscripción cuando el pago se realiza correctamente. Guardar un método de pago predeterminado aumenta la tasa de éxito de futuros pagos de suscripción. #### Ruby ```ruby # Don't put any keys in code. See https://docs.stripe.com/keys-best-practices. # Find your keys at https://dashboard.stripe.com/apikeys. client = Stripe::StripeClient.new('<>') post '/create-subscription' do content_type 'application/json' data = JSON.parse(request.body.read) customer_id = cookies[:customer] price_id = data['priceId'] subscription = client.v1.subscriptions.create( customer: customer_id, items: [{ price: price_id, }], payment_behavior: 'default_incomplete', payment_settings: {save_default_payment_method: 'on_subscription'}, expand: ['latest_invoice.confirmation_secret', 'pending_setup_intent'] ) if subscription.pending_setup_intent != nil { type: 'setup', clientSecret: subscription.pending_setup_intent.client_secret }.to_json else { type: 'payment', clientSecret: subscription.latest_invoice.confirmation_secret.client_secret }.to_json end end ``` ## Recopilar datos del método de pago y la confirmación del mandato [Lado del cliente] Ya tienes todo listo para recopilar información de pago del lado del cliente con [Stripe Elements](https://docs.stripe.com/payments/elements.md). Elements es un conjunto de componentes de interfaz de usuario prediseñados para recopilar datos de pago. Un Stripe Element contiene un iframe que envía la información del pago a Stripe en modo seguro a través de una conexión HTTPS. La dirección de la página de finalización de compra también debe empezar con https:// en lugar de http:// para que funcione tu integración. Puedes probar tu integración sin usar HTTPS. [Habilítala](https://docs.stripe.com/security/guide.md#tls) cuando todo esté listo para aceptar pagos reales. ### Configurar Stripe Elements #### HTML + JS Stripe Elements se encuentra disponible automáticamente como función de Stripe.js. Incluye el script de Stripe.js en tu página de pago agregándolo al `head` de tu archivo HTML. Carga siempre Stripe.js directamente desde js.stripe.com para cumplir con la normativa PCI. No incluyas el script en un paquete ni alojes una copia en tus sistemas. ```html Submit Payment ``` Crea una instancia de Elements con el siguiente JavaScript en tu página de pago. Especifica el `modo` y la `moneda` para permitir que el Payment Element recopile los datos de pago por débito directo SEPA: ```javascript const stripe = Stripe('<>'); const options = { mode: 'setup', currency: 'eur', }; const elements = stripe.elements(options); ``` ### Agrega el Payment Element El Payment Element necesita un lugar donde ubicarse en tu formulario de pago. Crea un nodo DOM vacío (contenedor) con un ID único en tu formulario de pago. El Payment Element muestra automáticamente el formulario de débito directo SEPA y el texto de aceptación de la orden cuando el débito SEPA está habilitado: ```html
``` Cuando se cargue el formulario, [crea una instancia](https://docs.stripe.com/js/elements_object/create_element?type=payment) del Payment Element y móntala en el contenedor del Element. El Payment Element recopila automáticamente el nombre, el correo electrónico y el Código Internacional de Cuenta Bancaria (IBAN) del cliente, y muestra el texto de aceptación de la orden: ```javascript // Create and mount the Payment Element const paymentElement = elements.create('payment'); paymentElement.mount('#payment-element'); ``` #### React Instala [React Stripe.js](https://www.npmjs.com/package/@stripe/react-stripe-js) y el [cargador de Stripe.js](https://www.npmjs.com/package/@stripe/stripe-js) desde el registro público de npm: ```bash npm install --save @stripe/react-stripe-js @stripe/stripe-js ``` Pasa los datos de configuración (`modo: 'setup'`, `moneda`) al [proveedor Elements](https://docs.stripe.com/sdks/stripejs-react.md#elements-provider): ```jsx import React from 'react'; import {loadStripe} from '@stripe/stripe-js'; import {Elements} from '@stripe/react-stripe-js'; import PaymentSetupForm from './PaymentSetupForm'; // Make sure to call `loadStripe` outside of a component's render to avoid // recreating the `Stripe` object on every render. const stripePromise = loadStripe('<>'); export default function App() { const options = { mode: 'setup', currency: 'eur', }; return ( ); } ``` Crea un componente de formulario de configuración que represente el [PaymentElement](https://docs.stripe.com/sdks/stripejs-react.md#element-components): ```jsx import React from 'react'; import {PaymentElement} from '@stripe/react-stripe-js'; export default function PaymentSetupForm() { return (
); } ``` ## Enviar los datos del método de pago a Stripe [Lado del cliente] Usa [confirmSepaDebitPayment](https://docs.stripe.com/js/payment_intents/confirm_sepa_debit_payment#stripe_confirm_sepa_debit_payment-with_element) o, en el caso de las suscripciones que no cobran un pago por adelantado, [confirmSepaDebitSetup](https://docs.stripe.com/js/setup_intents/confirm_sepa_debit_setup#stripe_confirm_sepa_debit_setup-with_element) para confirmar la suscripción y crear un [PaymentMethod](https://docs.stripe.com/api/payment_methods.md) para débito directo SEPA. Incluye el nombre y la dirección de correo electrónico del cliente en las propiedades `payment_method.billing_details`. #### HTML + JS ```javascript // Define stripe with your publishable key var stripe = Stripe('pk_test_1234'); // Get the IBAN information from your element var iban = document.getElementById('iban-element'); const form = document.getElementById('payment-form'); const accountholderName = document.getElementById('accountholder-name'); const email = document.getElementById('email'); form.addEventListener('submit', async(event) => { event.preventDefault(); // Create the subscription const res = await fetch('/create-subscription', { method: 'POST', }); const {type, clientSecret} = await res.json(); const confirmIntent = type === 'setup' ? stripe.confirmSepaDebitSetup : stripe.confirmSepaDebitPayment; const {error} = await confirmIntent( clientSecret, { payment_method: { sepa_debit: iban, billing_details: { name: accountholderName.value, email: email.value, }, }, } ); }); ``` #### React ```jsx import React, {useState} from 'react'; import {useStripe, useElements, IbanElement} from '@stripe/react-stripe-js'; import IbanForm from './IbanForm'; export default function PaymentSetupForm() { const stripe = useStripe(); const elements = useElements(); const handleSubmit = async (event) => { // We don't want to let default form submission happen here, // which would refresh the page. event.preventDefault(); if (!stripe || !elements) { // Stripe.js hasn't yet loaded. // Make sure to disable form submission until Stripe.js has loaded. return; } const iban = elements.getElement(IbanElement); // For brevity, this example is using uncontrolled components for // the accountholder's name and email. In a real world app, you'd // probably want to use controlled components. // https://reactjs.org/docs/uncontrolled-components.html // https://reactjs.org/docs/forms.html#controlled-components const accountholderName = event.target['accountholder-name']; const email = event.target.email; // Create the subscription const res = await fetch('/create-subscription', { method: 'POST', }); const {type, clientSecret} = await res.json(); const confirmIntent = type === 'setup' ? stripe.confirmSepaDebitSetup : stripe.confirmSepaDebitPayment; const {error} = await confirmIntent(clientSecret, { payment_method: { sepa_debit: iban, billing_details: { name: accountholderName.value, email: email.value, }, }, }); if (error) { // Show error to your customer console.log(error.message); } else { // Show a confirmation message to your customer } }; return ( ); } ``` ## Configurar el método de pago predeterminado [Lado del servidor] Tienes que agregarle al cliente un método de pago guardado para que se puedan efectuar los próximos pagos. Configura el método de pago que recopilaste en el nivel superior del objeto que representa al consumidor (ya sea un objeto [Account](https://docs.stripe.com/api/v2/core/accounts/object.md) o [Customer](https://docs.stripe.com/api/customers/object.md) configurado por el cliente) y como el [método de pago predeterminado](https://docs.stripe.com/api/customers/update.md#update_customer-invoice_settings-default_payment_method) para las *facturas* (Invoices are statements of amounts owed by a customer. They track the status of payments from draft through paid or otherwise finalized. Subscriptions automatically generate invoices, or you can manually create a one-off invoice): #### Accounts v2 Si usas objetos Account configurados por el cliente para representar a tus clientes, establece [configuration.customer.billing.default_payment_method](https://docs.stripe.com/api/v2/core/accounts/update.md#v2_update_accounts-configuration-customer-billing-default_payment_method): ```curl curl -X POST https://api.stripe.com/v2/core/accounts/acct_Gk0uVzT2M4xOKD \ -H "Authorization: Bearer <>" \ -H "Stripe-Version: 2026-05-27.preview" \ --json '{ "configuration": { "customer": { "billing": { "default_payment_method": "pm_1F0c9v2eZvKYlo2CJDeTrB4n" } } } }' ``` #### Customers v1 Si usas objetos `Customer` para representar a tus clientes, establece [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/update.md#update_customer-invoice_settings-default_payment_method): ```curl curl https://api.stripe.com/v1/customers/cus_Gk0uVzT2M4xOKD \ -u "<>:" \ -d "invoice_settings[default_payment_method]=pm_1F0c9v2eZvKYlo2CJDeTrB4n" ``` ## Gestionar el estado de la suscripción [Lado del cliente] Si el pago inicial se efectúa correctamente, el estado de la *suscripción* será `active` y no será necesario hacer nada más. Si los pagos fallan, el estado cambia al **estado de suscripción** definido en tu [configuración de cobro automático](https://docs.stripe.com/invoicing/automatic-collection.md). Debes notificar al cliente si falla el pago y [cobrarle con un método de pago distinto](https://docs.stripe.com/billing/subscriptions/overview.md#requires-payment-method). ## Probar la integración Puedes probar tu integración usando los Códigos Internacionales de Cuenta Bancaria (IBAN) que figuran a continuación. Los detalles del método de pago se recopilan para cada IBAN, pero muestran un comportamiento diferente cuando se cobran. ##### Prueba los IBAN Usa estos IBAN de prueba con el Payment Element para probar tu integración de débito directo SEPA. El Payment Element valida automáticamente el Código Internacional de Cuenta Bancaria (IBAN) y muestra la orden cuando ingresas uno de estos valores de prueba. ### AT | Account Number | Token | Description | | -------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | AT611904300234573201 | pm_success_at | The PaymentIntent status transitions from `processing` to `succeeded`. | | AT321904300235473204 | pm_successDelayed_at | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | AT861904300235473202 | pm_failed_at | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | AT051904300235473205 | pm_failedDelayed_at | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | AT591904300235473203 | pm_disputed_at | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | AT981904300000343434 | pm_exceedsWeeklyVolumeLimit_at | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | AT601904300000121212 | pm_exceedsWeeklyTransactionLimit_at | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | AT981904300002222227 | pm_insufficientFunds_at | The payment fails with an `insufficient_funds` failure code. | ### BE | Account Number | Token | Description | | ---------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | BE62510007547061 | pm_success_be | The PaymentIntent status transitions from `processing` to `succeeded`. | | BE78510007547064 | pm_successDelayed_be | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | BE68539007547034 | pm_failed_be | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | BE51510007547065 | pm_failedDelayed_be | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | BE08510007547063 | pm_disputed_be | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | BE90510000343434 | pm_exceedsWeeklyVolumeLimit_be | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | BE52510000121212 | pm_exceedsWeeklyTransactionLimit_be | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | BE90510002222227 | pm_insufficientFunds_be | The payment fails with an `insufficient_funds` failure code. | ### HR | Account Number | Token | Description | | --------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | HR7624020064583467589 | pm_success_hr | The PaymentIntent status transitions from `processing` to `succeeded`. | | HR6323600002337876649 | pm_successDelayed_hr | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | HR2725000096983499248 | pm_failed_hr | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | HR6723600004878117427 | pm_failedDelayed_hr | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | HR8724840081455523553 | pm_disputed_hr | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | HR7424020060000343434 | pm_exceedsWeeklyVolumeLimit_hr | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | HR3624020060000121212 | pm_exceedsWeeklyTransactionLimit_hr | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | HR7424020060002222227 | pm_insufficientFunds_hr | The payment fails with an `insufficient_funds` failure code. | ### EE | Account Number | Token | Description | | -------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | EE382200221020145685 | pm_success_ee | The PaymentIntent status transitions from `processing` to `succeeded`. | | EE222200221020145682 | pm_successDelayed_ee | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | EE762200221020145680 | pm_failed_ee | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | EE922200221020145683 | pm_failedDelayed_ee | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | EE492200221020145681 | pm_disputed_ee | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | EE672200000000343434 | pm_exceedsWeeklyVolumeLimit_ee | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | EE292200000000121212 | pm_exceedsWeeklyTransactionLimit_ee | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | EE672200000002222227 | pm_insufficientFunds_ee | The payment fails with an `insufficient_funds` failure code. | ### FI | Account Number | Token | Description | | ------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | FI2112345600000785 | pm_success_fi | The PaymentIntent status transitions from `processing` to `succeeded`. | | FI3712345600000788 | pm_successDelayed_fi | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | FI9112345600000786 | pm_failed_fi | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | FI1012345600000789 | pm_failedDelayed_fi | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | FI6412345600000787 | pm_disputed_fi | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | FI6712345600343434 | pm_exceedsWeeklyVolumeLimit_fi | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | FI2912345600121212 | pm_exceedsWeeklyTransactionLimit_fi | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | FI6712345602222227 | pm_insufficientFunds_fi | The payment fails with an `insufficient_funds` failure code. | ### FR | Account Number | Token | Description | | --------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | FR1420041010050500013M02606 | pm_success_fr | The PaymentIntent status transitions from `processing` to `succeeded`. | | FR3020041010050500013M02609 | pm_successDelayed_fr | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | FR8420041010050500013M02607 | pm_failed_fr | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | FR7920041010050500013M02600 | pm_failedDelayed_fr | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | FR5720041010050500013M02608 | pm_disputed_fr | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | FR9720041010050000000343434 | pm_exceedsWeeklyVolumeLimit_fr | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | FR5920041010050000000121212 | pm_exceedsWeeklyTransactionLimit_fr | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | FR9720041010050000002222227 | pm_insufficientFunds_fr | The payment fails with an `insufficient_funds` failure code. | ### DE | Account Number | Token | Description | | ---------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | DE89370400440532013000 | pm_success_de | The PaymentIntent status transitions from `processing` to `succeeded`. | | DE08370400440532013003 | pm_successDelayed_de | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | DE62370400440532013001 | pm_failed_de | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | DE78370400440532013004 | pm_failedDelayed_de | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | DE35370400440532013002 | pm_disputed_de | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | DE65370400440000343434 | pm_exceedsWeeklyVolumeLimit_de | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | DE27370400440000121212 | pm_exceedsWeeklyTransactionLimit_de | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | DE65370400440002222227 | pm_insufficientFunds_de | The payment fails with an `insufficient_funds` failure code. | ### GI | Account Number | Token | Description | | ----------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | GI60MPFS599327643783385 | pm_success_gi | The PaymentIntent status transitions from `processing` to `succeeded`. | | GI08RRNW626436291644533 | pm_successDelayed_gi | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | GI41SAFA461293238477751 | pm_failed_gi | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | GI50LROG772261344693297 | pm_failedDelayed_gi | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | GI26KJBC361883934534696 | pm_disputed_gi | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | GI14NWBK000000000343434 | pm_exceedsWeeklyVolumeLimit_gi | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | GI73NWBK000000000121212 | pm_exceedsWeeklyTransactionLimit_gi | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | GI14NWBK000000002222227 | pm_insufficientFunds_gi | The payment fails with an `insufficient_funds` failure code. | ### IE | Account Number | Token | Description | | ---------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | IE29AIBK93115212345678 | pm_success_ie | The PaymentIntent status transitions from `processing` to `succeeded`. | | IE24AIBK93115212345671 | pm_successDelayed_ie | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | IE02AIBK93115212345679 | pm_failed_ie | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | IE94AIBK93115212345672 | pm_failedDelayed_ie | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | IE51AIBK93115212345670 | pm_disputed_ie | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | IE10AIBK93115200343434 | pm_exceedsWeeklyVolumeLimit_ie | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | IE69AIBK93115200121212 | pm_exceedsWeeklyTransactionLimit_ie | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | IE10AIBK93115202222227 | pm_insufficientFunds_ie | The payment fails with an `insufficient_funds` failure code. | ### LI | Account Number | Token | Description | | --------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | LI0508800636123378777 | pm_success_li | The PaymentIntent status transitions from `processing` to `succeeded`. | | LI4408800387787111369 | pm_successDelayed_li | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | LI1208800143823175626 | pm_failed_li | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | LI4908800356441975566 | pm_failedDelayed_li | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | LI7708800125525347723 | pm_disputed_li | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | LI2408800000000343434 | pm_exceedsWeeklyVolumeLimit_li | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | LI8308800000000121212 | pm_exceedsWeeklyTransactionLimit_li | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | LI2408800000002222227 | pm_insufficientFunds_li | The payment fails with an `insufficient_funds` failure code. | ### LT | Account Number | Token | Description | | -------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | LT121000011101001000 | pm_success_lt | The PaymentIntent status transitions from `processing` to `succeeded`. | | LT281000011101001003 | pm_successDelayed_lt | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | LT821000011101001001 | pm_failed_lt | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | LT981000011101001004 | pm_failedDelayed_lt | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | LT551000011101001002 | pm_disputed_lt | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | LT591000000000343434 | pm_exceedsWeeklyVolumeLimit_lt | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | LT211000000000121212 | pm_exceedsWeeklyTransactionLimit_lt | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | LT591000000002222227 | pm_insufficientFunds_lt | The payment fails with an `insufficient_funds` failure code. | ### LU | Account Number | Token | Description | | -------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | LU280019400644750000 | pm_success_lu | The PaymentIntent status transitions from `processing` to `succeeded`. | | LU440019400644750003 | pm_successDelayed_lu | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | LU980019400644750001 | pm_failed_lu | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | LU170019400644750004 | pm_failedDelayed_lu | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | LU710019400644750002 | pm_disputed_lu | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | LU900010000000343434 | pm_exceedsWeeklyVolumeLimit_lu | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | LU520010000000121212 | pm_exceedsWeeklyTransactionLimit_lu | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | LU900010000002222227 | pm_insufficientFunds_lu | The payment fails with an `insufficient_funds` failure code. | ### NL | Account Number | Token | Description | | ------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | NL39RABO0300065264 | pm_success_nl | The PaymentIntent status transitions from `processing` to `succeeded`. | | NL55RABO0300065267 | pm_successDelayed_nl | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | NL91ABNA0417164300 | pm_failed_nl | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | NL28RABO0300065268 | pm_failedDelayed_nl | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | NL82RABO0300065266 | pm_disputed_nl | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | NL27RABO0000343434 | pm_exceedsWeeklyVolumeLimit_nl | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | NL86RABO0000121212 | pm_exceedsWeeklyTransactionLimit_nl | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | NL27RABO0002222227 | pm_insufficientFunds_nl | The payment fails with an `insufficient_funds` failure code. | ### NO | Account Number | Token | Description | | --------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | NO9386011117947 | pm_success_no | The PaymentIntent status transitions from `processing` to `succeeded`. | | NO8886011117940 | pm_successDelayed_no | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | NO6686011117948 | pm_failed_no | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | NO6186011117941 | pm_failedDelayed_no | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | NO3986011117949 | pm_disputed_no | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | NO0586010343434 | pm_exceedsWeeklyVolumeLimit_no | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | NO6486010121212 | pm_exceedsWeeklyTransactionLimit_no | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | NO0586012222227 | pm_insufficientFunds_no | The payment fails with an `insufficient_funds` failure code. | ### PT | Account Number | Token | Description | | ------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | PT50000201231234567890154 | pm_success_pt | The PaymentIntent status transitions from `processing` to `succeeded`. | | PT66000201231234567890157 | pm_successDelayed_pt | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | PT23000201231234567890155 | pm_failed_pt | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | PT39000201231234567890158 | pm_failedDelayed_pt | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | PT93000201231234567890156 | pm_disputed_pt | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | PT05000201230000000343434 | pm_exceedsWeeklyVolumeLimit_pt | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | PT64000201230000000121212 | pm_exceedsWeeklyTransactionLimit_pt | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | PT05000201230000002222227 | pm_insufficientFunds_pt | The payment fails with an `insufficient_funds` failure code. | ### ES | Account Number | Token | Description | | ------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ES0700120345030000067890 | pm_success_es | The PaymentIntent status transitions from `processing` to `succeeded`. | | ES2300120345030000067893 | pm_successDelayed_es | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | ES9121000418450200051332 | pm_failed_es | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | ES9300120345030000067894 | pm_failedDelayed_es | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | ES5000120345030000067892 | pm_disputed_es | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | ES1700120345000000343434 | pm_exceedsWeeklyVolumeLimit_es | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | ES7600120345000000121212 | pm_exceedsWeeklyTransactionLimit_es | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | ES1700120345000002222227 | pm_insufficientFunds_es | The payment fails with an `insufficient_funds` failure code. | ### SE | Account Number | Token | Description | | ------------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | SE3550000000054910000003 | pm_success_se | The PaymentIntent status transitions from `processing` to `succeeded`. | | SE5150000000054910000006 | pm_successDelayed_se | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | SE0850000000054910000004 | pm_failed_se | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | SE2450000000054910000007 | pm_failedDelayed_se | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | SE7850000000054910000005 | pm_disputed_se | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | SE2850000000000000343434 | pm_exceedsWeeklyVolumeLimit_se | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | SE8750000000000000121212 | pm_exceedsWeeklyTransactionLimit_se | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | SE2850000000000002222227 | pm_insufficientFunds_se | The payment fails with an `insufficient_funds` failure code. | ### CH | Account Number | Token | Description | | --------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | CH9300762011623852957 | pm_success_ch | The PaymentIntent status transitions from `processing` to `succeeded`. | | CH8656663438253651553 | pm_successDelayed_ch | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | CH5362200119938136497 | pm_failed_ch | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | CH1843597160341964438 | pm_failedDelayed_ch | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | CH1260378413965193069 | pm_disputed_ch | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | CH1800762000000343434 | pm_exceedsWeeklyVolumeLimit_ch | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | CH7700762000000121212 | pm_exceedsWeeklyTransactionLimit_ch | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | CH1800762000002222227 | pm_insufficientFunds_ch | The payment fails with an `insufficient_funds` failure code. | ### GB | Account Number | Token | Description | | ---------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | GB82WEST12345698765432 | pm_success_gb | The PaymentIntent status transitions from `processing` to `succeeded`. | | GB98WEST12345698765435 | pm_successDelayed_gb | The PaymentIntent status transitions from `processing` to `succeeded` after at least three minutes. | | GB55WEST12345698765433 | pm_failed_gb | The PaymentIntent status transitions from `processing` to `requires_payment_method`. | | GB71WEST12345698765436 | pm_failedDelayed_gb | The PaymentIntent status transitions from `processing` to `requires_payment_method` after at least three minutes. | | GB28WEST12345698765434 | pm_disputed_gb | The PaymentIntent status transitions from `processing` to `succeeded`, but a dispute is immediately created. | | GB70WEST12345600343434 | pm_exceedsWeeklyVolumeLimit_gb | The payment fails with a `charge_exceeds_source_limit` failure code due to payment amount causing account to exceed its weekly payment volume limit. | | GB32WEST12345600121212 | pm_exceedsWeeklyTransactionLimit_gb | The payment fails with a `charge_exceeds_weekly_limit` failure code due to payment amount exceeding account's transaction volume limit. | | GB70WEST12345602222227 | pm_insufficientFunds_gb | The payment fails with an `insufficient_funds` failure code. | ## Optional: Establecer el período de facturación Al crear una suscripción, automáticamente se define el ciclo de facturación de forma predeterminada. Por ejemplo, si un cliente se suscribe a un plan mensual el 7 de septiembre, se le facturará el día 7 de cada mes posterior. Algunas empresas prefieren configurar el ciclo de facturación de forma manual, así pueden cobrarles a sus clientes en la misma fecha cada ciclo. El argumento [billing cycle anchor](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-billing_cycle_anchor) te permite hacer esto. #### Accounts v2 ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "items[0][price]={{PRICE_ID}}" \ -d billing_cycle_anchor=1611008505 ``` #### Customers v1 ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d "customer={{CUSTOMER_ID}}" \ -d "items[0][price]={{PRICE_ID}}" \ -d billing_cycle_anchor=1611008505 ``` Si se configura el ciclo de facturación manualmente, se le cobra al cliente de forma automática un importe prorrateado por el tiempo que pasó entre la creación de la suscripción y la delimitación del ciclo de facturación. Si no quieres cobrarles ese período a los clientes, puedes establecer el argumento [proration_behavior](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-proration_behavior) en `none`. También puedes combinar la delimitación del ciclo de facturación con [períodos de prueba](https://docs.stripe.com/billing/subscriptions/sepa-debit.md#trial-periods) para brindarles a los usuarios acceso gratis a tu producto y después cobrarles un importe prorrateado. ## Optional: Períodos de prueba para suscripciones Las pruebas gratuitas le dan a los clientes acceso gratis a tu producto por un determinado tiempo. Usar períodos de prueba gratuitos no es lo mismo que establecer [proration_behavior](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-proration_behavior) en `none` porque puedes personalizar cuánto tiempo durará el período gratuito. Para definir este período, debes especificar una marca de tiempo de [finalización de la prueba](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-trial_end). #### Accounts v2 ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "items[0][price]={{PRICE_ID}}" \ -d trial_end=1610403705 ``` #### Customers v1 ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d "customer={{CUSTOMER_ID}}" \ -d "items[0][price]={{PRICE_ID}}" \ -d trial_end=1610403705 ``` También puedes combinar un [delimitador del ciclo de facturación](https://docs.stripe.com/billing/subscriptions/sepa-debit.md#billing-cycle) con una prueba gratuita. Por ejemplo, es 15 de septiembre y quieres darle a tu cliente acceso a una prueba gratuita durante siete días y después comenzar el ciclo normal de facturación el 1 de octubre. Puedes establecer que la prueba gratuita finalice el 22 de septiembre y el ciclo de facturación en 1 de octubre. Esta opción le brinda al cliente una prueba gratuita por siete días y después se le cobrará un importe prorrateado por el tiempo transcurrido entre que finaliza la prueba gratuita y el 1 de octubre. El 1 de octubre le cobrarás el importe normal de la suscripción por el primer ciclo completo de facturación. ## Optional: Crear pagos con débito directo SEPA usando otros métodos de pago > Esta documentación hace referencia a una funcionalidad *heredada* (Technology that's no longer recommended) (el `idealBank` Element) que ya no está disponible en la última versión de Stripe.js. Te recomendamos usar [Payment Element](https://docs.stripe.com/payments/payment-element.md), un componente de interfaz de usuario (IU) para la web que acepta más de 40 métodos de pago, valida los datos ingresados y gestiona los errores. Puedes crear pagos con débito directo SEPA usando otros métodos de pago como [Bancontact](https://docs.stripe.com/payments/bancontact/set-up-payment.md) e [iDEAL](https://docs.stripe.com/payments/ideal/set-up-payment.md). El uso de estos métodos de pago requiere algunos pasos adicionales. Para iDEAL: 1. Usa un [idealBank Element](https://docs.stripe.com/js/elements_object/create_element?type=idealBank) para recopilar información de pago. 1. Confirma la suscripción mediante [confirmIdealPayment](https://docs.stripe.com/js/payment_intents/confirm_ideal_payment) o, para las suscripciones que no cobran un pago por adelantado, [confirmIdealSetup](https://docs.stripe.com/js/setup_intents/confirm_ideal_setup). 1. [Enumera los métodos de pago del cliente](https://docs.stripe.com/api/payment_methods/customer_list.md), busca el método de pago de débito directo SEPA y establécelo como [método de pago predeterminado](https://docs.stripe.com/billing/subscriptions/sepa-debit.md#set-default-payment-method) del cliente. En el caso de Bancontact, sustituye: - `confirmIdealPayment` para [confirmBancontactPayment](https://docs.stripe.com/js/payment_intents/confirm_bancontact_payment) - `confirmIdealSetup` para [confirmBancontactSetup](https://docs.stripe.com/js/setup_intents/confirm_bancontact_setup)