Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
How to create checkout session for payment intent?

I'm using stripe to create an payment integration in my system, after creating an payment intent i want to create checkout session for this payment, after this i want to retrieve an url property from this checkout and send to the user.

But i don't have an idea how to "connect" created payment intent to checkout session.

Right now i create payment intent in this way:

    const paymentIntent = await stripe.paymentIntents.create(
      {
        amount: 500,
        currency: "usd",
        customer: customerId
      },
      {
        stripeAccount: ""
      }
    );

and checkout session:

    const session = await stripe.checkout.sessions.create({
      success_url: "",
      cancel_url: "",
      mode: "payment",
      customer: customerId,
      payment_method_types: ["card"]
    });

The problem is in this, that i don't know how to create checkout session based on created before an payment intent.

Thanks for any help!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The Checkout Session itself will create a PaymentIntent. You can create an equivalent PaymentIntent with the line_items.price_data.unit_amount[1], line_items.price_data.currency[2], and customer[3] parameters of the checkout.sessions.create call. Make sure to pass in the stripeAccount parameter to your Session creation call as well if you want to create the Session/PaymentIntent on their account.

[1] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-unit_amount

[2] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-currency

[3] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda